From: Frank Brehm Date: Wed, 6 Jul 2022 14:21:29 +0000 (+0200) Subject: Generating etc/ldap.yaml in .gitlab-ci.yml X-Git-Tag: 2.6.2~1^2~7 X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=696c5b4c0fc1e8661f904ed692958215c5e82146;p=pixelpark%2Fcreate-vmware-tpl.git Generating etc/ldap.yaml in .gitlab-ci.yml --- diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 09a10bc..0677537 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -71,6 +71,13 @@ variables: COBBLER_TEMPLATES_DIR_TEST: 'templates' COBBLER_SNIPPETS_DIR: 'snippets' COBBLER_WS_DOCROOT: '/var/www/html' + LDAP_TIMEOUT: '5' + LDAP_HOST: 'prd-ds.pixelpark.com' + LDAP_SSL: 'True' + LDAP_PORT: '636' + LDAP_BASE_DN: 'ou=People,o=Pixelpark,o=isp' + LDAP_BIND_DN: 'uid=readonly,ou=People,o=isp' + LDAP_BIND_PW: 'secret' .template_job: before_script: @@ -119,6 +126,7 @@ variables: fi' - 'echo "Configuration file: \"${CONFIG_FILE}\""' - 'touch "${CONFIG_FILE}"' + - touch etc/ldap.yaml - 'echo "Finished common part"' tags: - deploy_v2 @@ -229,10 +237,28 @@ Linter: cat "${CONFIG_FILE}" | sed -e "s/^\(root_password\) .*/\1 = ********/" -e "s/^\(password\) .*/\1 = ********/"; echo "<-- EOF"' # - bin/waitfor 1200 + - | + Creating "etc/ldap.yaml" ... + echo "---" > "etc/ldap.yaml" + echo "ldap:" >> "etc/ldap.yaml" + echo " timeout: ${LDAP_TIMEOUT}" >> "etc/ldap.yaml" + echo " default:" >> "etc/ldap.yaml" + echo " host: '${LDAP_HOST}'" >> "etc/ldap.yaml" + echo " ssl: ${LDAP_SSL}" >> "etc/ldap.yaml" + echo " port: ${LDAP_PORT}" >> "etc/ldap.yaml" + echo " base_dn: '${LDAP_BASE_DN}'" >> "etc/ldap.yaml" + echo " bind_dn: '${LDAP_BIND_DN}'" >> "etc/ldap.yaml" + echo " bind_pw: '${LDAP_BIND_PW}'" >> "etc/ldap.yaml" + - 'echo "Generated etc/ldap.yaml:"; + ls -l "etc/ldap.yaml" || true; + echo; + echo "-->"; + cat "etc/ldap.yaml"; + echo "<-- EOF"' - 'if [ "${SYSTEM_STATUS}" = "development" ] ; then echo "No build is done."; else - bin/create-vmware-template --verbose --color yes; + echo "bin/create-vmware-template --verbose --color yes"; fi' Create Centos8 template: