main.yml 1.5 KB

1234567891011121314151617181920212223242526272829
  1. ---
  2. # It's important that we don't explicitly pull this image here. Otherwise we
  3. # could result in upgrading a preinstalled environment. We'll have to set
  4. # openshift_image_tag correctly for upgrades.
  5. - name: Set version when containerized
  6. command: >
  7. docker run --rm {{ openshift.common.cli_image }}:latest version
  8. register: cli_image_version
  9. when: openshift.common.is_containerized is defined and openshift.common.is_containerized | bool and openshift_image_tag is not defined
  10. - set_fact:
  11. l_image_tag: "{{ cli_image_version.stdout_lines[0].split(' ')[1].split('-')[0:2] | join('-') if openshift.common.deployment_type == 'origin' else
  12. cli_image_version.stdout_lines[0].split(' ')[1].split('-')[0] }}"
  13. when: openshift.common.is_containerized is defined and openshift.common.is_containerized | bool and openshift_image_tag is not defined
  14. - set_fact:
  15. l_image_tag: "{{ openshift_image_tag }}"
  16. when: openshift.common.is_containerized is defined and openshift.common.is_containerized | bool and openshift_image_tag is defined
  17. - name: Set post docker install facts
  18. openshift_facts:
  19. role: "{{ item.role }}"
  20. local_facts: "{{ item.local_facts }}"
  21. with_items:
  22. - role: docker
  23. local_facts:
  24. openshift_image_tag: "{{ l_image_tag }}"
  25. openshift_version: "{{ l_image_tag.split('-')[0] if l_image_tag is defined else '' | oo_image_tag_to_rpm_version }}"
  26. when: openshift.common.is_containerized is defined and openshift.common.is_containerized | bool