From 4110aa63c1bbe28ca85bd87386514953f7fa9ade Mon Sep 17 00:00:00 2001 From: reqwizz Date: Wed, 13 Nov 2024 00:10:18 +0300 Subject: [PATCH] fix jenkinsfile&proxyconf --- ansible/Jenkinsfile | 29 ++++--------------- .../roles/nginx_proxy/templates/proxy.conf.j2 | 2 +- 2 files changed, 7 insertions(+), 24 deletions(-) diff --git a/ansible/Jenkinsfile b/ansible/Jenkinsfile index 4f54b12..7b33426 100644 --- a/ansible/Jenkinsfile +++ b/ansible/Jenkinsfile @@ -7,10 +7,10 @@ pipeline { } parameters { - string(name: 'ADDITIONAL_CONTENT_SITEA_H2', defaultValue: 'Новое сообщение для SiteA', description: 'Дополнительный

контент для SiteA') - string(name: 'ADDITIONAL_CONTENT_SITEA_P', defaultValue: 'Дополнительный параграф для SiteA', description: 'Дополнительный

контент для SiteA') - string(name: 'ADDITIONAL_CONTENT_SITEB_H2', defaultValue: 'Новое сообщение для SiteB', description: 'Дополнительный

контент для SiteB') - string(name: 'ADDITIONAL_CONTENT_SITEB_P', defaultValue: 'Дополнительный параграф для SiteB', description: 'Дополнительный

контент для SiteB') + string(name: 'ADDITIONAL_CONTENT_SITEA_H2', defaultValue: 'Новое сообщение для SiteA', description: 'Additional

content for SiteA') + string(name: 'ADDITIONAL_CONTENT_SITEA_P', defaultValue: 'Дополнительный параграф для SiteA', description: 'Additional

content for SiteA') + string(name: 'ADDITIONAL_CONTENT_SITEB_H2', defaultValue: 'Новое сообщение для SiteB', description: 'Additional

content for SiteB') + string(name: 'ADDITIONAL_CONTENT_SITEB_P', defaultValue: 'Дополнительный параграф для SiteB', description: 'Additional

content for SiteB') } stages { @@ -35,29 +35,12 @@ pipeline { } } - stage('Deploy SiteA') { + stage('Deploy Site') { steps { script { def extraVars = [ siteA_h2: params.ADDITIONAL_CONTENT_SITEA_H2, siteA_p: params.ADDITIONAL_CONTENT_SITEA_P, - ansible_ssh_private_key_file: env.DECYPTED_KEY_FILE - ] - - ansiblePlaybook( - playbook: 'ansible/playbook.yml', - inventory: "ansible/inventory.yml", - extraVars: extraVars, - limit: 'SiteA,proxy' - ) - } - } - } - - stage('Deploy SiteB') { - steps { - script { - def extraVars = [ siteB_h2: params.ADDITIONAL_CONTENT_SITEB_H2, siteB_p: params.ADDITIONAL_CONTENT_SITEB_P, ansible_ssh_private_key_file: env.DECYPTED_KEY_FILE @@ -67,7 +50,7 @@ pipeline { playbook: 'ansible/playbook.yml', inventory: "ansible/inventory.yml", extraVars: extraVars, - limit: 'SiteB,proxy' + limit: 'SiteA,SiteB,proxy' ) } } diff --git a/ansible/roles/nginx_proxy/templates/proxy.conf.j2 b/ansible/roles/nginx_proxy/templates/proxy.conf.j2 index 7ba9514..4572c22 100644 --- a/ansible/roles/nginx_proxy/templates/proxy.conf.j2 +++ b/ansible/roles/nginx_proxy/templates/proxy.conf.j2 @@ -1,6 +1,6 @@ upstream backend { {% for server in upstream_servers %} - server {{ server }} max_fails=1 fail_timeout=5s; + server {{ server }} max_fails=1 fail_timeout=1s; {% endfor %} }