- name: set name resolve
blockinfile:
path: /etc/hosts
block: |
{{ hostvars[item]['ansible_facts']['eth1']['ipv4']['address'] }} cluster-endpoint
loop: "{{ groups[master] }}"
The task includes an option with an undefined variable. The error was: 'master' is undefined
- name: set name resolve
blockinfile:
path: /etc/hosts
block: |
{{ hostvars[item]['ansible_facts']['eth1']['ipv4']['address'] }} cluster-endpoint
loop: "{{ groups[`master`] }}"
The task includes an option with an undefined variable. The error was: 'item' is undefined
the indent level of loop directive is wrong
在 {{ }}
中,字符串(非变量名,filter 名,test名)需要引用起来,以与变量名区分
Top comments (0)