Divide add config and rproxy installation
This commit is contained in:
50
Jenkinsfile
vendored
50
Jenkinsfile
vendored
@@ -11,13 +11,8 @@ pipeline {
|
||||
timestamps()
|
||||
}
|
||||
parameters {
|
||||
string(name: "target_host", defaultValue: "", trim: true, description: "Target host")
|
||||
booleanParam(name: "rproxy_install", defaultValue: true, description: "Install Rproxy")
|
||||
string(name: "images_repo_url", defaultValue: "", trim: true, description: "Repository host with podman images (ex. rproxy.olsson.ul:5000)\n(for 'rproxy_install' job only)")
|
||||
booleanParam(name: "config_add", defaultValue: true, description: "Add config")
|
||||
string(name: "rproxy_service_name", defaultValue: "", trim: true, description: "Service name (for 'Add config' job only)")
|
||||
string(name: "rproxy_service_port", defaultValue: "", trim: true, description: "Service port (for 'Add config' job only)")
|
||||
string(name: "rproxy_service_address", defaultValue: "", trim: true, description: "Service address (for 'Add config' job only)")
|
||||
string(name: "target_host", defaultValue: "", trim: true, description: "Target host for rproxy installation")
|
||||
string(name: "images_repo_url", defaultValue: "", trim: true, description: "Repository host with podman images (ex. rproxy.olsson.ul:5000)")
|
||||
booleanParam(name: 'update_job', defaultValue: false, description: 'Update job, free run, no changes')
|
||||
}
|
||||
stages {
|
||||
@@ -45,11 +40,6 @@ pipeline {
|
||||
}
|
||||
}
|
||||
stage('Install Rproxy') {
|
||||
when {
|
||||
expression {
|
||||
return params.rproxy_install
|
||||
}
|
||||
}
|
||||
steps {
|
||||
script {
|
||||
withCredentials([
|
||||
@@ -61,14 +51,10 @@ pipeline {
|
||||
ansiblePlaybook(
|
||||
playbook: 'rproxy.yml',
|
||||
inventory: 'hosts.ini',
|
||||
tags: 'install',
|
||||
colorized: true,
|
||||
extras: '''--private-key ${SSH_KEY}
|
||||
-e "ansible_user=${username}
|
||||
ansible_password=${password}
|
||||
rproxy_service_name=${rproxy_service_name}
|
||||
rproxy_service_port=${rproxy_service_port}
|
||||
rproxy_service_address=${rproxy_service_address}
|
||||
image_repo=${images_repo_url}"'''
|
||||
)
|
||||
}
|
||||
@@ -77,38 +63,6 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Add config') {
|
||||
when {
|
||||
expression {
|
||||
return params.config_add
|
||||
}
|
||||
}
|
||||
steps {
|
||||
script {
|
||||
withCredentials([
|
||||
sshUserPrivateKey(credentialsId: 'JENKINS_DEPLOYER_KEY', keyFileVariable: 'SSH_KEY'),
|
||||
usernamePassword(credentialsId:'JENKINS_DEPLOYER_PASS', usernameVariable: 'username', passwordVariable: 'password')
|
||||
]) {
|
||||
wrap([$class: 'MaskPasswordsBuildWrapper', varPasswordPairs: [[password: env.password]]]) {
|
||||
wrap([$class: 'AnsiColorBuildWrapper', colorMapName: "xterm"]) {
|
||||
ansiblePlaybook(
|
||||
playbook: 'rproxy.yml',
|
||||
inventory: 'hosts.ini',
|
||||
tags: 'add_config',
|
||||
colorized: true,
|
||||
extras: '''--private-key ${SSH_KEY}
|
||||
-e "ansible_user=${username}
|
||||
ansible_password=${password}
|
||||
rproxy_service_name=${rproxy_service_name}
|
||||
rproxy_service_port=${rproxy_service_port}
|
||||
rproxy_service_address=${rproxy_service_address}"'''
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
|
||||
Reference in New Issue
Block a user