Bookmark this page

Guided Exercise: Installing Ansible

In this exercise, you will install Ansible on a control node running Red Hat Enterprise Linux.

Outcomes

You should be able to install Ansible on a control node.

Log in to workstation as student using student as the password, and run the lab intro-install start command. This command configures the control node.

[student@workstation ~]$ lab intro-install start

Procedure 1.1. Instructions

  1. Install Ansible on workstation so that you can use that machine as your control node.

    [student@workstation ~]$ sudo yum install ansible
    [sudo] password for student: student
    Last metadata expiration check: 0:00:44 ago on Thu 22 Jul 2021 01:27:41 AM EDT.
    Dependencies resolved.
    ...output omitted...
    Is this ok [y/d/N]: y
    ...output omitted...
  2. Verify that Ansible is installed on the system. Execute the ansible command with the --version option.

    [student@workstation ~]$ ansible --version
    ansible 2.9.15
      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.6/site-packages/ansible
      executable location = /usr/bin/ansible
      python version = 3.6.8 (default, Mar 18 2021, 08:58:41) [GCC 8.4.1 20200928 (Red Hat 8.4.1-1)]
  3. Invoke the setup module on the local host to retrieve the value of the ansible_python_version fact.

    [student@workstation ~]$ ansible -m setup localhost | grep ansible_python_version
        "ansible_python_version": "3.6.8",

Finish

On workstation, run the lab intro-install finish script to clean up this exercise.

[student@workstation ~]$ lab intro-install finish

This concludes the guided exercise.

Revision: rh294-8.4-9cb53f0