From: Dan Mick Date: Wed, 14 May 2025 00:36:34 +0000 (-0700) Subject: examples/builder.yml: fix up subuid/subgid handling code X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e17a8c8fb985eb9206c785d6595b5a8ae64853a6;p=ceph-build.git examples/builder.yml: fix up subuid/subgid handling code 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 --- diff --git a/ansible/examples/builder.yml b/ansible/examples/builder.yml index 62aa573d..5ae248b8 100644 --- a/ansible/examples/builder.yml +++ b/ansible/examples/builder.yml @@ -503,12 +503,11 @@ - 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: