Changes

Jump to: navigation, search

OPS635-lab-ansible

1,384 bytes added, 16:54, 24 May 2020
m
Adding link to installation instructions
[[Category:OPS635]][[Category:OPS635-Labs]][[Category:peter.callaghan]]
=OPS635 Lab 3 : System Configuration Management using Ansible=
==Overview==
In an enterprise environment, the existence of different hardware and Operating Systems operating systems running on production servers is very common. You may find the same software running on different OS OSes and even different hardware platforms. To manage the software configuration on different platforms by using a script, your script would have to be aware of and account for their differences. Your scripts would need to be written in way that they know how to query the operating environment and execute the appropriate installation and configuration actions based on the operating environment it is running on.  There are commercial and open source configuration management systems which aware of and know how to handle such difference in operating platforms. "'''Ansible" ''' is another one such CMS that we are going to study for this lab(Content Management System). In this lab, we you will start by trying to convert gain experience using the script that you have written for configuringNagios on Centos7 basic features of ansible to an Ansible playbook, test it on your testing environment and then deploy it to a new VMremotely configure other machines. ==Investigation 1: Installing Ansible on Your Host Machine==*Install the ansible package Ansible on one of your host machineVMs (we will refer to that as the server).**Current installation instructions can be found [[OPS635_installation_ansible|here]].*If you have not already done so, create an sshSSH key-key pair for the '''root user on your host server''' and transfer the public portion of it to your VMsanother VM (we will refer to it as the client). Ensure that you can use it to ssh to root on your vms the client without entering a password.*Modify the inventory file on your host server to include the fully qualified domain name names of your VMsclient VM.*Use the '''setup module ''' to ensure verify that your ansible host Ansible server can run plays on your VMsclient VM. ==Investigation 2: Creating an Running Single Ansible PlaybookCommands==*Convert Use the ansible command on your server to make sure the client meets the following conditions:**The bind-utils package is fully up-to-date.**The firewall-cmd service is running and enabled.**Firewalld is not allowing the mdns or cockpit services. Remember to also make this permanent.*Use the installation script/puppet manifest from terminal on to confirm these changes worked.*While these changes are not important to the previous labs into an ansible playbook that service you will configure using a centos VM and another nonplaybook in the next investigation, they give you some experience using one-centos VM as nagios servers performing the same checks as off commands in lab 1ansible. ==Investigation 3: Applying a Creating an Ansible Playbook==*Use the Create an ansible-playbook command to execute make your client machine meet the following conditions:**The httpd package must be installed**The httpd service must be enabled and running**A simple webpage of your creation must be the DocumentRoot.**Provide a copy of the configuration file with some minor changes (e.g. ServerAdmin)**The firewall must be allowing traffic to your webservers.*Run your play on both VMs in and ensure it makes the same playrequired changes.*Break your machine (e.g. If anything goes wrongmodify the configuration file), fix then re-run your play and ensure it and fixes your machine. ==Investigation 4: Advanced Playbook Options==*Add a handler to your playbook to re-run start the httpd service when changes to the playconfiguration file are discovered. Continue doing so until *Replace the configuration file with a template and provide at least one variable to it.*Re-run your play runs successfullyand ensure it makes the required changes to your machine
==Submission==
Demonstrate Upload your playbook and template file to blaockboard. ==Completing the Lab==In completing this lab you have learned how to use common elements of ansible to provision services on machines under your control. With ansible playbook working in classplace you can automatically configure and repair services under your control, then upload it to blackboardmaking configuration and maintenance of your machines much more efficient.
932
edits

Navigation menu