Lab 9 - Dependencies¶
Mandatory¶
Installation of a ansible-galaxy role¶
- Have a look at https://galaxy.ansible.com/pstauffer/epel
- Define your roles directory in the
ansible.cfgin the[defaults]section withroles_path - Install the galaxy role
pstauffer.epel - Check out the installed role
roles/pstauffer.epel - Create a simple playbook
epel.ymlto run thepstauffer.epelrole on yourweb2.<firstname>.labserver - Run the playbook
Hint
You have to define the roles_path in the ansible.cfg file to set the installation path for ansible-galaxy.
Python-Pip Role for Debian and RedHat¶
- Create / Edit the
python-piprole - The role should install the
python-pippackage - on RedHat is EPEL needed to install
python-pip - create the
metadirectory in thepython-piprole - create a role dependency on the installed
pstauffer.epelrole inmeta/main.yml - the dependency should only run on the
ansible_os_familyRedHat - Create a playbook
pip.ymlto run the rolepython-pipon thewebhostgroup - Run the playbook
Hint
pstauffer.epel should only run on RedHat.
-> Use when: and ansible_os_family in the dependencies.
Commit your changes¶
- add all files to your git repo and commit it