Created
September 18, 2015 16:10
-
-
Save openfly/a83486cd56acc45b6dbc to your computer and use it in GitHub Desktop.
example of dict iteration in salt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dict.sls | |
{ | |
plugin: "http://url/path/plugin.jpi" | |
} | |
state.sls | |
{%- import_yaml "dict.sls" as custom_plugins %} | |
{% for cust_plugin,cust_plugin_url in dict.iteritems() %} | |
# manually downloading the plugin, because jenkins-cli.jar doesn't seem to work direct to artifactory URLs. | |
download-plugin-{{ cust_plugin }}: | |
cmd.run: | |
- name: curl -o {{ cust_plugin }}.jpi -O "https://{{ repo_username }}:{{ repo_password }}@{{ cust_plugin_url }}" | |
- unless: java -jar jenkins-cli.jar -s "http://127.0.0.1:8080" list-plugins | grep "{{ cust_plugin }}" | |
- cwd: /tmp | |
- user: jenkins | |
- require: | |
- pkg: jenkins | |
- service: tomcat |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment