summaryrefslogtreecommitdiffstats
path: root/playbooks/init
diff options
context:
space:
mode:
authorMichael Gugino <mgugino@redhat.com>2017-12-21 20:17:10 -0500
committerMichael Gugino <mgugino@redhat.com>2018-01-09 11:18:45 -0500
commit54a83bf2b898338c70aeb094c9a0b86b8df8e2d2 (patch)
tree8d41cea271be692a150427ee23d6e26b67d3d8e5 /playbooks/init
parent0e38305063e1b4322425a42a0f5eaaa788d7fb23 (diff)
downloadopenshift-54a83bf2b898338c70aeb094c9a0b86b8df8e2d2.tar.gz
openshift-54a83bf2b898338c70aeb094c9a0b86b8df8e2d2.tar.bz2
openshift-54a83bf2b898338c70aeb094c9a0b86b8df8e2d2.tar.xz
openshift-54a83bf2b898338c70aeb094c9a0b86b8df8e2d2.zip
Refactor version and move some checks into sanity_checks.py
This commit changes how we handle openshift_version role. Most of the version initialization code is only run on the first master now. All other hosts have values set from the master. Aftwards, we run some basic RPM queries to ensure that the correct version is available on the other nodes. Containerized needs to do their own image checks elsewhere.
Diffstat (limited to 'playbooks/init')
-rw-r--r--playbooks/init/main.yml6
-rw-r--r--playbooks/init/version.yml29
2 files changed, 23 insertions, 12 deletions
diff --git a/playbooks/init/main.yml b/playbooks/init/main.yml
index 20457e508..8a3f4682d 100644
--- a/playbooks/init/main.yml
+++ b/playbooks/init/main.yml
@@ -17,12 +17,12 @@
- import_playbook: facts.yml
-- import_playbook: sanity_checks.yml
- when: not (skip_sanity_checks | default(False))
-
- import_playbook: version.yml
when: not (skip_verison | default(False))
+- import_playbook: sanity_checks.yml
+ when: not (skip_sanity_checks | default(False))
+
- name: Initialization Checkpoint End
hosts: all
gather_facts: false
diff --git a/playbooks/init/version.yml b/playbooks/init/version.yml
index 37a5284d5..ae5470db1 100644
--- a/playbooks/init/version.yml
+++ b/playbooks/init/version.yml
@@ -2,8 +2,11 @@
# NOTE: requires openshift_facts be run
- name: Determine openshift_version to configure on first master
hosts: oo_first_master
- roles:
- - openshift_version
+ tasks:
+ - include_role:
+ name: openshift_version
+ tasks_from: first_master.yml
+ - debug: msg="openshift_pkg_version set to {{ openshift_pkg_version }}"
# NOTE: We set this even on etcd hosts as they may also later run as masters,
# and we don't want to install wrong version of docker and have to downgrade
@@ -11,11 +14,19 @@
- name: Set openshift_version for etcd, node, and master hosts
hosts: oo_etcd_to_config:oo_nodes_to_config:oo_masters_to_config:!oo_first_master
vars:
- openshift_version: "{{ hostvars[groups.oo_first_master.0].openshift_version }}"
- pre_tasks:
+ l_first_master_openshift_version: "{{ hostvars[groups.oo_first_master.0].openshift_version }}"
+ l_first_master_openshift_pkg_version: "{{ hostvars[groups.oo_first_master.0].openshift_pkg_version }}"
+ l_first_master_openshift_image_tag: "{{ hostvars[groups.oo_first_master.0].openshift_image_tag}}"
+ tasks:
- set_fact:
- openshift_pkg_version: -{{ openshift_version }}
- when: openshift_pkg_version is not defined
- - debug: msg="openshift_pkg_version set to {{ openshift_pkg_version }}"
- roles:
- - openshift_version
+ openshift_version: "{{ l_first_master_openshift_version }}"
+ openshift_pkg_version: "{{ l_first_master_openshift_pkg_version }}"
+ openshift_image_tag: "{{ l_first_master_openshift_image_tag }}"
+
+# NOTE: These steps should only be run against masters and nodes.
+- name: Ensure the requested version packages are available.
+ hosts: "{{ l_openshift_version_check_hosts | default('oo_nodes_to_config:oo_masters_to_config:!oo_first_master') }}"
+ tasks:
+ - include_role:
+ name: openshift_version
+ tasks_from: masters_and_nodes.yml