Skip to content

Commit

Permalink
roles/openshift_version: Use only x.y version from first master
Browse files Browse the repository at this point in the history
The base package (atomic-openshift) is installed during upgrades but
should be installed during install as the openshift binary is used for
determining the version of openshift installed on a cluster. Only the
X.Y part of the discovered version should be used to prevent unintended
refspec changes during various playbook execution.  For instance, the
inventory may only specify openshift_release="3.11" without any
openshift_image_tag setting.

- Update openshift_version to X.Y if already installed
- Add atomic-openshift install to openshift_node install task
- Add atomic-openshift-hyperkube to node install to match upgrade
- Remove redundant atomic-openshift install in openshift_ca role
- Remove unused var openshift_currently_installed_version
  • Loading branch information
mtnbikenc committed Nov 3, 2020
1 parent bb8d2b4 commit a098a9d
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 17 deletions.
6 changes: 0 additions & 6 deletions playbooks/common/openshift-cluster/upgrades/init.yml
Expand Up @@ -34,13 +34,7 @@

- name: Ensure firewall is not switched during upgrade
hosts: "{{ l_upgrade_no_switch_firewall_hosts | default('oo_all_hosts') }}"
vars:
openshift_master_installed_version: "{{ hostvars[groups.oo_first_master.0].openshift_current_version }}"
tasks:
- name: set currently installed version
set_fact:
openshift_currently_installed_version: "{{ openshift_master_installed_version }}"

- name: Get iptable service details
systemd:
name: "iptables"
Expand Down
10 changes: 0 additions & 10 deletions roles/openshift_ca/tasks/main.yml
Expand Up @@ -3,16 +3,6 @@
msg: "Both 'certfile' and 'keyfile' keys must be supplied when configuring openshift_master_ca_certificate"
when: openshift_master_ca_certificate is defined and ('certfile' not in openshift_master_ca_certificate or 'keyfile' not in openshift_master_ca_certificate)

- name: Install the base package for admin tooling
package:
name: "{{ openshift_service_type }}{{ openshift_pkg_version | default('') | lib_utils_oo_image_tag_to_rpm_version(include_dash=True) }}"
state: present
when: not hostvars[openshift_ca_host].openshift_is_atomic | bool
register: install_result
until: install_result is succeeded
delegate_to: "{{ openshift_ca_host }}"
run_once: true

- name: Reload generated facts
openshift_facts:
system_facts: "{{ vars_openshift_facts_system_facts }}"
Expand Down
2 changes: 2 additions & 0 deletions roles/openshift_node/tasks/install.yml
Expand Up @@ -7,6 +7,8 @@
until: result is succeeded
vars:
pkg_list:
- "{{ openshift_service_type }}{{ (openshift_pkg_version | default('')) | lib_utils_oo_image_tag_to_rpm_version(include_dash=True) }}"
- "{{ openshift_service_type }}-hyperkube{{ (openshift_pkg_version | default('')) | lib_utils_oo_image_tag_to_rpm_version(include_dash=True) }}"
- "{{ openshift_service_type }}-node{{ (openshift_pkg_version | default('')) | lib_utils_oo_image_tag_to_rpm_version(include_dash=True) }}"
- "{{ openshift_service_type }}-clients{{ (openshift_pkg_version | default('')) | lib_utils_oo_image_tag_to_rpm_version(include_dash=True) }}"
- conntrack-tools
Expand Down
2 changes: 1 addition & 1 deletion roles/openshift_version/tasks/first_master.yml
Expand Up @@ -5,7 +5,7 @@
# openshift_version already.
- name: Use openshift_current_version fact as version to configure if already installed
set_fact:
openshift_version: "{{ openshift_current_version }}"
openshift_version: "{{ openshift_current_version | regex_search('^\\d+\\.\\d+') }}"
when:
- openshift_current_version is defined
- openshift_version is not defined or openshift_version == ""
Expand Down

0 comments on commit a098a9d

Please sign in to comment.