]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
examples/builder.yml: fix up subuid/subgid handling code
authorDan Mick <dan.mick@redhat.com>
Wed, 14 May 2025 00:36:34 +0000 (17:36 -0700)
committerDan Mick <dan.mick@redhat.com>
Thu, 15 May 2025 02:13:42 +0000 (19:13 -0700)
1) not necessary to make 'find highest uid' conditional (and the
   check was checking 0 instead of !0 anyway)
2) fix up choice of "calculated or default" using "| default()"

Signed-off-by: Dan Mick <dan.mick@redhat.com>
ansible/examples/builder.yml

index 62aa573d3119f9bc4bd84d37701889c98072353d..5ae248b86ada491027fd5cd318d4cdd6734e1a6b 100644 (file)
     - name: Find highest used subuid
       shell: "awk -F: '{print $2+$3}' /etc/subuid | sort -n | tail -1"
       register: highest_subuid
-      when: subuid_check.rc == 0 or subgid_check.rc == 0
       changed_when: false
 
     - name: Set next available UID range
       set_fact:
-        new_uid: "{{ (highest_subuid.stdout | int + 1) if highest_subuid is defined else 100000 }}"
+        new_uid: "{{ (highest_subuid.stdout | int + 1)  | default(100000) }}"
 
     - name: Add jenkins-build to /etc/subuid
       lineinfile: