Browse Source

Merge "Force "Pre-cache" tasks to run in dry run" into stable/queens

tags/8.4.1
Zuul 1 month ago
parent
commit
217afb3a1e
1 changed files with 42 additions and 49 deletions
  1. 42
    49
      common/deploy-steps-tasks.yaml

+ 42
- 49
common/deploy-steps-tasks.yaml View File

@@ -297,58 +297,51 @@
297 297
     #########################################
298 298
     # Pre-cache facts for container-puppet.py
299 299
     #########################################
300
-
301
-    - name: Create puppet caching structures
302
-      file:
303
-        path: /var/lib/container-puppet/puppetlabs
304
-        state: directory
305
-        setype: svirt_sandbox_file_t
306
-        selevel: s0
307
-        recurse: True
308
-      tags:
309
-        - container_config
310
-        - container_config_tasks
311
-    - name: Write facter cache config
312
-      copy:
313
-        dest: /var/lib/container-puppet/puppetlabs/facter.conf
314
-        content: |
315
-          facts : {
316
-            ttls: [
317
-              { "kernel" : 8 hour },
318
-              { "memory" : 8 hour },
319
-              { "networking" : 8 hour },
320
-              { "operating system" : 8 hour },
321
-              { "processor" : 8 hour },
322
-            ]
323
-          }
324
-        setype: svirt_sandbox_file_t
325
-        selevel: s0
326
-      tags:
327
-        - container_config
328
-        - container_config_tasks
329
-    - name: Cleanup facter cache if exists
330
-      file:
331
-        path: /opt/puppetlabs/facter
332
-        state: absent
333
-      ignore_errors: True
334
-      tags:
335
-        - container_config
336
-        - container_config_tasks
337
-    - name: Pre-cache facts
338
-      command: facter --config /var/lib/container-puppet/puppetlabs/facter.conf
339
-      no_log: True
340
-      ignore_errors: True
341
-      tags:
342
-        - container_config
343
-        - container_config_tasks
344
-    - name: Sync cached facts
345
-      synchronize:
346
-        src: /opt/puppetlabs/
347
-        dest: /var/lib/container-puppet/puppetlabs/
348
-      delegate_to: "{{ inventory_hostname }}"
300
+    # We don't want the pre-cache tasks to be skipped in dry-run so we force
301
+    # check_mode to "no".
302
+    # https://bugzilla.redhat.com/show_bug.cgi?id=1738529
303
+    - name: Pre-cache facts for container-puppet.py
304
+      check_mode: no
349 305
       tags:
350 306
         - container_config
351 307
         - container_config_tasks
308
+      block:
309
+        - name: Create puppet caching structures
310
+          file:
311
+            path: /var/lib/container-puppet/puppetlabs
312
+            state: directory
313
+            setype: svirt_sandbox_file_t
314
+            selevel: s0
315
+            recurse: True
316
+        - name: Write facter cache config
317
+          copy:
318
+            dest: /var/lib/container-puppet/puppetlabs/facter.conf
319
+            content: |
320
+              facts : {
321
+                ttls: [
322
+                  { "kernel" : 8 hour },
323
+                  { "memory" : 8 hour },
324
+                  { "networking" : 8 hour },
325
+                  { "operating system" : 8 hour },
326
+                  { "processor" : 8 hour },
327
+                ]
328
+              }
329
+            setype: svirt_sandbox_file_t
330
+            selevel: s0
331
+        - name: Cleanup facter cache if exists
332
+          file:
333
+            path: /opt/puppetlabs/facter
334
+            state: absent
335
+          ignore_errors: True
336
+        - name: Pre-cache facts
337
+          command: facter --config /var/lib/container-puppet/puppetlabs/facter.conf
338
+          no_log: True
339
+          ignore_errors: True
340
+        - name: Sync cached facts
341
+          synchronize:
342
+            src: /opt/puppetlabs/
343
+            dest: /var/lib/container-puppet/puppetlabs/
344
+          delegate_to: "{{ inventory_hostname }}"
352 345
 
353 346
     ######################################
354 347
     # Generate config via docker-puppet.py

Loading…
Cancel
Save