Lab 4 - Tasks

Mandatory

Create a YAML List

  • create an empty file and save it as lab4.yml

  • edit the file and define a YAML list named ntp_servers and add this items:

    • 0.ch.pool.ntp.org
    • 1.ch.pool.ntp.org
    • 2.ch.pool.ntp.org
    • 3.ch.pool.ntp.org

Create a YAML dictionary

  • add a dictionary named ntp_settings with these key/values

    • driftfile -> /var/lib/ntp/ntp.drift
    • restrict -> 127.0.0.1
    • statistics -> loopstats peerstats clockstats

Run some ad-hoc tasks

  • Install telnet via yum module on web2.<firstname>.lab
  • Run the installation again
  • Remove the package telnet via yum module on web2.<firstname>.lab
  • Run the deinstallation again

Install tree

  • Install tree via apt module on web1.<firstname>.lab

Create your first YAML task

  • Create a task in YAML style for a ntp installation via apt. Save the tasks also in the file lab4.yml

    • state -> latest

Optional

Expand your dictionary

  • Replace the string restrict with a list and add these items:

    • 127.0.0.1
    • ::1
  • save the content in a file

Install a specific version of a package

  • Install httpd version 2.4.6-88.el7.centos via yum module on web2.<firstname>.lab

Hint

state=latest is not the solution.