Tomishinets Vladimir 4 rokov pred
rodič
commit
fc42c35a44
1 zmenil súbory, kde vykonal 11 pridanie a 1 odobranie
  1. 11 1
      OFFICERenewalWildcardJenkinsfile

+ 11 - 1
OFFICERenewalWildcardJenkinsfile

@@ -96,7 +96,8 @@ 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'
             TARGET_DIR = WORKSPACE + '/' + CONFIG_DIR
-            update_sertificate(PLAYBOOK, TARGET_DIR, SMTP_SERVER, DOMAIN)
+            update_zimbra(PLAYBOOK, TARGET_DIR, SMTP_SERVER, DOMAIN)
+//            update_sertificate(PLAYBOOK, TARGET_DIR, SMTP_SERVER, DOMAIN)
 //          }
         }
       }
@@ -157,4 +158,13 @@ def update_sertificate(String PLAYBOOK, String TARGET_DIR, String TARGET_HOST, S
             colorized: true)
         }
       }
+}
+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 ${PLAYBOOK} \
+                -u ansible -e TARGET_DIR=${TARGET_DIR}' \
+                -e TARGET_HOST=${TARGET_HOST} -e DOMAIN=${DOMAIN} \
+                --ssh-common-args='-o StrictHostKeyChecking=no'
+           """
+      }
 }