Tomishinets Vladimir 4 年之前
父节点
当前提交
c8fc81834a
共有 1 个文件被更改,包括 4 次插入4 次删除
  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'