Hi,

This is Suresh. I am new to Ansible.

I have a query, Can I please ask any one to clarify this.

I am using when: condition. 

The below one is working fine.

file copy is working fine based on distribution. didnt get any error.
"
    - name: copying clinet install zip to server
      become: yes
      become_method: sudo
      copy: src=/root/Desktop/clinetinstall.zip 
dest=clientproducts/Install.zip
      when: ansible_distribution  == "CentOS"
      copy: src=/root/Desktop/myfile  dest=clientproducts/myfile
      when: ansible_distribution  == "RedHat"

"

I expected the same when installing python-setuptools on agent machine.

    - name: installing python setuptools
      become: yes
      become_method: sudo
      yum: name=python-setuptools  state=latest
      when: ansible_os_family == "RedHat"
      zypper: name=python-setuptools  state=latest
      when: ansible_os_family == "SLES"

But getting compilation error.

what is the problem with the lines in playbook?

Best Regards,
Suresh.

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/adaee926-af25-4dce-9b2b-0ade3ac533c6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to