Ansible Variable Lab & Excercise – Part 2

Assigment 1 – Create a playbook and setup a webserver(httpd) and use httpd as a variable decalared in role var file 2.Assigment 2 – Create a playbook and setup a webserver(httpd) and use httpd as a variable decalared using prompt Assigment 3 – Create a playbook and setup a webserver(httpd) and find a list of .txt file in some directory and output using register variables Assigment 4 – Create a playbook and setup a webserver(httpd), copy a index.html and interpolate

Read more

tasks that can be done using Ansible ad-hoc commands

To archive or Zip files and folders || Achieve module To ping Remote host || ping module To install packages || yum module To manage cron job or schedule job ||cron To reboot remote machine||reboot To verify service status|| service To download a file from URL || get_url module To check uptime of host || command or shell module To copy file content to another file||copy To delete whole directory and files||file module To create directory ||file module To verify

Read more

Ansible Adhoc Commands Assignment

1.ansible localhost -m group -a” name=deploy state=present” -b 2.ansible localhost -m user -a “name=deploy-user group=deploy state=present” -b 3.ansible localhost -m yum -a”state=present name=httpd” -b 4.ansible localhost -m service -a”name=httpd ” -b 5.ansible localhost -m copy -a”dest=/var/www/html src=index1.html” -b 6.ansible localhost -m copy -a”dest=/var/www/html src=second.html” -b 7. ansible localhost -m yum -a”state=present name=git” -b 9.ansible localhost -m reboot 10.ansible localhost -m file -a”state=touch path=/opt/devopsschool.txt” -b ansible localhost -m file -a”state=absent path=/opt/devopsschool.txt” -b

Read more

What is Ansible and How it works

what is ansible? It is a Tool which manage configuration of servers. Configuration of servers includes create/delete/modify file, install/uninstall packages, start/restart services etc.. Benefits of Ansible: Its free open source Tool Easy to learn and use platform independent It works for All OS .like windows, Linux Ansible modules are idempotent Architecture of Ansible: Human communicate with ansible remote servers through Ansible control server. The component Of ACS includes Tool, Ansible inventory, and ansible playbook.

Read more