Skip to content

Instantly share code, notes, and snippets.

@hkumarmk
Created April 13, 2017 09:00
Show Gist options
  • Select an option

  • Save hkumarmk/b35847b25b16053968deeeb9d2fc607b to your computer and use it in GitHub Desktop.

Select an option

Save hkumarmk/b35847b25b16053968deeeb9d2fc607b to your computer and use it in GitHub Desktop.
- hosts: localhost
vars:
qs: [
{'hardware_q_id': '1', 'logical_queue':['1', '6-10', '12-15']},
{'hardware_q_id': '2', 'logical_queue':['2-5']},
{'hardware_q_id': '3', 'logical_queue':['7'], 'default': 'True'}]
q: {}
tasks:
- set_fact:
q: "{{ q|combine({'QUEUE-' + item.hardware_q_id: {'logical_queue': item.logical_queue}})}}"
with_items: "{{ qs }}"
- debug: msg="{{ q }}"
- ini_file: dest=/tmp/file.ini section="{{ item.section }}" option="{{ item.option }}" value="{{ item.value }}" create=yes
with_inidata: "{{ q }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment