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.