adds vault unlocking parameter to ansible builder
This commit adds a parameter to the ansible builder, vault-credentials-id. This maps to the element <vaultCredentialsId> in the resulting job definition, and has been tested against the Jenkins Ansible plugin v1.0. Change-Id: I40cfd9225923b29c9d2714a60279f1c88f6cb88c
This commit is contained in:
parent
02e85408f0
commit
774dd59f1e
@ -4337,6 +4337,8 @@ def ansible_playbook(parser, xml_parent, data):
|
||||
:arg int workers: Specify number of parallel processes to use (default 5)
|
||||
:arg str credentials-id: The ID of credentials for the SSH connections.
|
||||
Only private key authentication is supported (default '')
|
||||
:arg str vault-credentials-id: The ID of credentials for the vault
|
||||
decryption (default '')
|
||||
:arg bool sudo: Run operations with sudo. It works only when the remote
|
||||
user is sudoer with nopasswd option (default false)
|
||||
:arg str sudo-user: Desired sudo user. "root" is used when this field is
|
||||
@ -4416,6 +4418,8 @@ def ansible_playbook(parser, xml_parent, data):
|
||||
'task-to-start-at', '')
|
||||
XML.SubElement(plugin, 'credentialsId').text = data.get(
|
||||
'credentials-id', '')
|
||||
XML.SubElement(plugin, 'vaultCredentialsId').text = data.get(
|
||||
'vault-credentials-id', '')
|
||||
if data.get('sudo', False):
|
||||
XML.SubElement(plugin, 'sudo').text = 'true'
|
||||
XML.SubElement(plugin, 'sudoUser').text = data.get('sudo-user', '')
|
||||
|
@ -11,6 +11,7 @@
|
||||
<skippedTags/>
|
||||
<startAtTask/>
|
||||
<credentialsId/>
|
||||
<vaultCredentialsId/>
|
||||
<sudo>false</sudo>
|
||||
<forks>5</forks>
|
||||
<unbufferedOutput>true</unbufferedOutput>
|
||||
|
@ -15,6 +15,7 @@ machine02.example.com
|
||||
<skippedTags>ovirt</skippedTags>
|
||||
<startAtTask>Deploy application</startAtTask>
|
||||
<credentialsId>0891c950-487b-4749-aa69-d87425e14459</credentialsId>
|
||||
<vaultCredentialsId>0421b950-487b-4749-aa69-d87425e14459</vaultCredentialsId>
|
||||
<sudo>true</sudo>
|
||||
<sudoUser>cloud-user</sudoUser>
|
||||
<forks>2</forks>
|
||||
|
@ -14,6 +14,7 @@ builders:
|
||||
task-to-start-at: "Deploy application"
|
||||
workers: 2
|
||||
credentials-id: "0891c950-487b-4749-aa69-d87425e14459"
|
||||
vault-credentials-id: "0421b950-487b-4749-aa69-d87425e14459"
|
||||
sudo: true
|
||||
sudo-user: "cloud-user"
|
||||
unbuffered-output: false
|
||||
|
@ -9,6 +9,7 @@
|
||||
<skippedTags/>
|
||||
<startAtTask/>
|
||||
<credentialsId/>
|
||||
<vaultCredentialsId/>
|
||||
<sudo>false</sudo>
|
||||
<forks>5</forks>
|
||||
<unbufferedOutput>true</unbufferedOutput>
|
||||
|
Loading…
x
Reference in New Issue
Block a user