2021年1月3日星期日

Ansible: loop/with_list with debug is not working

There is something wrong in below small piece of code in ansible. loop/with_list is not printing inside debug. I don't get any output on this block. If I print the array directly in debug:msg: , I got the output in array format. What i am doing wrong ?

- hosts: localhost    gather_facts: False    vars:      hello:        - World        - Asia        - South America        - North America        - Artic        - Antartic        - Oceania        - Europe        - Africa    tasks:      - debug:          msg: ""      - debug:          msg: "item: "        loop: ""  

Execution:

   [17:06:12] debug ...  localhost | SUCCESS | 35ms  {    - msg: [             - World             - Asia             - South America             - North America             - Artic             - Antartic             - Oceania             - Europe             - Africa            ]  }  [17:06:12] debug ...  localhost | SUCCESS | 69ms  [17:06:12] system ...  -- Play recap --    $ ansible --version  ansible 2.10.3  
https://stackoverflow.com/questions/65556481/ansible-loop-with-list-with-debug-is-not-working January 04, 2021 at 08:51AM

没有评论:

发表评论