Created
June 2, 2017 11:42
-
-
Save Elethiomel/92f1dd81f79fd1adab82e8016f62c5ed to your computer and use it in GitHub Desktop.
ugly, but working solution
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
{%- for key, value in salt['pillar.get']('rocketchat_settings').iteritems() %} | |
rocketchat_setting_{{key}}: | |
module.run: | |
- name: mongodb.update_one | |
{%- if value == True %} | |
- objects: '{"_id": "{{key}}"} {"value": true}' | |
{%- elif value == False %} | |
- objects: '{"_id": "{{key}}"} {"value": false}' | |
{%- else %} | |
- objects: '{"_id": "{{key}}"} {"value": "{{value}}" }' | |
{%- endif %} | |
- database: rocketchat | |
- collection: rocketchat_settings | |
- host: localhost | |
- port: 27017 | |
{%- endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment