rework all
This commit is contained in:
12
ansible/Jenkinsfile
vendored
12
ansible/Jenkinsfile
vendored
@ -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,
|
||||
|
Reference in New Issue
Block a user