- name: Copy Docker GPG Public Key. copy: src: "docker-ce.gpg" dest: '/etc/yum.repos.d/docker-ce.gpg' owner: root group: root mode: 0644 - name: Add Docker GPG key. rpm_key: key: "/etc/yum.repos.d/docker-ce.gpg" state: present when: ansible_distribution == "RedHat" - name: Add Docker repository. copy: src: "docker-ce.repo" dest: '/etc/yum.repos.d/docker-ce.repo' owner: root group: root mode: 0644 - name: Install python-selinux yum: state: present name: "libselinux-python3"