Explorar o código

Exclude 3.9 packages during 3.8 upgrade

There are some obsoletes in 3.9 packages which lead yum to upgrade
directly from 3.7 to 3.9 when you ask for 3.8 packages while 3.9 repos
are enabled. Since we'd like to allow people to run one playbook to
upgrade from 3.7 to 3.8 to 3.9 we need to exclude those packages when
upgrading to 3.8
Scott Dodson %!s(int64=7) %!d(string=hai) anos
pai
achega
9a02a7a96d

+ 1 - 1
playbooks/common/openshift-cluster/upgrades/pre/verify_upgrade_targets.yml

@@ -21,7 +21,7 @@
   block:
   block:
   - name: Check latest available OpenShift RPM version
   - name: Check latest available OpenShift RPM version
     repoquery:
     repoquery:
-      name: "{{ openshift_service_type }}"
+      name: "{{ openshift_service_type }}{{ '-' ~ openshift_release ~ '*' if openshift_release is defined else '' }}"
       ignore_excluders: true
       ignore_excluders: true
     register: repoquery_out
     register: repoquery_out
 
 

+ 1 - 1
playbooks/common/openshift-cluster/upgrades/v3_8/upgrade_control_plane.yml

@@ -14,7 +14,7 @@
 - import_playbook: ../init.yml
 - import_playbook: ../init.yml
   vars:
   vars:
     l_upgrade_no_switch_firewall_hosts: "oo_masters_to_config:oo_etcd_to_config:oo_lb_to_config"
     l_upgrade_no_switch_firewall_hosts: "oo_masters_to_config:oo_etcd_to_config:oo_lb_to_config"
-    l_upgrade_non_node_hosts: "oo_masters_to_config:oo_etcd_to_config:oo_lb_to_config"
+  when: not skip_version_info | default(false)
 
 
 - name: Configure the upgrade target for the common upgrade tasks
 - name: Configure the upgrade target for the common upgrade tasks
   hosts: oo_masters_to_config:oo_etcd_to_config:oo_lb_to_config
   hosts: oo_masters_to_config:oo_etcd_to_config:oo_lb_to_config

+ 1 - 1
roles/openshift_excluder/tasks/verify_excluder.yml

@@ -3,7 +3,7 @@
 # - excluder
 # - excluder
 - name: Get available excluder version
 - name: Get available excluder version
   repoquery:
   repoquery:
-    name: "{{ excluder }}"
+    name: "{{ excluder }}{{ '-' ~ r_openshift_excluder_upgrade_target.split('.')[0:2] | join('.') ~ '*' if r_openshift_excluder_upgrade_target is defined else '' }}"
     ignore_excluders: true
     ignore_excluders: true
   register: repoquery_out
   register: repoquery_out
 
 

+ 21 - 2
roles/openshift_master/tasks/upgrade/rpm_upgrade.yml

@@ -8,8 +8,10 @@
 
 
 # TODO: If the sdn package isn't already installed this will install it, we
 # TODO: If the sdn package isn't already installed this will install it, we
 # should fix that
 # should fix that
-- name: Upgrade master packages
-  package: name={{ master_pkgs | join(',') }} state=present
+- name: Upgrade master packages - yum
+  command:
+    yum install -y {{ master_pkgs | join(' ') }} \
+    {{ ' --exclude *' ~ openshift_service_type ~ '*3.9*' if openshift_release | version_compare('3.9','<') else '' }}
   vars:
   vars:
     master_pkgs:
     master_pkgs:
       - "{{ openshift_service_type }}{{ openshift_pkg_version | default('') }}"
       - "{{ openshift_service_type }}{{ openshift_pkg_version | default('') }}"
@@ -19,3 +21,20 @@
       - "{{ openshift_service_type }}-clients{{ openshift_pkg_version | default('') }}"
       - "{{ openshift_service_type }}-clients{{ openshift_pkg_version | default('') }}"
   register: result
   register: result
   until: result is succeeded
   until: result is succeeded
+  when: ansible_pkg_mgr == 'yum'
+
+- name: Upgrade master packages - dnf
+  dnf:
+    name: "{{ master_pkgs | join(',') }}"
+    state: present
+  vars:
+    master_pkgs:
+      - "{{ openshift_service_type }}{{ openshift_pkg_version }}"
+      - "{{ openshift_service_type }}-master{{ openshift_pkg_version }}"
+      - "{{ openshift_service_type }}-node{{ openshift_pkg_version }}"
+      - "{{ openshift_service_type }}-sdn-ovs{{ openshift_pkg_version }}"
+      - "{{ openshift_service_type }}-clients{{ openshift_pkg_version }}"
+      - "tuned-profiles-{{ openshift_service_type }}-node{{ openshift_pkg_version }}"
+  register: result
+  until: result is succeeded
+  when: ansible_pkg_mgr == 'dnf'

+ 1 - 1
roles/openshift_version/tasks/check_available_rpms.yml

@@ -1,7 +1,7 @@
 ---
 ---
 - name: Get available {{ openshift_service_type}} version
 - name: Get available {{ openshift_service_type}} version
   repoquery:
   repoquery:
-    name: "{{ openshift_service_type}}"
+    name: "{{ openshift_service_type}}{{ '-' ~ openshift_release ~ '*' if openshift_release is defined else '' }}"
     ignore_excluders: true
     ignore_excluders: true
   register: rpm_results
   register: rpm_results