]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
builder.yml: Check for dir before running restorecon on it 2625/head
authorDavid Galloway <david.galloway@ibm.com>
Mon, 22 Jun 2026 17:18:43 +0000 (13:18 -0400)
committerDavid Galloway <david.galloway@ibm.com>
Tue, 23 Jun 2026 13:29:43 +0000 (09:29 -0400)
Signed-off-by: David Galloway <david.galloway@ibm.com>
ansible/examples/builder.yml

index a9c3f860258b507628795bbfde6d7ddcdadd84f9..12800f390ca2373effd722c5e2f2faa4601831bc 100644 (file)
             path: "/home/{{ jenkins_user }}/.local/share/containers/cache"
             state: absent
 
+        - name: Check for rootless containers directory
+          stat:
+            path: "/home/{{ jenkins_user }}/.local/share/containers"
+          register: containers_dir
+
         - name: Restore SELinux labels on containers directory (if applicable)
           command: >
             restorecon -R -T0 -x /home/{{ jenkins_user }}/.local/share/containers
-          when: ansible_selinux.status == "enabled"
+          when:
+            - ansible_selinux.status == "enabled"
+            - containers_dir.stat.exists
       tags:
         - podman-reset