ansible variable conditional tcheck

16 views
Skip to first unread message

ryad9...@gmail.com

unread,
Feb 12, 2019, 12:01:31 PM2/12/19
to Ansible Project
Hi,

I have a new problem,

When i want test exemple:

- debug:
      msg: "ca fonctionne"
   when: ansible_user[5] == true

it don't works. I want show  this message "ca fonctionne" when ansible_user[5] exist

So when ansible_user == true

But this syntax don't works.

Thank you 

Pcis

unread,
Feb 12, 2019, 12:05:38 PM2/12/19
to Ansible Project
Try when: ansible_user[5] is defined

ryad9...@gmail.com

unread,
Feb 12, 2019, 12:13:31 PM2/12/19
to Ansible Project
Thank you very much,

You are the best,

We can use :

ansible_user[5] is defined

and

ansible_user[5] is not defined

;)
Reply all
Reply to author
Forward
0 new messages