main.yaml 1.2 KB

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