Ansible playbooks

  1. write a ansible playbook to create a group called “deploy”.

$ ansible to create a playbook name = deploy

2.write a ansible playbook to create a user called “deploy user” which is part of group called ” deploy” and with/bin/bash/shell.

$ ansible to create user =”deploy user” group = “deploy” src=/bin/bash/shell

3.write a ansible playbook to install package named “httpd” in RHEL/centos.

$ ansible install package named = “httpd” dest= RHEL/centos

4.write a ansible playbook to start and enable the service named “httpd”.

$ ansible start service named=”httpd” enable service named=”httpd”

5.write a ansible playbook to create a file called “index.html” in /var/www/html with some dummy html contents.

$ ansible create a file =”index.html” dest=/var/www/html state =touch

6.write a ansible playbook to reboot a self machine.

$ ansible reboot= self machine

7.write a ansible playbook to install a package called “git”, “wget”.

$ ansible install package =”git” ,”wget”

8.write a ansible playbook to clone git repo.thttps://github.com/scmgalaxy/ansible-role-template.

$ ansible to clone=git repo.thttps://github.com/scmgalaxy/ansible-role-template

9.Now merge all top playbook in to one run and verify.

$ role= top playbook n:1 state= verify