Tomishinets Vladimir преди 4 години
родител
ревизия
635823ceab
променени са 1 файла, в които са добавени 4 реда и са изтрити 2 реда
  1. 4 2
      OFFICERenewalWildcardJenkinsfile

+ 4 - 2
OFFICERenewalWildcardJenkinsfile

@@ -95,8 +95,9 @@ pipeline {
             echo "Update certificate and key for ${SMTP_SERVER}"
             sh "cat ${PKI_GIT_NAME}/${DOMAIN}/wildcard/acme-dns/letsencrypt.ca.pem >> ${CONFIG_DIR}/live/${DOMAIN}/fullchain.pem"
             PLAYBOOK = PKI_GIT_NAME + '/' + DOMAIN + '/wildcard/acme-dns/' + 'mail.yml'
+            ANSIBLE_CONFIG = PKI_GIT_NAME + '/' + DOMAIN + '/wildcard/acme-dns/' + 'ansible.cfg'
             TARGET_DIR = WORKSPACE + '/' + CONFIG_DIR
-            update_zimbra(PLAYBOOK, TARGET_DIR, SMTP_SERVER, DOMAIN)
+            update_zimbra(PLAYBOOK, TARGET_DIR, SMTP_SERVER, DOMAIN, ANSIBLE_CONFIG)
 //            update_sertificate(PLAYBOOK, TARGET_DIR, SMTP_SERVER, DOMAIN)
 //          }
         }
@@ -161,7 +162,8 @@ def update_sertificate(String PLAYBOOK, String TARGET_DIR, String TARGET_HOST, S
 }
 def update_zimbra(String PLAYBOOK, String TARGET_DIR, String TARGET_HOST, String DOMAIN) {
       withCredentials([sshUserPrivateKey(credentialsId: 'ansible', keyFileVariable: 'GIT_SSH_KEY', passphraseVariable: '', usernameVariable: 'GIT_SSH_USERNAME')]) {
-        sh """ansible-playbook --private-key ${GIT_SSH_KEY} ${PLAYBOOK} \
+        sh """export ANSIBLE_CONFIG=${ANSIBLE_CONFIG}
+              ansible-playbook --private-key ${GIT_SSH_KEY} ${PLAYBOOK} \
                 -u ansible -e TARGET_DIR=${TARGET_DIR} \
                 -e TARGET_HOST=${TARGET_HOST} -e DOMAIN=${DOMAIN} \
                 --ssh-common-args='-o StrictHostKeyChecking=no'