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.cfg`` in the ``[defaults]`` section with ``roles_path`` * Install the galaxy role ``pstauffer.epel`` * Check out the installed role ``roles/pstauffer.epel`` * Create a simple playbook ``epel.yml`` to run the ``pstauffer.epel`` role on your ``web2..lab`` server * 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-pip`` role * The role should install the ``python-pip`` package * on RedHat is EPEL needed to install ``python-pip`` * create the ``meta`` directory in the ``python-pip`` role * create a role dependency on the installed ``pstauffer.epel`` role in ``meta/main.yml`` * the dependency should only run on the ``ansible_os_family`` **RedHat** * Create a playbook ``pip.yml`` to run the role ``python-pip`` on the ``web`` hostgroup * 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