In this exercise, you access and use the lab environment and browse the available resources.
Outcomes
You verify the Ansible installation on the control node, and verify SSH access to the managed nodes.
As the student user on the workstation machine, use the lab command to prepare your system for this exercise.
This command ensures that the environment is configured correctly for creating your Ansible Playbooks in the future.
[student@workstation ~]$ lab start ansible-prereq
Instructions
Verify that Ansible 2.11 or later is installed and usable:
[student@workstation ~]$ ansible --version
ansible [core 2.12.2]
config file = /etc/ansible/ansible.cfg
configured module search path = ['/home/student/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3.8/site-packages/ansible
ansible collection location = /home/student/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/bin/ansible
python version = 3.8.12 (default, Sep 16 2021, 10:46:05) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)]
jinja version = 2.10.3
libyaml = TrueVerify that Ansible inventory setup for this environment is correct.
Verify that you can see all hosts:
[student@workstation ~]$ ansible all --list-hosts
hosts (6):
hana1.lab.example.com
hana2.lab.example.com
nodea.lab.example.com
nodeb.lab.example.com
nodec.lab.example.com
noded.lab.example.comUse ansible ping to test the connections from your management hosts to your managed nodes:
[student@workstation ~]$ ansible -m ping all
nodec.lab.example.com | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/libexec/platform-python"
},
"changed": false,
"ping": "pong"
}
hana1.lab.example.com | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/libexec/platform-python"
},
"changed": false,
"ping": "pong"
}
nodeb.lab.example.com | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/libexec/platform-python"
},
"changed": false,
"ping": "pong"
}
nodea.lab.example.com | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/libexec/platform-python"
},
"changed": false,
"ping": "pong"
}
hana2.lab.example.com | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/libexec/platform-python"
},
"changed": false,
"ping": "pong"
}
noded.lab.example.com | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/libexec/platform-python"
},
"changed": false,
"ping": "pong"
}This concludes the guided exercise.