Merge pull request #3796 from AlanCoding/inventory_fq_36

use fully qualified inventory plugin name
This commit is contained in:
Alan Rominger 2019-10-11 06:56:13 -04:00 committed by GitHub
commit 8e296bbf8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 3 deletions

View File

@ -400,7 +400,7 @@ flake8_collection:
test_collection_all: prepare_collection_venv test_collection flake8_collection
build_collection:
ansible-playbook -i localhost, awx_collection/template_galaxy.yml -e collection_package=$(COLLECTION_PACKAGE) -e namespace_name=$(COLLECTION_NAMESPACE) -e package_version=$(VERSION)
ansible-playbook -i localhost, awx_collection/template_galaxy.yml -e collection_package=$(COLLECTION_PACKAGE) -e collection_namespace=$(COLLECTION_NAMESPACE) -e collection_version=$(VERSION)
ansible-galaxy collection build awx_collection --output-path=awx_collection
test_unit:

View File

@ -77,7 +77,7 @@ EXAMPLES = '''
# Example for using tower_inventory.yml file
plugin: tower
plugin: awx.awx.tower
host: your_ansible_tower_server_network_address
username: your_ansible_tower_username
password: your_ansible_tower_password
@ -116,7 +116,7 @@ except ImportError:
class InventoryModule(BaseInventoryPlugin):
NAME = 'tower'
NAME = 'awx.awx.tower' # REPLACE
# Stays backward compatible with tower inventory script.
# If the user supplies '@tower_inventory' as path, the plugin will read from environment variables.
no_config_file_supplied = False

View File

@ -21,6 +21,12 @@
regexp: '^extends_documentation_fragment: awx.awx.auth$'
replace: 'extends_documentation_fragment: {{ collection_namespace }}.{{ collection_package }}.auth'
with_items: "{{ module_files.files }}"
- name: Change files to support desired namespace and package names
replace:
path: "{{ playbook_dir }}/plugins/inventory/tower.py"
regexp: "^ NAME = 'awx.awx.tower' # REPLACE$"
replace: " NAME = '{{ collection_namespace }}.{{ collection_package }}.tower' # REPLACE"
when:
- (collection_package != 'awx') or (collection_namespace != 'awx')