Performance Checklist
In this lab you will enable a module stream and install packages from it, accessing the server through the web console interface, then run an Ansible Playbook that uses a RHEL System Role to ensure further configuration is correct on the server.
Outcomes
You should be able to:
Enable and use the web console to provide system access.
Enable module streams and install packages.
Use the rhel-system-roles.postfix role to install and configure Postfix.
Log in to workstation as student using student as the password.
On workstation, run the lab tools-review start command to verify that the environment is ready and prepare the systems for the exercise.
[student@workstation ~]$lab tools-review start
In case workstation hangs using the web console, restart the virtual machine, and log into the web console with a new browser.
Use the web console to access servera and Yum to enable the Python 3.6 module stream.
On workstation, open Firefox and navigate to https://servera.lab.example.com:9090.
If a certificate error appears, accept the self-signed certificate.
Check Reuse my password for privileged tasks and sign in using student as user name and student as the password.
Click on servera.lab.example.com in the left navigation bar and select the Terminal menu entry on the left.
Use the yum module list command to list available streams, and choose the one for Python 3.6.
[student@servera ~]$sudo yum module list
Use the yum module install python36 command to install the Python 3.6 module.
[student@servera ~]$sudo yum module install python36
Using Red Hat Enterprise Linux Roles on workstation, create a playbook named lab-postfix.yml within the working directory of ~/lab-roles.
Include the directive become: yes to enable sudo usage and configure servera to be a Postfix MTA, using the following role configuration variables:
| Variable | Value |
|---|---|
inet_interfaces
|
all
|
myorigin
|
$mydomain
|
mydestination
|
$myhostname localhost.$mydomain $mydomain
|
relay_domains
|
$mydestination
|
relay_host
|
example.com
|
Change to the /home/student/lab-roles working directory.
[student@workstation ~]$cd ~/lab-roles[student@workstation lab-roles]$
Create a playbook, lab-postfix.yml, with one play that targets servera.lab.example.com.
Include the rhel-system-roles.postfix role in the roles section of the play.
The contents of the lab-postfix.yml now matches:
---
- hosts: servera.lab.example.com
become: yes
vars:
postfix_conf:
inet_interfaces: "all"
myorigin: "$mydomain"
mydestination: "$myhostname localhost.$mydomain $mydomain"
relay_domains: "$mydestination"
relay_host: "example.com"
roles:
- rhel-system-roles.postfix
Run the playbook.
[student@workstation lab-roles]$ansible-playbook lab-postfix.ymlPLAY [all] ********************************************************************* TASK [Gathering Facts] ********************************************************* ok: [servera.lab.example.com] TASK [rhel-system-roles.postfix : Install Postfix] ***************************** changed: [servera.lab.example.com] ...output omitted... TASK [rhel-system-roles.postfix : Configure Postfix] *************************** changed: [servera.lab.example.com] => (item={'key': 'inet_interface', 'value': 'all'}) changed: [servera.lab.example.com] => (item={'key': 'myorigin', 'value': '$mydomain'}) changed: [servera.lab.example.com] => (item={'key': 'mydestination', 'value': '$myhostname localhost.$mydomain $mydomain'}) changed: [servera.lab.example.com] => (item={'key': 'relay_domains', 'value': '$mydestination'}) changed: [servera.lab.example.com] => (item={'key': 'relay_host', 'value': 'example.com'}) RUNNING HANDLER [rhel-system-roles.postfix : check postfix] ******************** changed: [servera.lab.example.com] RUNNING HANDLER [rhel-system-roles.postfix : restart postfix] ****************** changed: [servera.lab.example.com] PLAY RECAP ********************************************************************* servera.lab.example.com : ok=9 changed=8 unreachable=0 failed=0
Use telnet servera.lab.example.com 25 on workstation to test mail server functionality.
[student@workstation ~]$telnet servera.lab.example.com 25Connected to servera.lab.example.com. Escape character is '^]'. 220 servera.lab.example.com ESMTP Postfix ^] telnet> quit Connection closed.