---
# l_base_packages_hosts may be passed in via prerequisites.yml during scaleup plays
# and upgrade_control_plane.yml upgrade plays.

- name: Install packages necessary for installer
  hosts: "{{ l_base_packages_hosts | default('oo_all_hosts') }}"
  any_errors_fatal: true
  tasks:
  - when:
    - not openshift_is_atomic | bool
    block:
    - name: Ensure openshift-ansible installer package deps are installed
      package:
        name: "{{ item }}"
        state: present
      with_items:
      - iproute
      - "{{ 'python3-dbus' if ansible_distribution == 'Fedora' else 'dbus-python' }}"
      - "{{ 'python3-PyYAML' if ansible_distribution == 'Fedora' else 'PyYAML' }}"
      - "{{ 'python-ipaddress' if ansible_distribution != 'Fedora' else '' }}"
      - yum-utils
      when: item != ''
      register: result
      until: result is succeeded

    - name: Ensure various deps for running system containers are installed
      package:
        name: "{{ item }}"
        state: present
      with_items:
      - atomic
      - ostree
      - runc
      when:
      - >
        (openshift_use_system_containers | default(False)) | bool
        or (openshift_use_etcd_system_container | default(False)) | bool
        or (openshift_use_node_system_container | default(False)) | bool
        or (openshift_use_master_system_container | default(False)) | bool
      register: result
      until: result is succeeded

---
# l_base_packages_hosts may be passed in via prerequisites.yml during scaleup plays
# and upgrade_control_plane.yml upgrade plays.

- name: Install packages necessary for installer
  hosts: "{{ l_base_packages_hosts | default('oo_all_hosts') }}"
  any_errors_fatal: true
  tasks:
  - when:
    - not openshift_is_atomic | bool
    block:
    - name: Ensure openshift-ansible installer package deps are installed
      package:
        name: "{{ item }}"
        state: present
      with_items:
      - iproute
      - "{{ 'python3-dbus' if ansible_distribution == 'Fedora' else 'dbus-python' }}"
      - "{{ 'python3-PyYAML' if ansible_distribution == 'Fedora' else 'PyYAML' }}"
      - "{{ 'python-ipaddress' if ansible_distribution != 'Fedora' else '' }}"
      - libsemanage-python
      - yum-utils
      when: item != ''
      register: result
      until: result is succeeded

    - name: Ensure various deps for running system containers are installed
      package:
        name: "{{ item }}"
        state: present
      with_items:
      - atomic
      - ostree
      - runc
      when:
      - >
        (openshift_use_system_containers | default(False)) | bool
        or (openshift_use_etcd_system_container | default(False)) | bool
        or (openshift_use_node_system_container | default(False)) | bool
        or (openshift_use_master_system_container | default(False)) | bool
      register: result
      until: result is succeeded

Add libsemanage-python to base packages prerequisites
Add libsemanage-python to base packages prerequisites

Without libsemanage-python, the task
"Set seboolean to allow nfs storage plugin access from containers"
fails with this message:
"This module requires libsemanage-python support""

Signed-off-by: Tristan Cacqueray <199c5e9faa6f8941e63354b190eba8678dfac942@redhat.com>
