]> Frank Brehm's Git Trees - pixelpark/create-vmware-tpl.git/commitdiff
Generating etc/ldap.yaml in .gitlab-ci.yml
authorFrank Brehm <frank@brehm-online.com>
Wed, 6 Jul 2022 14:21:29 +0000 (16:21 +0200)
committerFrank Brehm <frank@brehm-online.com>
Wed, 6 Jul 2022 14:21:29 +0000 (16:21 +0200)
.gitlab-ci.yml

index 09a10bc6f575b9c6aceb9c504a9a4963293116de..067753790d0bfc61e60eb4571e1043812667aa35 100644 (file)
@@ -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: