rework all

This commit is contained in:
2024-11-11 13:48:06 +03:00
parent cc7cb56aa3
commit 8ba4e824fc
14 changed files with 196 additions and 245 deletions

12
ansible/Jenkinsfile vendored
View File

@ -5,6 +5,10 @@ pipeline {
VAULT_PASSWORD = credentials('vault_password')
}
environment {
ANSIBLE_HOST_KEY_CHECKING = 'false'
}
parameters {
choice(name: 'SITE_OPTION', choices: ['SiteA', 'SiteB', 'SiteA&B'], description: 'Select which site to deploy')
string(name: 'ADDITIONAL_CONTENT', defaultValue: 'Новое сообщение', description: 'Additional content to be included in the site')
@ -38,19 +42,17 @@ pipeline {
def sanitized_content = params.ADDITIONAL_CONTENT.replaceAll("'", "\\'").replaceAll('"', '\\"')
def siteOption = params.SITE_OPTION
def hostsFile = env.HOSTS_FILE
def targetGroups = ''
if (siteOption == 'SiteA') {
targetGroups = 'SiteA'
targetGroups = 'SiteA,proxy'
} else if (siteOption == 'SiteB') {
targetGroups = 'SiteB'
targetGroups = 'SiteB,proxy'
} else if (siteOption == 'SiteA&B') {
targetGroups = 'SiteA,SiteB,proxy'
}
ansiblePlaybook(
playbook: 'ansible/playbook.yml',
playbook: 'ansible/playbooks/playbook.yml',
inventory: "ansible/inventory.yml",
extraVars: [
additional_content: sanitized_content,