Changes

Jump to: navigation, search

OPS445 Online Lab9

183 bytes removed, 08:58, 26 March 2022
m
no edit summary
= Investigation I1: The Ansible Package =
: In this investigation, we explore the main components of the Ansible configuration management system and its operating environment. We also study a simple playbook for managing the configuration of a CentOS 7.x VM.
: You need at least two Linux systems for this lab: your account on matrix.senecacollege.ca to be used as the control machine and your assigned VM in myvmlab.senecacollege.ca as the managed machine. The Ansible package is already installed on matrix for you.
[[OPS445_Ansible_setup|Click here for complete sample contents of the above]]
= Investigation II2: Ansible Playbook =
== What is a playbook? ==
: * Playbook is one of the core features of Ansible.
hosts: vmlab
user: instructor
become: yes
vars:
apache_version: 2.6
Sample Run:
<pre>
[raymond.chan@mtrx-node02pd lab9]$ ansible-playbook -i hosts --private-key ~/.ssh/id_rsa -b motd-play.yml
PLAY [update motd file] *******************************************************************
- hosts: vmlab
user: instructor
become: yes
vars:
apache_version: 2.6
Sample Run:
<pre>
[rchan@centos7 playbooks]$ ansible-playbook -i hosts -b httpd-play.yml
PLAY [vmlab] ********************************************************************
</pre>
= Investigation III3: Using Playbook to configure an OPS445 Linux VM machine =
: Assume 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 OPS445.
: Study the documentation and examples of following ansible modules:
:* yum
Create an ansible playbook named "config_ops445.yml" using the appropriate modules to perform the following configuration tasks on your assigned VM:
:* update all the packages installed on the VM
:* install extra packages repository for enterprise Linux(EPEL):* install python3 dos2unix if it is not already installed:* set the host name to your Seneca user name:* install the git remove dos2unix package:* create a new user with your Seneca_id Seneca_ID with sudo access
:* configure the new user account so that you can ssh to it without password
:* setup a directory structs structures for completing and organizing labs as shown below:<source lang="bash"> /home/[seneca_id]/ops445/lab0
/home/[seneca_id]/ops445/lab1
/home/[seneca_id]/ops445/lab2
/home/[seneca_id]/ops445/lab9
</source>
:* create a playbook named "config_ops445.yml" to perform the tasks mentioned above.
:* test and capture its output for a successful run of your playbook to a file named "lab9_[seneca_id].txt"
== Have the following items ready to show your instructor: ==
: * The Ansible playbook called "config_ops445.yaml" for configuring the VM mentioned in Lab 1.
: * The result of running the playbook "config_ops445.yaml". Save the result in a file called "lab9_[seneca_id].txt"
572
edits

Navigation menu