From: Frank Brehm Date: Thu, 28 Jan 2021 14:49:46 +0000 (+0100) Subject: Changing postinstall-scripts/init-puppet to change routing of Puppet agent from SRV... X-Git-Tag: 1.4.12~6 X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=3fea2c1fb917012e2dc0f5cc9c12edd4f3104b31;p=pixelpark%2Fcreate-terraform.git Changing postinstall-scripts/init-puppet to change routing of Puppet agent from SRV record to Loadbalancer IP --- diff --git a/postinstall-scripts/init-puppet b/postinstall-scripts/init-puppet index 72b1f9c..3442d9c 100755 --- a/postinstall-scripts/init-puppet +++ b/postinstall-scripts/init-puppet @@ -21,7 +21,7 @@ NORMAL="" HAS_TTY='y' HAS_COLORS="n" -VERSION="1.2" +VERSION="1.3" BASENAME="$(basename ${0})" BASE_DIR="$(dirname ${0})" @@ -41,6 +41,8 @@ PKG_INSTALLED="n" ROLE="base_oel7" PROJECT= +PUPPET_SERVER="puppetmaster.pixelpark.com" +PUPPET_CA_SERVER="puppetca01.pixelpark.com" ######################################### # Some often used funktions @@ -195,6 +197,13 @@ usage() { -M|--email MAIL_ADDRESS The E-Mail-Address of the responsible Person or Mailgroup, Default: <${CONTACT}>. + --server HOSTADDRESS + The hostname or IP address of the Puppetserver to use + in the puppet configuration. Might be a loadbalancer IP. + Default: '${PUPPET_SERVER}'. + --ca-server HOSTADDRESS + The hostname or IP address of the Puppet CA server to use + in the puppet configuration. Default: '${PUPPET_CA_SERVER}'. -d|--debug Debug output (bash -x). -v|--verbose Set verbosity on. -q|--quiet Quiet execution. Mutually exclusive to --verbose. @@ -229,7 +238,7 @@ get_options() { local base_dir= local short_options="E:C:p:O:T:R:P:M:dvqhV" local long_options="env:,environment:,customer:,hiera-customer:,project:,owner:,tier:,role:," - long_options+="purpose:,email:,debug,verbose,quiet,help,version" + long_options+="purpose:,server:,ca-server:,email:,debug,verbose,quiet,help,version" set +e tmp=$( getopt -o "${short_options}" --long "${long_options}" -n "${BASENAME}" -- "$@" ) @@ -287,6 +296,16 @@ get_options() { shift shift ;; + --server) + PUPPET_SERVER="$2" + shift + shift + ;; + --ca-server) + PUPPET_CA_SERVER="$2" + shift + shift + ;; -d|--debug) DEBUG="y" shift @@ -611,10 +630,12 @@ generate_puppetconf() { report = true pluginsync = true splay = true - use_srv_records = true - srv_domain = pixelpark.info - pluginsource = puppet:///plugins - pluginfactsource = puppet:///pluginfacts + server = ${PUPPET_SERVER} + ca_server = ${PUPPET_CA_SERVER} + use_cached_catalog = false + usecacheonfailure = false + pluginsource = puppet:///plugins + pluginfactsource = puppet:///pluginfacts EOF )