Browse Source

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

tags/9.4.1
Zuul 1 month ago
parent
commit
5d577a1f05
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

@@ -353,58 +353,51 @@
353 353
     #########################################
354 354
     # Pre-cache facts for container-puppet.py
355 355
     #########################################
356
-
357
-    - name: Create puppet caching structures
358
-      file:
359
-        path: /var/lib/container-puppet/puppetlabs
360
-        state: directory
361
-        setype: svirt_sandbox_file_t
362
-        selevel: s0
363
-        recurse: True
364
-      tags:
365
-        - container_config
366
-        - container_config_tasks
367
-    - name: Write facter cache config
368
-      copy:
369
-        dest: /var/lib/container-puppet/puppetlabs/facter.conf
370
-        content: |
371
-          facts : {
372
-            ttls: [
373
-              { "kernel" : 8 hour },
374
-              { "memory" : 8 hour },
375
-              { "networking" : 8 hour },
376
-              { "operating system" : 8 hour },
377
-              { "processor" : 8 hour },
378
-            ]
379
-          }
380
-        setype: svirt_sandbox_file_t
381
-        selevel: s0
382
-      tags:
383
-        - container_config
384
-        - container_config_tasks
385
-    - name: Cleanup facter cache if exists
386
-      file:
387
-        path: /opt/puppetlabs/facter
388
-        state: absent
389
-      ignore_errors: True
390
-      tags:
391
-        - container_config
392
-        - container_config_tasks
393
-    - name: Pre-cache facts
394
-      command: facter --config /var/lib/container-puppet/puppetlabs/facter.conf
395
-      no_log: True
396
-      ignore_errors: True
397
-      tags:
398
-        - container_config
399
-        - container_config_tasks
400
-    - name: Sync cached facts
401
-      synchronize:
402
-        src: /opt/puppetlabs/
403
-        dest: /var/lib/container-puppet/puppetlabs/
404
-      delegate_to: "{{ inventory_hostname }}"
356
+    # We don't want the pre-cache tasks to be skipped in dry-run so we force
357
+    # check_mode to "no".
358
+    # https://bugzilla.redhat.com/show_bug.cgi?id=1738529
359
+    - name: Pre-cache facts for container-puppet.py
360
+      check_mode: no
405 361
       tags:
406 362
         - container_config
407 363
         - container_config_tasks
364
+      block:
365
+        - name: Create puppet caching structures
366
+          file:
367
+            path: /var/lib/container-puppet/puppetlabs
368
+            state: directory
369
+            setype: svirt_sandbox_file_t
370
+            selevel: s0
371
+            recurse: True
372
+        - name: Write facter cache config
373
+          copy:
374
+            dest: /var/lib/container-puppet/puppetlabs/facter.conf
375
+            content: |
376
+              facts : {
377
+                ttls: [
378
+                  { "kernel" : 8 hour },
379
+                  { "memory" : 8 hour },
380
+                  { "networking" : 8 hour },
381
+                  { "operating system" : 8 hour },
382
+                  { "processor" : 8 hour },
383
+                ]
384
+              }
385
+            setype: svirt_sandbox_file_t
386
+            selevel: s0
387
+        - name: Cleanup facter cache if exists
388
+          file:
389
+            path: /opt/puppetlabs/facter
390
+            state: absent
391
+          ignore_errors: True
392
+        - name: Pre-cache facts
393
+          command: facter --config /var/lib/container-puppet/puppetlabs/facter.conf
394
+          no_log: True
395
+          ignore_errors: True
396
+        - name: Sync cached facts
397
+          synchronize:
398
+            src: /opt/puppetlabs/
399
+            dest: /var/lib/container-puppet/puppetlabs/
400
+          delegate_to: "{{ inventory_hostname }}"
408 401
 
409 402
     ######################################
410 403
     # Generate config via docker-puppet.py

Loading…
Cancel
Save