Merge "Allow find on the executor"
This commit is contained in:
commit
1237e28dd9
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
The ``find`` module is now allowed to run on the executor.
|
5
tests/fixtures/config/ansible/git/org_plugin-project/playbooks/find_local_bad.yaml
vendored
Normal file
5
tests/fixtures/config/ansible/git/org_plugin-project/playbooks/find_local_bad.yaml
vendored
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
- hosts: localhost
|
||||||
|
tasks:
|
||||||
|
- name: Find in a bad location
|
||||||
|
find:
|
||||||
|
paths: '/tmp/'
|
5
tests/fixtures/config/ansible/git/org_plugin-project/playbooks/find_local_good.yaml
vendored
Normal file
5
tests/fixtures/config/ansible/git/org_plugin-project/playbooks/find_local_good.yaml
vendored
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
- hosts: localhost
|
||||||
|
tasks:
|
||||||
|
- name: Find in a good location
|
||||||
|
find:
|
||||||
|
paths: '{{ zuul.executor.work_root }}'
|
|
@ -2958,6 +2958,8 @@ class FunctionalAnsibleMixIn(object):
|
||||||
('file_local_bad', 'FAILURE'),
|
('file_local_bad', 'FAILURE'),
|
||||||
('fileglob_local_good', 'SUCCESS'),
|
('fileglob_local_good', 'SUCCESS'),
|
||||||
('fileglob_local_bad', 'FAILURE'),
|
('fileglob_local_bad', 'FAILURE'),
|
||||||
|
('find_local_good', 'SUCCESS'),
|
||||||
|
('find_local_bad', 'FAILURE'),
|
||||||
('zuul_return', 'SUCCESS'),
|
('zuul_return', 'SUCCESS'),
|
||||||
('password_create_good', 'SUCCESS'),
|
('password_create_good', 'SUCCESS'),
|
||||||
('password_null_good', 'SUCCESS'),
|
('password_null_good', 'SUCCESS'),
|
||||||
|
|
|
@ -103,3 +103,15 @@ class ActionModule(normal.ActionModule):
|
||||||
path = self._task.args.get(arg)
|
path = self._task.args.get(arg)
|
||||||
if path:
|
if path:
|
||||||
paths._fail_if_unsafe(path)
|
paths._fail_if_unsafe(path)
|
||||||
|
|
||||||
|
def handle_find(self):
|
||||||
|
'''Allow find module on localhost if it doesn't traverse unsafe files.
|
||||||
|
|
||||||
|
The :ansible:module:`find` can be used from the executor to
|
||||||
|
gather a list of files.
|
||||||
|
'''
|
||||||
|
find_paths = self._task.args.get('paths')
|
||||||
|
if not isinstance(find_paths, list):
|
||||||
|
find_paths = (find_paths,)
|
||||||
|
for path in find_paths:
|
||||||
|
paths._fail_if_unsafe(path)
|
||||||
|
|
Loading…
Reference in New Issue