![]() You have to use the Ansible check package installed in Linux. Server1 : ok=3 changed=0 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0 Conclusion Installing Ansible sudo amazon-linux-extras install ansible2 -y sudo yum install python-pip -y sudo pip install boto3 sudo useradd ansadmin sudo echo ansadmin:ansadmin chpasswd sudo sed -i 's/.hostkeychecking False/hostkeychecking False/g' /etc/ansible/ansible. ~]$ sudo yum remove httpd -yĪnsible runs the command to check again: ~]$ ansible-playbook -i ansible/hosts check-package.yml I will remove the apache package on server1 apache. ![]() Server1 : ok=3 changed=0 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0 : Invalid characters were found in group names but not replaced, use -vvvv to see details The output terminal ~]$ ansible-playbook -i ansible/hosts check-package.yml When: "'httpd' not in ansible_facts.packages"Īnsible run command to check ~]$ ansible-playbook -i ansible/hosts check-package.yml ![]() We use the ansible module package_facts Ansible script. Ansible check package installed Ansible file and folder ~]$ tree.
0 Comments
Leave a Reply. |