Zack Williams | c3dd2c8 | 2017-06-19 22:05:49 -0700 | [diff] [blame^] | 1 | --- |
| 2 | # hostvars-defaults/tasks/main.yml |
| 3 | # Sets default variables in multiple hosts to allow them to accessed on other |
| 4 | # hosts via the hostvars['otherhost']['defaultvar'] |
| 5 | |
| 6 | - name: List host group specific values of default variables |
| 7 | debug: |
| 8 | msg: "{{ item.key }}:{{ item.val }}" |
| 9 | with_items: "{{ hostvars_defaults_dict }}" |
| 10 | |
| 11 | - name: Set hostvars as facts to persist them |
| 12 | set_fact: {"{{ item.key }}":"{{ item.val }}"} |
| 13 | with_items: "{{ hostvars_defaults_dict }}" |
| 14 | |