blob: 7eb84039ec088c65d9a350f143c6bb25ecedc800 [file] [log] [blame]
{% from "jenkins/map.jinja" import master with context %}
{{ master.home }}/updates:
file.directory:
- user: jenkins
- group: nogroup
setup_jenkins_cli:
cmd.run:
- names:
- sleep 30
- wget http://localhost:{{ master.http.port }}/jnlpJars/jenkins-cli.jar
- unless: "[ -f /root/jenkins-cli.jar ]"
- cwd: /root
{%- for plugin in master.plugins %}
install_jenkins_plugin_{{ plugin.name }}:
cmd.run:
- name: java -jar jenkins-cli.jar -s http://localhost:{{ master.http.port }} install-plugin --username admin --password {{ master.user.admin.password }} {{ plugin.name }}
- unless: "[ -d {{ master.home }}/plugins/{{ plugin.name }} ]"
- cwd: /root
- require:
- cmd: setup_jenkins_cli
{%- endfor %}