Lab 5 - Playbooks¶
Mandatory¶
Your first playbook¶
- Connect to your
srv.<firstname>.labasansibleuser - Switch into your git repo
/home/ansible/training - create a playbook with the filename
ntp-debian.yml - The playbook should run on the host
web1.<firstname>.lab - Add a task to install
ntp. (You can copy the task from yourlab4.ymlfile) - Run your playbook (you will see changes)
- Run the playbook again (no changes)
Second playbook¶
- create a playbook with the filename
ntp-redhat.yml - The playbook will run on host
web2.<firstname>.lab - Create a task in YAML style for a
ntpinstallation viayum - Run the playbook in the check-mode (
--check) - Run your playbook (you will see changes)
- Run the playbook again (no changes)
Import playbooks¶
Create a new playbook named
ntp.ymlImport both playbooks
ntp-redhat.ymlntp-debian.yml
Run the playbook step-by-step (
--step)
Commit your changes¶
- add all files to your git repo and commit it