From: Reinhard Schmitz Date: Mon, 6 Nov 2023 10:16:04 +0000 (+0100) Subject: Add puppet csr_attributes.yaml config X-Git-Tag: 1.8.0^2~18^2 X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=9c9319d6251ffff8073dd3eedbdecb6dcf0c2595;p=pixelpark%2Fcreate-terraform.git Add puppet csr_attributes.yaml config --- diff --git a/postinstall-scripts/init-puppet b/postinstall-scripts/init-puppet index eec523c..19afd40 100755 --- a/postinstall-scripts/init-puppet +++ b/postinstall-scripts/init-puppet @@ -576,6 +576,27 @@ generate_facts() { } +#------------------------------------------------------------------------------ +generate_csr_attributes() { + + info "Generating ${GREEN}YAML files for csr_attributes${NORMAL} ..." + + local conf_dir="/etc/puppetlabs/puppet" + local yfile="${conf_dir}/csr_attributes.yaml" + info "Generating '${GREEN}${yfile}${NORMAL}' ..." + local content=$( cat <<-EOF + --- + extension_requests: + 1.3.6.1.4.1.34380.1.2.1: '${CUSTOMER}' + 1.3.6.1.4.1.34380.1.2.2: '${PROJECT}' + 1.3.6.1.4.1.34380.1.2.3: '${TIER}' + EOF + ) + debug "Generatet content of '${yfile}':\n${content}" + echo "${content}" > "${yfile}" + +} + #------------------------------------------------------------------------------ run_agent() { @@ -618,6 +639,7 @@ main() { check_installed_rpm generate_puppetconf + generate_csr_attributes generate_facts empty_oracle_repo_files || true