Tomishinets Vladimir 4 anos atrás
pai
commit
c8fc81834a
1 arquivos alterados com 4 adições e 4 exclusões
  1. 4 4
      OFFICERenewalWildcardJenkinsfile

+ 4 - 4
OFFICERenewalWildcardJenkinsfile

@@ -96,8 +96,9 @@ pipeline {
             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'
+            sh 'cp ${ANSIBLE_CONFIG} ${WORKSPACE}'
             TARGET_DIR = WORKSPACE + '/' + CONFIG_DIR
-            update_zimbra(PLAYBOOK, TARGET_DIR, SMTP_SERVER, DOMAIN, ANSIBLE_CONFIG)
+            update_zimbra(PLAYBOOK, TARGET_DIR, SMTP_SERVER, DOMAIN)
 //            update_sertificate(PLAYBOOK, TARGET_DIR, SMTP_SERVER, DOMAIN)
 //          }
         }
@@ -160,10 +161,9 @@ 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, String ANSIBLE_CONFIG) {
+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 """export ANSIBLE_CONFIG=${ANSIBLE_CONFIG}
-              ansible-playbook --private-key ${GIT_SSH_KEY} ${PLAYBOOK} \
+        sh """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'