Skip to content

Latest commit

 

History

History
39 lines (25 loc) · 1.46 KB

README.md

File metadata and controls

39 lines (25 loc) · 1.46 KB

Ansible Playbooks

Ansible Playbook is the Ansible way to execute multiples tasks in a simple execution. This lesson explores Ansible Playbooks and their main aspects.

In order to understand this lesson properly, a set of steps have been designed to be implemented in the following section.

ENJOY !!!

Steps

  • Create an inventory file named "inventory" with a group named "myinstance" and include localhost
  • Create a playbook named playbook.yml, using "myinstance" as a hosts parameter. The playbook should use tasks to ensure that the following conditions are met on the managed hosts:
    • Print "It is working" message on group "myinstance"
    • Print instance settings on group "myinstance"
    • Create a new user "testplay01" on group "myinstance" using become (root)
    • Install package "apache2" (or "httpd" on RedHat) on group "myinstance" using become (root)
    • Enable and up "httpd" service on group "myinstance" using become (root)
  • Before running your playbook, run the ansible-playbook --syntax-check command to verify that its syntax is correct
  • Run the playbook and verify results sudo systemctl status apache2

Useful Links

For more information, please visit:

License

BSD

Author Information

Asier Cidon - Cloud Consultant

asier.cidon@redhat.com