"" var1 == {{ ansible_hostname }}"
                  
                  
                  - name: "templates copy "
                  
                  
                    template:
                  
                  
                      src:   "{{item.src}}"
                  
                  
                      dest:  "{{item.dest}}"
                  
                  
                      mode:  "0664"
                  
                  
                      backup: yes
                  
                  
                    with_items:
                  
                  
                      - { src: "12312.yml",     dest: "{{ dest_dir }}12312.yml" }
                  
                  
                    when:
                  
                  
                      - var1 is defined
                  
                  
                      - var1 == "{{ ansible_hostname }}"
                  
                  
                  не работает финт ушами ansible_hostname, как можно обойти?
                  
                  
                
var1 == ansible_hostname
when: var1 is defined and var1 == ansible_hostname
всем спасибо! вот так работает - var1 == inventory_hostname
Обсуждают сегодня