]> Frank Brehm's Git Trees - pixelpark/create-vmware-tpl.git/commitdiff
Changing and disabling some snippets
authorFrank Brehm <frank.brehm@pixelpark.com>
Wed, 1 Nov 2023 13:45:49 +0000 (14:45 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Wed, 1 Nov 2023 13:45:49 +0000 (14:45 +0100)
etc/cobbler-distros.d/rhel-9.yaml
snippets/tpl.100.clear_repos.sh
snippets/tpl.195.repos_el9.sh
snippets/tpl.450.puppet.sh

index 9580cc53edbb1acc96d516cfff4778dcbaf5ac4d..407abcf9233b97d43ae47a75616c2e98058a66ed 100644 (file)
@@ -60,14 +60,14 @@ cobbler-distros:
       - 'tpl.190.repos_rhel9.sh'
       - 'tpl.195.repos_el9.sh'
       - 'tpl.200.init-repos.sh'
-      - 'tpl.211.bashrc-el9.sh'
-      - 'tpl.220.locales-el9.sh'
+      - 'tpl.211.bashrc-el9.sh'
+      # - 'tpl.221.locales-el9.sh'
       - 'tpl.231.vimrc-centos9.sh'
-      - 'tpl.250.pkgs-el9.sh'
+      - 'tpl.250.pkgs-el9.sh'
       - 'tpl.280.dist-upgrade.sh'
-      - 'tpl.300.create-motd.sh'
+      - 'tpl.300.create-motd.sh'
       - 'tpl.320.root-ssh-login.sh'
       - 'tpl.400.chrony.sh'
       - 'tpl.450.puppet.sh'
-      - 'tpl.500.logrotate.sh'
+      - 'tpl.500.logrotate.sh'
       - 'tpl.999.finish.sh'
index 2f9e9cd8b1968e6da9423079f9164164b4026a5a..a2ca60e2107ed036e0b3976e2f015135fbea514e 100644 (file)
@@ -14,15 +14,12 @@ clear_all_repo_files() {
     local old_dir="${repo_dir}/.old"
     local repo_file=
 
-    mkdir -pv "${old_dir}"
-
     for repo_file in "${repo_dir}"/*.repo ; do
         if [[ ! -f "${repo_file}" ]] ; then
             continue
         fi
         echo " - $( basename "${repo_file}" )"
-        cp -pv "${repo_file}" "${old_dir}"
-        cp -v /dev/null "${repo_file}"
+        rm -fv "${repo_file}"
     done
 
     echo -e "\e[0Ksection_end:$( date +%s ):ks_clear_all_repo_files\r\e[0K"
index 9ff526fd1a64d09810b411304790356f1697431f..4af563a36cbabccfd4662a05232d96d780442f46 100644 (file)
@@ -10,7 +10,7 @@ get_repos_el9() {
     echo
     local base_url="${cobbler_url}/${ws_rel_filesdir}/${system_status}/repos/el9"
 
-    local -a repos=('pixelpark' 'puppet')
+    local -a repos=('puppet')
 
     local repo=
     local url=
index 06c1129d0bf0b8a228aa43985f9ca1fbf6b735b1..e512db1f1b63f2a373de5b78516e1e29e6831581 100644 (file)
@@ -6,10 +6,8 @@ install_puppet() {
 
     echo -e "\e[0Ksection_start:$( date +%s ):ks_install_puppet[collapsed=true]\r\e[0KInstalling Puppet agent ..."
 
-    local pplabs_conf_dir="/etc/puppetlabs"
-    local puppet_conf_dir="${pplabs_conf_dir}/puppet"
-    local puppet_conf_file="${puppet_conf_dir}/puppet.conf"
-    local facter_conf_dir="${pplabs_conf_dir}/facter/facts.d"
+    local var_lib_dir="/var/lib/puppet"
+    local facter_conf_dir="/etc/puppetlabs/facter/facts.d"
 
     echo
     echo "${HASH_LINE}"
@@ -18,12 +16,16 @@ install_puppet() {
 
     echo
     echo "Creating group puppet ..."
-    groupadd -g 63000 puppet
+    groupadd --system puppet
     getent group puppet
 
     echo
     echo "Creating user puppet ..."
-    useradd -u 63000 -g puppet -d /var/lib/puppet -c "Puppet configuration management" -s /sbin/nologin puppet
+    useradd --system --gid puppet \
+            --home-dir "${var_lib_dir}" --create-home \
+            --comment "Puppet configuration management" \
+            --shell /sbin/nologin \
+            puppet
     getent passwd puppet
     id puppet
 
@@ -36,69 +38,14 @@ install_puppet() {
     fi
 
     echo
-    echo "Creating config dirs ..."
-    mkdir -pv "${puppet_conf_dir}" "${facter_conf_dir}"
-
-    echo
-    echo "Creating ${puppet_conf_file} ..."
-    cat <<-EOF >"${puppet_conf_file}"
-       [main]
-           ca_ttl = 10y
-       [agent]
-           # The file in which puppetd stores a list of the classes
-           # associated with the retrieved configuratiion.  Can be loaded in
-           # the separate "puppet" executable using the "--loadclasses"
-           # option.
-           # The default value is '\$confdir/classes.txt'.
-           classfile = \$vardir/classes.txt
-
-           environment  = production
-           report       = true
-           pluginsync   = true
-           splay        = true
-           use_srv_records  = true
-           srv_domain       = pixelpark.info
-           pluginsource     = puppet:///plugins
-           pluginfactsource = puppet:///pluginfacts
-
-       EOF
-
-    echo
-    echo "Creating ${facter_conf_dir}/customer.yaml"
-    cat <<-EOF >"${facter_conf_dir}/customer.yaml"
-       ---
-       customer: pixelpark
-       project: unknown
-       EOF
-
-    echo
-    echo "Creating ${facter_conf_dir}/host.yaml"
-    cat <<-EOF >"${facter_conf_dir}/host.yaml"
-       ---
-       pp_purpose: Unknown
-       pp_location: L105
-       pp_owner: Pixelpark AG
-       pp_contact: 8x5@pixelpark.com
-       pp_zonehost: VMWare
-       EOF
-
-    echo
-    echo "Creating ${facter_conf_dir}/tier.yaml"
-    cat <<-EOF >"${facter_conf_dir}/tier.yaml"
-       ---
-       tier: production
-       EOF
-
-    echo
-    echo "Creating ${facter_conf_dir}/role.yaml"
-    cat <<-EOF >"${facter_conf_dir}/role.yaml"
-       ---
-       role: default
-       EOF
+    echo "Creating facter dir ..."
+    mkdir --verbose --parents "${facter_conf_dir}"
 
     echo
     echo "Disabling service puppet ..."
-    systemctl disable puppet
+    systemctl disable --now puppet.service
+    echo
+    systemctl status puppet.service
 
     echo -e "\e[0Ksection_end:$( date +%s ):ks_install_puppet\r\e[0K"
 }