Changes

Jump to: navigation, search

OPS435 Ansible

428 bytes added, 11:43, 26 November 2018
Key Concepts when using Ansible
playbook - contains one or multiple plays, each of which define the work to be done for a configuration on a managed server. Playbooks are written in YAML. Every play in the playbook is created with environment-specific parameters for the target machines; there are no standard plays.
* Inventory file - defines the hosts and groups of hosts upon which commands, modules, and tasks in a playbook operate.
* [[OPS435 Sample Ansible Hosts file |Hosts file]] - contains information about machines to be managed- click [[OPS435 Sample Ansible Hosts file | here]] for sample hosts file
* Ad hoc commands
** <u><b>shell commands</b></u>
** ansible 192.169.99.153 -m copy -a "src=/ops435/ansible.txt dest=/tmp/ansible.txt"
** <u><b>Package management</b></u>
** ansible 192.168.99.153 -m yum -a "name=epel-release statusstate=latest"
== Sample runs for some of the Ad hoc commands ==
= Ansible Playbook =
== Updating /etc/motd file ==
=== Sample Run ===
Name: motd-play.yml
<pre>
</pre>
=== Sample Run =Install and start Apache Server ==
Name: httpd-play.yml
<pre>
* Python 2.7+ on all nodes
= Reference =
* [https://proquest-safaribooksonline-com.libaccess.senecacollege.ca/book/operating-systems-and-server-administration/linux/9781785282300 Ansible Configuration Management] - Second Edition By: Daniel Hall, Publisher: Packt Publishing Pub. Date: April 27, 2015,ISBN-13: 978-1-78528-230-0 Pages in Print Edition: 122* [https://docs.ansible.com/ansible/latest/user_guide/index.html Ansible Latest User Guide]
1,760
edits

Navigation menu