Files
awx/awx_collection/make_imports_absolute.yml
2019-10-29 11:24:15 -04:00

18 lines
514 B
YAML

- hosts: localhost
gather_facts: false
connection: local
tasks:
- name: Find all module files
find:
paths: "{{ playbook_dir }}/plugins/modules"
patterns: "*.py"
register: module_files
- name: Change module_utils imports to absolute namespace and package names
replace:
path: "{{ item.path }}"
regexp: '^from ..module_utils.ansible_tower'
replace: 'from ansible_collections.awx.awx.plugins.module_utils.ansible_tower'
with_items: "{{ module_files.files }}"