Skip to content

Unit 1 Lab

Automation Tools - Installation and Execution

Info

If you are unable to finish the lab in the ProLUG lab environment we ask you reboot the machine from the command line so that other students will have the intended environment.

Required Materials

Downloads

The lab has been provided for convenience below:

Lab

This lab is designed to have the engineer verify and execute their automation tools in a controlled environment.

Bash Execution

Execute some simple commands within your bash shell.

  1. Verify your location and version of bash

    which bash
    /usr/bin/bash --version
    

  2. Verify your shell PID

    echo $$
    

  3. Verify your shell variable

    echo $SHELL
    

  4. Loop over your target servers (use your target servers).

    for server in target1-1 target1-2; do timeout 10 ssh svc_ansible@$server 'uptime'; done
    
    Enter your password for the svc_ansible user from the lab guide.

    • If doing the lab on Killercoda, your target servers are controlplane and node01.
    • If in the ProLUG lab environment, check the lab guide for your target servers.

Python Execution

Test and execute Python.

  1. Verify your version of Python

    python3 --version
    

  2. Test that you can import modules

    1
    2
    3
    4
    python3      # Will drop you into interactive shell
    import os    # Should work with no output
    import numpy # Should not work as you don’t have numpy on the system
    exit()       # Will exit the interactive python3 environment.
    

Ansible Execution

Test and execute Ansible.

  1. Verify your version of Ansible

    ansible –version
    

  2. Check other ansible tools

    ansible- <tab><tab>
    
    The Tab+Tab will trigger autocompletion, showing what commands are available that start with ansible-.

  3. Check modules

    1
    2
    3
    ansible-doc -l
    ansible-doc -l | wc -l
    ansible-doc -l | grep -i copy
    

Info

If you are unable to finish the lab in the ProLUG lab environment we ask you reboot the machine from the command line so that other students will have the intended environment.