Browse Source

Merge "Allow combining system_upgrade_prepare and system_upgrade_run into system_upgrade" into stable/stein

tags/10.6.1
Zuul 3 weeks ago
parent
commit
0a41f95c97

+ 4
- 4
deployment/database/mysql-pacemaker-puppet.yaml View File

@@ -393,14 +393,13 @@ outputs:
393 393
         - vars:
394 394
             mysql_upgrade_persist: {get_param: MysqlUpgradePersist}
395 395
           when:
396
-            - step|int == 1
396
+            - step|int == 3
397 397
             - mysql_upgrade_persist
398 398
           tags:
399 399
             - never
400
+            - system_upgrade
400 401
             - system_upgrade_prepare
401 402
           block:
402
-            - name: Ban galera from local node
403
-              command: /usr/sbin/pcs resource ban galera-bundle {{ansible_hostname}} --wait
404 403
             - name: Persist mysql data
405 404
               include_role:
406 405
                 name: tripleo-persist
@@ -410,10 +409,11 @@ outputs:
410 409
         - vars:
411 410
             mysql_upgrade_persist: {get_param: MysqlUpgradePersist}
412 411
           when:
413
-            - step|int == 1
412
+            - step|int == 5
414 413
             - mysql_upgrade_persist
415 414
           tags:
416 415
             - never
416
+            - system_upgrade
417 417
             - system_upgrade_run
418 418
           block:
419 419
             - name: Restore mysql data

+ 17
- 4
deployment/podman/podman-baremetal-ansible.yaml View File

@@ -139,13 +139,26 @@ outputs:
139 139
 
140 140
       service_config_settings: {}
141 141
       upgrade_tasks:
142
-        - block:
143
-            - name: Stop all services by stopping all Docker containers
144
-              when: step|int == 3
145
-              shell: docker ps -q | xargs --no-run-if-empty -n1 docker stop
142
+        - name: system_upgrade_prepare step 2
146 143
           tags:
147 144
             - never
145
+            - system_upgrade
148 146
             - system_upgrade_prepare
147
+          when:
148
+            - (step | int) == 2
149
+          block:
150
+            - name: Check if pcs is present
151
+              stat:
152
+                path: /usr/sbin/pcs
153
+              register: pcs_stat
154
+            - name: Stop pacemaker cluster before stopping all docker containers
155
+              pacemaker_cluster: state=offline
156
+              when: pcs_stat.stat.exists
157
+            - name: Destroy pacemaker cluster
158
+              command: /usr/sbin/pcs cluster destroy
159
+              when: pcs_stat.stat.exists
160
+            - name: Stop all services by stopping all Docker containers
161
+              shell: docker ps -q | xargs --no-run-if-empty -n1 docker stop
149 162
 
150 163
         # Upgrade tasks for Pacemaker-managed services tasks pull
151 164
         # container images in step 2, we need insecure registries

+ 19
- 2
deployment/tripleo-packages/tripleo-packages-baremetal-puppet.yaml View File

@@ -99,9 +99,11 @@ outputs:
99 99
             upgrade_leapp_debug: {get_param: UpgradeLeappDebug}
100 100
             upgrade_leapp_devel_skip_rhsm: {get_param: UpgradeLeappDevelSkipRhsm}
101 101
             upgrade_leapp_reboot_timeout: {get_param: UpgradeLeappRebootTimeout}
102
+
102 103
         - name: system_upgrade_prepare step 3
103 104
           tags:
104 105
             - never
106
+            - system_upgrade
105 107
             - system_upgrade_prepare
106 108
           when: step|int == 3
107 109
           block:
@@ -121,22 +123,37 @@ outputs:
121 123
                 name: leapp
122 124
                 state: latest
123 125
               when: upgrade_leapp_enabled
126
+
127
+        - name: system_upgrade_prepare step 4
128
+          tags:
129
+            - never
130
+            - system_upgrade
131
+            - system_upgrade_prepare
132
+          when: step|int == 4
133
+          block:
124 134
             - name: run leapp upgrade (download packages)
125 135
               shell: >
126 136
                 {% if upgrade_leapp_devel_skip_rhsm|default(false) %}LEAPP_DEVEL_SKIP_RHSM=1{% endif %}
127 137
                 leapp upgrade
128 138
                 {% if upgrade_leapp_debug|default(true) %}--debug{% endif %}
129 139
               when: upgrade_leapp_enabled
130
-        - name: system_upgrade_run step 5
140
+
141
+        - name: system_upgrade_run step 4
131 142
           tags:
132 143
             - never
144
+            - system_upgrade
133 145
             - system_upgrade_run
134
-          when: step|int == 5
146
+            # In case someone needs to re-run system_upgrade_run post-tasks
147
+            # but doesn't want to reboot, they can run with
148
+            # `--skip-tags system_upgrade_reboot`.
149
+            - system_upgrade_reboot
150
+          when: step|int == 4
135 151
           block:
136 152
             - name: reboot to perform the upgrade
137 153
               reboot:
138 154
                 reboot_timeout: "{{upgrade_leapp_reboot_timeout}}"
139 155
               when: upgrade_leapp_enabled
156
+
140 157
         - name: Package and repo update tasks
141 158
           when: step|int == 0
142 159
           block:

+ 18
- 0
puppet/services/README.rst View File

@@ -179,6 +179,24 @@ Note that the services are not started in the upgrade tasks - we instead re-run
179 179
 puppet which does any reconfiguration required for the new version, then starts
180 180
 the services.
181 181
 
182
+When running an OS upgrade via the tags `system_upgrade_prepare` and
183
+`system_upgrade_run`, or the combined tag `system_upgrade`, the steps
184
+corellate to the following:
185
+
186
+   1) Any pre-service-stop actions. (`system_upgrade_prepare`)
187
+
188
+   2) Stop all services. (`system_upgrade_prepare`)
189
+
190
+   3) Post-service-stop actions like removing packages before the
191
+      upgrade. (`system_upgrade_prepare`)
192
+
193
+   4) Step reserved for the `tripleo-packages` service. Only package
194
+      download for upgrade (under `system_upgrade_prepare` tag), and
195
+      reboot for performing the offline upgrade (under
196
+      `system_upgrade_run` tag) happens here.
197
+
198
+   5) Any post-upgrade tasks (`system_upgrade_run`).
199
+
182 200
 Nova Server Metadata Settings
183 201
 -----------------------------
184 202
 

+ 0
- 16
puppet/services/pacemaker.yaml View File

@@ -161,22 +161,6 @@ outputs:
161 161
       step_config: |
162 162
         include ::tripleo::profile::base::pacemaker
163 163
       upgrade_tasks:
164
-        - name: system_upgrade_prepare step 2
165
-          tags:
166
-            - never
167
-            - system_upgrade_prepare
168
-          when: step|int == 2
169
-          block:
170
-            - name: Check if pcs is present
171
-              stat:
172
-                path: /usr/sbin/pcs
173
-              register: pcs_stat
174
-            - name: Stop pacemaker cluster
175
-              pacemaker_cluster: state=offline
176
-              when: pcs_stat.stat.exists
177
-            - name: destroy pacemaker cluster
178
-              command: /usr/sbin/pcs cluster destroy
179
-              when: pcs_stat.stat.exists
180 164
         - name: upgrade step 0
181 165
           when: step|int == 0
182 166
           vars:

Loading…
Cancel
Save