> > > *Trial1* :
> > > when: {{hostvars['hostname1]['ansible_facts']['distribution']}} ==  
> > > "CentOS"
> >
> > Try this one
> > when: "hostvars['hostname1']['ansible_facts']['distribution'] ==
> > 'CentOS'"

On Tue, 1 Oct 2019 12:41:22 +0530
Srinivas Naram <srinivas.nar...@gmail.com> wrote:
> I have tried with your suggestion and got following error.
> fatal: [172.19.251.173]: FAILED! => {"msg": "The conditional check
> 'hostvars['hostname1']['ansible_facts']['distribution'] == 'CentOS''
> failed. The error was: error while evaluating conditional
> (hostvars['hostname1']['ansible_facts']['distribution'] == 'CentOS'):
> \"hostvars['hostname1']\" is undefined\n\n

Don't use undefined hostnames.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/20191001092528.13f11c1c%40plana.

Attachment: pgpAM3De85hyc.pgp
Description: OpenPGP digital signature

Reply via email to