jinja2 - AnsibleUndefinedVariable: 'dict object' has no attribute '“{{ target_hosts }}”'"

后端 未结 1 351
一个人的身影
一个人的身影 2021-01-20 14:47

This is my Ansible playbook to update /etc/hosts file:

- name: Update /etc/hosts file
  hosts: \"{{ target_hosts }}\"
  remote_user: awx
  become: yes
  bec         


        
1条回答
  •  深忆病人
    2021-01-20 15:13

    Is the syntax wrong?

    Yes. Don't nest Jinja2 expressions. In your case {{ inside of {%.

    Correct syntax:

    {% for item in groups[target_hosts] %}
    

    0 讨论(0)
提交回复
热议问题