base_packages.yml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. ---
  2. # l_base_packages_hosts may be passed in via prerequisites.yml during scaleup plays
  3. # and upgrade_control_plane.yml upgrade plays.
  4. - name: Install packages necessary for installer
  5. hosts: "{{ l_base_packages_hosts | default('oo_all_hosts') }}"
  6. any_errors_fatal: true
  7. tasks:
  8. - name: Determine if chrony is installed
  9. command: rpm -q chrony
  10. failed_when: false
  11. register: chrony_installed
  12. - name: Install ntp package
  13. package:
  14. name: ntp
  15. state: present
  16. when:
  17. - openshift_clock_enabled | default(True) | bool
  18. - chrony_installed.rc != 0
  19. register: result
  20. until: result is succeeded
  21. - name: Start and enable ntpd/chronyd
  22. command: timedatectl set-ntp true
  23. when: openshift_clock_enabled | default(True) | bool
  24. - name: Ensure openshift-ansible installer package deps are installed
  25. package:
  26. name: "{{ pkg_list | join(',') }}"
  27. state: present
  28. vars:
  29. pkg_list_temp:
  30. - iproute
  31. - "{{ 'python3-dbus' if ansible_distribution == 'Fedora' else 'dbus-python' }}"
  32. - "{{ 'python3-PyYAML' if ansible_distribution == 'Fedora' else 'PyYAML' }}"
  33. - libsemanage-python
  34. - yum-utils
  35. - "{{ 'python3-docker' if ansible_distribution == 'Fedora' else 'python-docker-py' }}"
  36. pkg_list_non_fedora:
  37. - 'python-ipaddress'
  38. pkg_list_use_non_fedora: "{{ ansible_distribution != 'Fedora' | bool }}"
  39. pkg_list: "{{ pkg_list_non_fedora | ternary(pkg_list_non_fedora, []) + pkg_list_temp }}"
  40. register: result
  41. until: result is succeeded