--- - name: get epel 6 yum: name={{ epel_6 }} state=present when: ansible_distribution_major_version == '6' # I've tried to do a "variable in variable" to dynamically load # major version, so that getting the correct epel url is way easier. # but ansible is not friendly with it, will need to dive more into # it to see if there is a way. - name: get epel 7 yum: name={{ epel_7 }} state=present when: ansible_distribution_major_version == '7' - name: get docker yum: pkg=docker-io state=installed when: ansible_distribution_major_version == '6' - name: get docker if el7 yum: pkg=docker state=installed when: ansible_distribution_major_version == '7' # install bridge util/python-pip package - name: install brctl yum: pkg={{ item }} state=installed with_items: - bridge-utils - python-pip - name: pip install dockerpy pip: name=docker-py