main.yaml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. ---
  2. - name: openshift_repos detect ostree
  3. stat:
  4. path: /run/ostree-booted
  5. register: ostree_booted
  6. - assert:
  7. that: openshift_deployment_type in known_openshift_deployment_types
  8. msg: "openshift_deployment_type must be one of {{ known_openshift_deployment_types }}"
  9. - block:
  10. - name: Ensure libselinux-python is installed
  11. package: name=libselinux-python state=present
  12. - name: Create any additional repos that are defined
  13. template:
  14. src: yum_repo.j2
  15. dest: /etc/yum.repos.d/openshift_additional.repo
  16. when:
  17. - openshift_additional_repos | length > 0
  18. notify: refresh cache
  19. - name: Remove the additional repos if no longer defined
  20. file:
  21. dest: /etc/yum.repos.d/openshift_additional.repo
  22. state: absent
  23. when:
  24. - openshift_additional_repos | length == 0
  25. notify: refresh cache
  26. - name: Configure origin gpg keys if needed
  27. copy:
  28. src: "{{ item.src }}"
  29. dest: "{{ item.dest }}"
  30. with_items:
  31. - src: origin/gpg_keys/openshift-ansible-CentOS-SIG-PaaS
  32. dest: /etc/pki/rpm-gpg/
  33. - src: origin/repos/openshift-ansible-centos-paas-sig.repo
  34. dest: /etc/yum.repos.d/
  35. notify: refresh cache
  36. when:
  37. - ansible_os_family == "RedHat"
  38. - ansible_distribution != "Fedora"
  39. - openshift_deployment_type == 'origin'
  40. - openshift_enable_origin_repo | default(true) | bool
  41. when: not ostree_booted.stat.exists