From d6165a43ede9f1e66c40eb6445ee18471b79aac7 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Thu, 2 Nov 2023 11:09:56 +0100 Subject: [PATCH] Don't create puppet group and user in postinstall-scripts/init-puppet --- postinstall-scripts/init-puppet | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/postinstall-scripts/init-puppet b/postinstall-scripts/init-puppet index ed7c11a..eec523c 100755 --- a/postinstall-scripts/init-puppet +++ b/postinstall-scripts/init-puppet @@ -417,7 +417,7 @@ check_group_and_user() { info "Group 'puppet' is already existing, GID=$(id -g puppet)." else info "Creating group 'puppet' ..." - cmd="groupadd -g 63000 puppet" + cmd="groupadd --system puppet" debug "Executing: ${cmd}" eval ${cmd} fi @@ -427,7 +427,10 @@ check_group_and_user() { info "User 'puppet' is already existing, UID=$(id -u puppet)." else info "Creating user 'puppet' ..." - cmd="useradd -u 63000 -g puppet -d /var/lib/puppet -c \"Puppet configuration management\" -s /sbin/nologin puppet" + cmd="useradd --system --gid puppet " + cmd+="--home-dir \"/var/lib/puppet\" --create-home " + cmd+="--comment \"Puppet configuration management\" " + cmd+="--shell \"/sbin/nologin\" puppet" debug "Executing: ${cmd}" eval ${cmd} fi @@ -494,7 +497,7 @@ generate_facts() { local facts_dir="/etc/puppetlabs/facter/facts.d" if [[ ! -d "${facts_dir}" ]] ; then info "Creating '${GREEN}${facts_dir}${NORMAL}' ..." - MKDIR "${facts_dir}" + MKDIR --parents "${facts_dir}" fi local yfile="${facts_dir}/customer.yaml" @@ -611,7 +614,7 @@ main() { empty_line check_os - check_group_and_user + # check_group_and_user check_installed_rpm generate_puppetconf -- 2.39.5