Merge "adds vault unlocking parameter to ansible builder"

This commit is contained in:
Zuul 2018-12-20 09:33:52 +00:00 committed by Gerrit Code Review
commit 7e974a6166
5 changed files with 8 additions and 0 deletions

View File

@ -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', '')

View File

@ -11,6 +11,7 @@
<skippedTags/>
<startAtTask/>
<credentialsId/>
<vaultCredentialsId/>
<sudo>false</sudo>
<forks>5</forks>
<unbufferedOutput>true</unbufferedOutput>

View File

@ -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>

View File

@ -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

View File

@ -9,6 +9,7 @@
<skippedTags/>
<startAtTask/>
<credentialsId/>
<vaultCredentialsId/>
<sudo>false</sudo>
<forks>5</forks>
<unbufferedOutput>true</unbufferedOutput>