bugfix: update add user command ,check wheather user exist or not ,only create user when user not exist (#2692)

Signed-off-by: xuesongzuo@yunify.com <xuesongzuo@yunify.com>
This commit is contained in:
zuoxuesong-worker 2025-08-06 15:59:54 +08:00 committed by GitHub
parent 348c9b2d15
commit 6ec705768c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -6,7 +6,7 @@
block:
- name: Add etcd user
command: |
useradd -M -c 'Etcd user' -s /sbin/nologin -r etcd || :
id etcd &>/dev/null || useradd -M -c 'Etcd user' -s /sbin/nologin -r etcd
- name: Create etcd directories
command: |
if [ ! -d "{{ .item }}" ]; then

View File

@ -4,7 +4,7 @@
- name: Add kube user
command: |
useradd -M -c 'Kubernetes user' -s /sbin/nologin -r kube || :
id kube &>/dev/null || useradd -M -c 'Kubernetes user' -s /sbin/nologin -r kube
- name: Create kube directories
command: |