|
@@ -24,12 +24,18 @@
|
|
msg: |
|
|
msg: |
|
|
openshift-ansible requires Python 3 for {{ ansible_distribution }};
|
|
openshift-ansible requires Python 3 for {{ ansible_distribution }};
|
|
For information on enabling Python 3 with Ansible, see https://docs.ansible.com/ansible/python_3_support.html
|
|
For information on enabling Python 3 with Ansible, see https://docs.ansible.com/ansible/python_3_support.html
|
|
- when: ansible_distribution == 'Fedora' and ansible_python['version']['major'] != 3
|
|
|
|
|
|
+ when:
|
|
|
|
+ - ansible_distribution == 'Fedora'
|
|
|
|
+ - ansible_python['version']['major'] != 3
|
|
|
|
+ - r_openshift_facts_ran is not defined
|
|
|
|
|
|
- name: Validate python version
|
|
- name: Validate python version
|
|
fail:
|
|
fail:
|
|
msg: "openshift-ansible requires Python 2 for {{ ansible_distribution }}"
|
|
msg: "openshift-ansible requires Python 2 for {{ ansible_distribution }}"
|
|
- when: ansible_distribution != 'Fedora' and ansible_python['version']['major'] != 2
|
|
|
|
|
|
+ when:
|
|
|
|
+ - ansible_distribution != 'Fedora'
|
|
|
|
+ - ansible_python['version']['major'] != 2
|
|
|
|
+ - r_openshift_facts_ran is not defined
|
|
|
|
|
|
# Fail as early as possible if Atomic and old version of Docker
|
|
# Fail as early as possible if Atomic and old version of Docker
|
|
- block:
|
|
- block:
|
|
@@ -48,7 +54,9 @@
|
|
that:
|
|
that:
|
|
- l_atomic_docker_version.stdout | replace('"', '') | version_compare('1.12','>=')
|
|
- l_atomic_docker_version.stdout | replace('"', '') | version_compare('1.12','>=')
|
|
|
|
|
|
- when: l_is_atomic | bool
|
|
|
|
|
|
+ when:
|
|
|
|
+ - l_is_atomic | bool
|
|
|
|
+ - r_openshift_facts_ran is not defined
|
|
|
|
|
|
- name: Load variables
|
|
- name: Load variables
|
|
include_vars: "{{ item }}"
|
|
include_vars: "{{ item }}"
|
|
@@ -59,7 +67,9 @@
|
|
- name: Ensure various deps are installed
|
|
- name: Ensure various deps are installed
|
|
package: name={{ item }} state=present
|
|
package: name={{ item }} state=present
|
|
with_items: "{{ required_packages }}"
|
|
with_items: "{{ required_packages }}"
|
|
- when: not l_is_atomic | bool
|
|
|
|
|
|
+ when:
|
|
|
|
+ - not l_is_atomic | bool
|
|
|
|
+ - r_openshift_facts_ran is not defined
|
|
|
|
|
|
- name: Ensure various deps for running system containers are installed
|
|
- name: Ensure various deps for running system containers are installed
|
|
package: name={{ item }} state=present
|
|
package: name={{ item }} state=present
|
|
@@ -67,6 +77,7 @@
|
|
when:
|
|
when:
|
|
- not l_is_atomic | bool
|
|
- not l_is_atomic | bool
|
|
- l_any_system_container | bool
|
|
- l_any_system_container | bool
|
|
|
|
+ - r_openshift_facts_ran is not defined
|
|
|
|
|
|
- name: Gather Cluster facts and set is_containerized if needed
|
|
- name: Gather Cluster facts and set is_containerized if needed
|
|
openshift_facts:
|
|
openshift_facts:
|
|
@@ -99,3 +110,7 @@
|
|
- name: Set repoquery command
|
|
- name: Set repoquery command
|
|
set_fact:
|
|
set_fact:
|
|
repoquery_cmd: "{{ 'dnf repoquery --latest-limit 1 -d 0' if ansible_pkg_mgr == 'dnf' else 'repoquery --plugins' }}"
|
|
repoquery_cmd: "{{ 'dnf repoquery --latest-limit 1 -d 0' if ansible_pkg_mgr == 'dnf' else 'repoquery --plugins' }}"
|
|
|
|
+
|
|
|
|
+- name: Register that this already ran
|
|
|
|
+ set_fact:
|
|
|
|
+ r_openshift_facts_ran: True
|