mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 17:37:37 -02:30
Allo the file fact scanner to take a list of paths instead of just one path
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
- scan_packages:
|
- scan_packages:
|
||||||
- scan_services:
|
- scan_services:
|
||||||
- scan_files:
|
- scan_files:
|
||||||
path: '{{ scan_file_path }}'
|
paths: '{{ scan_file_paths }}'
|
||||||
get_checksum: '{{ scan_use_checksum }}'
|
get_checksum: '{{ scan_use_checksum }}'
|
||||||
recursive: '{{ scan_use_recursive }}'
|
recursive: '{{ scan_use_recursive }}'
|
||||||
when: scan_file_path is defined
|
when: scan_file_paths is defined
|
||||||
@@ -101,11 +101,12 @@ EXAMPLES = '''
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
argument_spec = dict(path=dict(required=True),
|
argument_spec = dict(paths=dict(required=True, type='list'),
|
||||||
recursive=dict(required=False, default='no', type='bool'),
|
recursive=dict(required=False, default='no', type='bool'),
|
||||||
get_checksum=dict(required=False, default='no', type='bool')))
|
get_checksum=dict(required=False, default='no', type='bool')))
|
||||||
files = []
|
files = []
|
||||||
path = module.params.get('path')
|
paths = module.params.get('paths')
|
||||||
|
for path in paths:
|
||||||
path = os.path.expanduser(path)
|
path = os.path.expanduser(path)
|
||||||
if not os.path.exists(path) or not os.path.isdir(path):
|
if not os.path.exists(path) or not os.path.isdir(path):
|
||||||
module.fail_json(msg = "Given path must exist and be a directory")
|
module.fail_json(msg = "Given path must exist and be a directory")
|
||||||
|
|||||||
Reference in New Issue
Block a user