]> Frank Brehm's Git Trees - pixelpark/create-terraform.git/commitdiff
Fixing postinstall-scripts/init-puppet
authorFrank Brehm <frank.brehm@pixelpark.com>
Wed, 18 Oct 2023 15:38:12 +0000 (17:38 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Wed, 18 Oct 2023 15:38:12 +0000 (17:38 +0200)
postinstall-scripts/init-puppet

index c60f2e480567c3dc3e8953e23fe13995b70b6848..ed7c11adfd29786920492915915da09c61e721c4 100755 (executable)
@@ -30,8 +30,8 @@ RELEASE=
 PKG_NAME="puppet-agent"
 PUPPET_BIN="/opt/puppetlabs/bin/puppet"
 PKG_INSTALLED="n"
-ROLE="base_oel7"
-PROJECT=
+ROLE="default"
+PROJECT=""
 INITIAL_INSTALL="n"
 
 PUPPET_SERVER="puppetmaster.pixelpark.com"
@@ -132,6 +132,7 @@ get_options() {
 
     # Note the quotes around `$TEMP': they are essential!
     eval set -- "${tmp}"
+    eval_common_options "$@"
     if [[ "${DEBUG}" == 'y' ]] ; then
         declare -p REMAINING_OPTS
         declare -p REMAINING_ARGS
@@ -145,7 +146,7 @@ get_options() {
 
         arg="${REMAINING_OPTS[$i]}"
 
-        case "$1" in
+        case "$arg" in
             -E|--env|--environment)
                 j=$(( $i + 1 ))
                 ENVIRONMENT=$( echo "${REMAINING_OPTS[$j]}" | tr '[:upper:]' '[:lower:]' )
@@ -463,23 +464,21 @@ generate_puppetconf() {
                [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  = ${ENVIRONMENT}
-                   report       = true
-                   pluginsync   = true
-                   splay        = true
-                   server       = ${PUPPET_SERVER}
-                   ca_server    = ${PUPPET_CA_SERVER}
-                   use_cached_catalog = false
-                   usecacheonfailure  = false
-                   pluginsource       = puppet:///plugins
-                   pluginfactsource   = puppet:///pluginfacts
+                   ca_server                  = ${PUPPET_CA_SERVER}
+                   certname                   = ${FQDN}
+                   classfile                  = \$vardir/classes.txt
+                   crl_refresh_interval       = 1h
+                   environment                = ${ENVIRONMENT}
+                   ignore_plugin_errors       = true
+                   number_of_facts_soft_limit = 10000
+                   pluginfactsource           = puppet:///pluginfacts
+                   pluginsource               = puppet:///plugins
+                   report                     = true
+                   server                     = ${PUPPET_SERVER}
+                   splay                      = true
+                   use_cached_catalog         = false
+                   usecacheonfailure          = false
+
                EOF
     )
 
@@ -603,6 +602,8 @@ run_agent() {
 main() {
 
     get_options "$@"
+    set_locale "en_US.utf8"
+
     check_for_root
 
     empty_line