Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Elethiomel/92f1dd81f79fd1adab82e8016f62c5ed to your computer and use it in GitHub Desktop.
Save Elethiomel/92f1dd81f79fd1adab82e8016f62c5ed to your computer and use it in GitHub Desktop.
ugly, but working solution
{%- 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