我有兩個文件,一個是2個字典,另一個是使用這些字典的playbook。Ansible從密鑰獲取字典值
瓦爾文件:
data: {path: ~/prod/iac/playbook/test.conf, conf: test2} vagrant: {path: ~/prod/iac/playbook/test.conf/test2.conf, conf: test4}
和劇本:
--- - hosts: localhost tasks: - name: Include var for nginx config include_vars: file: ~/prod/iac/playbook/vars.yml name: conf_vars - name: overide doc configuration shell: echo "{{ item[path] }}" > test.conf with_items: " {{ conf_vars }}"
我瓦爾正確加載,但我不能讓字典值... 任何想法?