Fix missing safe_args for add_host

There are a few missing commas in our sage_args, this fixes them.
Otherwise we get the following error from zuul:

  Adding hosts ssh with ansible_password ansible_user to the inventory is prohibited

Change-Id: I6162bc6a223da54af26bedd2e950ed21a64908b0
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2019-01-14 21:22:05 -05:00
parent e557b40741
commit c11dcc987d
5 changed files with 26 additions and 2 deletions

View File

@ -0,0 +1,6 @@
---
fixes:
- |
Untrusted playbooks no longer see
'Adding hosts ssh with ansible_user to the inventory is prohibited' when
using the add_host Ansible task on localhost.

View File

@ -1,3 +1,7 @@
- job:
name: add-host
run: playbooks/add-host.yaml
- job:
parent: python27
name: faillocal
@ -12,6 +16,7 @@
name: org/project
check:
jobs:
- add-host
- python27
- faillocal
- check-vars

View File

@ -0,0 +1,10 @@
- hosts: all
tasks:
- name: Add fake host to inventory
add_host:
name: fake
ansible_connection: ssh
ansible_host: fake.example.org
ansible_port: 22
ansible_user: zuul
ansible_password: passw0rd1

View File

@ -2238,6 +2238,9 @@ class TestAnsible(AnsibleZuulTestCase):
build_hello = self.getJobFromHistory('hello-world')
with self.jobLog(build_hello):
self.assertEqual(build_hello.result, 'SUCCESS')
build_add_host = self.getJobFromHistory('add-host')
with self.jobLog(build_add_host):
self.assertEqual(build_add_host.result, 'SUCCESS')
build_python27 = self.getJobFromHistory('python27')
with self.jobLog(build_python27):
self.assertEqual(build_python27.result, 'SUCCESS')

View File

@ -24,10 +24,10 @@ class ActionModule(add_host.ActionModule):
'ansible_connection',
'ansible_host',
'ansible_port',
'ansible_user'
'ansible_user',
'ansible_password',
'ansible_ssh_host',
'ansible_ssh_port'
'ansible_ssh_port',
'ansible_ssh_user',
'ansible_ssh_pass',
))