Ansible Scripts & Sample Playbooks | DevOps | VisualPath

Ansible Sample Scripts:

1. Adhoc Commands

The ad-hoc command to install apache2 on servers
# ansible -m ping all
# ansible -m  apt  -a “name=apache2 state=installed” webserver  --become
#ansible  -m  service  -a “name=apache2 state=started”  webserver  --become

2. Sample Playbooks

  •  Sample playbook to print fact variables


  •  Sample Playbook to create a file using variables


  •     Playbook to Install Mysql on Remote Server


  •  Sample Playbook To create a user on Remote Server using variables



For more information about Visualpath, visit www.visualpath.in and follow the company on Facebook and Twitter.
For DevOps training contact us at +91 9704455959 / info@visualpath.in

Comments