main.yaml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. ---
  2. # TODO: Add flag for enabling EPEL repo, default to false
  3. # TODO: Add subscription-management config, with parameters
  4. # for username, password, poolid(name), and official repos to
  5. # enable/disable. Might need to make a module that extends the
  6. # subscription management module to take a poolid and enable/disable the
  7. # proper repos correctly.
  8. - assert:
  9. that: openshift.common.deployment_type in known_openshift_deployment_types
  10. - name: Ensure libselinux-python is installed
  11. yum:
  12. pkg: libselinux-python
  13. state: present
  14. - name: Create any additional repos that are defined
  15. template:
  16. src: yum_repo.j2
  17. dest: /etc/yum.repos.d/openshift_additional.repo
  18. when: openshift_additional_repos | length > 0
  19. notify: refresh package cache
  20. - name: Remove the additional repos if no longer defined
  21. file:
  22. dest: /etc/yum.repos.d/openshift_additional.repo
  23. state: absent
  24. when: openshift_additional_repos | length == 0
  25. notify: refresh package cache
  26. - name: Remove any yum repo files for other deployment types
  27. file:
  28. path: "/etc/yum.repos.d/{{ item | basename }}"
  29. state: absent
  30. with_fileglob:
  31. - '*/repos/*'
  32. when: not (item | search("/files/" ~ openshift_deployment_type ~ "/repos"))
  33. notify: refresh package cache
  34. - name: Configure gpg keys if needed
  35. copy: src={{ item }} dest=/etc/pki/rpm-gpg/
  36. with_fileglob:
  37. - "{{ openshift_deployment_type }}/gpg_keys/*"
  38. notify: refresh package cache
  39. - name: Configure yum repositories
  40. copy: src={{ item }} dest=/etc/yum.repos.d/
  41. with_fileglob:
  42. - "{{ openshift_deployment_type }}/repos/*"
  43. notify: refresh package cache