Open main menu

CDOT Wiki β

Changes

OPS435 Ansible

2,112 bytes added, 17:10, 24 November 2019
Lab 9 Sign-off (Show Instructor)
:* For more detail information about ansible, check out the ansible web site at [http://www.ansible.com. www.ansible.com]
:* [https://www.ansible.com/overview/how-ansible-works Overview]
:* [https://docs.ansible.com/ansible/latest/user_guide/index.html Ansible Latest User Guide]
:* [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
 
= System requirements =
* You must have at lease two networked machines
** control machine - run ansible to configure remote node - need Ansible 2.x (latest version 2.7)
** managed machine(s) - to be managed by the control node
* You should be able to ssh from your control machine as a regular user to any of your remote machines as regular user without supplying a login password.
* You account on the remote machine should be a sudoer and can run sudo without password.
* You should also be to ssh from your control machine as a regular user to any of your remote machines as root without supplying a login password
* Python 2.7+ on all nodes
 
= Investigation I: Introduction to Ansible =
</source>
:* You may have to install the following dependent packages:<source lang="bash">
Dependencies Resolved
== Part 3: Sample runs for using some Ansible's built-in modules ==
: "yum" is a built-in ansible module. You can get a complete list of all the ansible modules installed on you system with the following command:<source lang="bash"> ansisble-doc --list_files</source>: You can also get the detail information about an any ansible module with the following command:<source lang="bash"> ansible-doc module_name  e.g. ansible_doc yum
</source>
: The following command demonstrates how to install the "epel-release" package with the "yum" module:
: * Playbook tells Ansible what to execute by which user on the remote machine.
: * Playbook is like a to-do list for Ansible
: * Playbook is write in a simple human readable language called written "YAML".
: * Playbook links a task to an ansible module and provide needed arguments to the module which requires them.
===Part 1: A playbook to update the /etc/motd file ===
Name: motd-play.yml
<pre>
</pre>
= Investigation III: Using Playbook to config a OPS435 Linux machine =
: You have just installed the latest version of CentOS 7.x on a VM with GNOME Desktop. You need to configure it so that you can use it for doing the Labs for OPS435. The following configuration need to be done on that VM:
:* update all the packages installed on the VM
:* install extra packages repository for enterprise Linux
:* install python3 if it is not already installed
:* set the host name to your Seneca user name
:* install the git package
:* create a new user with your Seneca_id with sudo access
:* configure the new user account so that you can ssh to it without password
:* setup a directory structs for completing and organizing labs as shown below:<source lang="bash">
/home/[seneca_id]/ops435/lab0
/home/[seneca_id]/ops435/lab1
/home/[seneca_id]/ops435/lab2
/home/[seneca_id]/ops435/lab3
/home/[seneca_id]/ops435/lab4
/home/[seneca_id]/ops435/lab5
/home/[seneca_id]/ops435/lab6
/home/[seneca_id]/ops435/lab7
/home/[seneca_id]/ops435/lab8
/home/[seneca_id]/ops435/lab9
</source>
:* create a playbook named "config_ops435.yml" to perform the tasks mentioned above.
:* test your playbook and capture its output when it complete without error.
= Questions Lab 9 Sign-off (Show Instructor) == System requirements = Have the following items ready to show your instructor: ==: * You must have at lease two networked machines** control node - run ansible to configure remote node - need The Ansible 2playbook called "config_ops435.x (latest version 2yml" for configuring the VM mentioned in Lab 1.7): ** remote nodes - to be managed by The result of running the playbook "config_ops435.yml". Save the control node* You should be to ssh from your control node as result in a regular user to any of your remote nodes as root user without supplying a login passwordfile called "lab9_[seneca_id].txt"* Python 2.7+ on all nodes= Reference = Upload the following files to blackboard ==: * [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 Pubconfig_ops435. Date: April 27, 2015,ISBN-13: 978-1-78528-230-0yml Pages in Print Edition: 122* lab9_[https://docsseneca_id].ansible.com/ansible/latest/user_guide/index.html Ansible Latest User Guide]txt
1,760
edits