]> Frank Brehm's Git Trees - pixelpark/create-terraform.git/commitdiff
Add puppet csr_attributes.yaml config
authorReinhard Schmitz <reinhard.schmitz@pixelpark.com>
Mon, 6 Nov 2023 10:16:04 +0000 (11:16 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Mon, 6 Nov 2023 10:16:04 +0000 (11:16 +0100)
postinstall-scripts/init-puppet

index eec523cc6990e8d852ea10b8418f143bc41ace0b..19afd40af0c11bfbda0e1dbf23b75a11105703e1 100755 (executable)
@@ -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