Changes

Jump to: navigation, search

OPS635-lab-ansible-Summer-2019

787 bytes added, 12:48, 31 May 2019
Investigation 2: Creating an Ansible Playbook
[[Category:OPS635]][[Category:OPS635-Labs]][[Category:peter.callaghan]][[Category:Chris.johnson]][[Category:Summer 2019]]
=OPS635 Lab 2 : System Configuration Management using Ansible=
==Overview==
==Investigation 1: Installing Ansible on Your Host Machine==
*Clone three new VMs from your ''blank'' template VM and assign them unused static IPs.*Add your new VMs to your host DNS as: '''ansible1, ansible2, ansible3'''*Install the Ansible package on your host machine'''ansible1'''.*If you have not already done so, create Create an SSH key-pair for the '''root user on your hostansible1''' and transfer the install its public portion of it key to your other two VMs' root accounts. Ensure that you can use it to ssh SSH to root on your VMs without entering a password.*Modify the inventory file on your host to include the fully qualified domain names of your VMs'''ansible2''' and '''ansible3'''.*Use the '''setup module''' to verify that your Ansible host ansible1 can run plays on your VMs.
==Investigation 2: Creating an Ansible Playbook==
*Convert the installation script/puppet manifest from the previous labs into Create an Ansible playbook (named lab2.yaml) that will configure :* Run on both ansible2 and ansible3.* Create user '''<senecaid>''' with a CentOS password, and add it to new group '''lab2'''. If your VM already has that account, that's fine, but the play should still run and try to add it.* Install, enable, and another non-CentOS start apache.* Insert a persistent firewall exception for port 80.* Replace ''/var/www/html/index.html'' on each VM as Nagios servers performing with your own modified version. (Similar to what you did in the Docker lab.)* Each task should be '''idempotent''': That is, the results on the VMs are the same checks as in lab 1no matter how many times you run your playbook.** (ie.Running your playbook 3 times shouldn't create 3 firewall exceptions on port 80) 
==Investigation 3: Applying a Playbook==
*Use the ansible-playbook command on ansible1 to execute your play on both VMs in the same play. If anything goes wrong, fix it and re-run the play. Continue doing so until the play runs successfully.
==Submission==
* Demonstrate your Ansible playbook working in class, then upload .* Demonstrate the modified webpage on ansible2 and ansible3 on your host.* Upload your playbook it to Blackboard.

Navigation menu