---
- name: Sync repo configurations on all hosts
  hosts: all
  become: true
  vars:
    use_subs_mgr: false
    ose_ver: 3.6
  tasks:
    - name: Detect Atomic Host
      set_fact:
        is_atomic: "{{ ansible_cmdline.root == '/dev/mapper/atomicos-root' }}"

    - name: Disable all repos with subscription-manager
      command: subscription-manager repos --disable=*
      when: not is_atomic and use_subs_mgr

    - name: Enable needed repos with subscription-manager
      command: subscription-manager repos --enable=rhel-7-server-rpms --enable=rhel-7-server-extras-rpms --enable=rhel-7-server-ose-{{ ose_ver }}-rpms --enable=rhel-7-fast-datapath-rpms --enable=rhel-7-server-optional-rpms
      when: not is_atomic and use_subs_mgr

    - name: Configure repositories by using repo files
      copy: src={{ item }} dest=/etc/yum.repos.d/
      with_fileglob:
        - ../repo/*repo
      when: not is_atomic and not use_subs_mgr

Add a helper playbook to sync repo configs
Add a helper playbook to sync repo configs
