From: Frank Brehm Date: Thu, 2 Nov 2023 10:09:56 +0000 (+0100) Subject: Don't create puppet group and user in postinstall-scripts/init-puppet X-Git-Tag: 1.8.0^2~23 X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=d6165a43ede9f1e66c40eb6445ee18471b79aac7;p=pixelpark%2Fcreate-terraform.git Don't create puppet group and user in postinstall-scripts/init-puppet --- 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