summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeth Foster <fosterbseth@gmail.com>2021-05-13 19:54:37 +0200
committerSeth Foster <fosterbseth@gmail.com>2021-06-08 20:33:25 +0200
commit7d06fc74dd31d77b62ea42077f2332df5008bfea (patch)
treecb3c1213ed88c08dc2cc23c04d3cc930f6297a24
parentrestore tower_legacy.py, update examples to include CONTROLLER_HOST (diff)
downloadawx-7d06fc74dd31d77b62ea42077f2332df5008bfea.tar.xz
awx-7d06fc74dd31d77b62ea42077f2332df5008bfea.zip
tower_username to controller_username, etc
-rw-r--r--awx_collection/plugins/doc_fragments/auth.py25
-rw-r--r--awx_collection/plugins/doc_fragments/auth_plugin.py10
-rw-r--r--awx_collection/plugins/module_utils/controller_module.py44
-rw-r--r--awx_collection/plugins/modules/credential.py8
-rw-r--r--awx_collection/plugins/modules/group.py2
-rw-r--r--awx_collection/plugins/modules/host.py2
-rw-r--r--awx_collection/plugins/modules/inventory.py2
-rw-r--r--awx_collection/plugins/modules/job_list.py2
-rw-r--r--awx_collection/plugins/modules/job_template.py2
-rw-r--r--awx_collection/plugins/modules/notification_template.py14
-rw-r--r--awx_collection/plugins/modules/organization.py6
-rw-r--r--awx_collection/plugins/modules/project.py4
-rw-r--r--awx_collection/plugins/modules/receive.py2
-rw-r--r--awx_collection/plugins/modules/send.py2
-rw-r--r--awx_collection/plugins/modules/team.py2
-rw-r--r--awx_collection/plugins/modules/token.py20
-rw-r--r--awx_collection/plugins/modules/user.py8
-rw-r--r--awx_collection/test/awx/test_module_utils.py8
-rw-r--r--awx_collection/test/awx/test_organization.py10
-rw-r--r--awx_collection/test/awx/test_token.py10
-rw-r--r--awx_collection/tests/integration/targets/job_template/tasks/main.yml6
-rw-r--r--awx_collection/tests/integration/targets/token/tasks/main.yml24
-rw-r--r--awx_collection/tests/integration/targets/user/tasks/main.yml4
-rw-r--r--awx_collection/tests/integration/targets/workflow_job_template/tasks/main.yml6
-rw-r--r--awx_collection/tools/roles/template_galaxy/tasks/main.yml4
25 files changed, 116 insertions, 111 deletions
diff --git a/awx_collection/plugins/doc_fragments/auth.py b/awx_collection/plugins/doc_fragments/auth.py
index 90869d1159..52fec785c3 100644
--- a/awx_collection/plugins/doc_fragments/auth.py
+++ b/awx_collection/plugins/doc_fragments/auth.py
@@ -13,44 +13,49 @@ class ModuleDocFragment(object):
# Automation Platform Controller documentation fragment
DOCUMENTATION = r'''
options:
- tower_host:
+ controller_host:
description:
- URL to your Automation Platform Controller instance.
- - If value not set, will try environment variable C(TOWER_HOST) and then config files
+ - If value not set, will try environment variable C(CONTROLLER_HOST) and then config files
- If value not specified by any means, the value of C(127.0.0.1) will be used
type: str
- tower_username:
+ aliases: [ tower_host ]
+ controller_username:
description:
- Username for your controller instance.
- - If value not set, will try environment variable C(TOWER_USERNAME) and then config files
+ - If value not set, will try environment variable C(CONTROLLER_USERNAME) and then config files
type: str
- tower_password:
+ aliases: [ tower_username ]
+ controller_password:
description:
- Password for your controller instance.
- - If value not set, will try environment variable C(TOWER_PASSWORD) and then config files
+ - If value not set, will try environment variable C(CONTROLLER_PASSWORD) and then config files
type: str
- tower_oauthtoken:
+ aliases: [ tower_password ]
+ controller_oauthtoken:
description:
- The OAuth token to use.
- This value can be in one of two formats.
- A string which is the token itself. (i.e. bqV5txm97wqJqtkxlMkhQz0pKhRMMX)
- A dictionary structure as returned by the token module.
- - If value not set, will try environment variable C(TOWER_OAUTH_TOKEN) and then config files
+ - If value not set, will try environment variable C(CONTROLLER_OAUTH_TOKEN) and then config files
type: raw
version_added: "3.7"
+ aliases: [ tower_oauthtoken ]
validate_certs:
description:
- Whether to allow insecure connections to AWX.
- If C(no), SSL certificates will not be validated.
- This should only be used on personally controlled sites using self-signed certificates.
- - If value not set, will try environment variable C(TOWER_VERIFY_SSL) and then config files
+ - If value not set, will try environment variable C(CONTROLLER_VERIFY_SSL) and then config files
type: bool
aliases: [ tower_verify_ssl ]
- tower_config_file:
+ controller_config_file:
description:
- Path to the controller config file.
- If provided, the other locations for config files will not be considered.
type: path
+ aliases: [tower_config_file]
notes:
- If no I(config_file) is provided we will attempt to use the tower-cli library
diff --git a/awx_collection/plugins/doc_fragments/auth_plugin.py b/awx_collection/plugins/doc_fragments/auth_plugin.py
index 06214bdcc6..0243d2069e 100644
--- a/awx_collection/plugins/doc_fragments/auth_plugin.py
+++ b/awx_collection/plugins/doc_fragments/auth_plugin.py
@@ -16,27 +16,27 @@ options:
host:
description: The network address of your Automation Platform Controller host.
env:
- - name: TOWER_HOST
+ - name: CONTROLLER_HOST
username:
description: The user that you plan to use to access inventories on the controller.
env:
- - name: TOWER_USERNAME
+ - name: CONTROLLER_USERNAME
password:
description: The password for your controller user.
env:
- - name: TOWER_PASSWORD
+ - name: CONTROLLER_PASSWORD
oauth_token:
description:
- The OAuth token to use.
env:
- - name: TOWER_OAUTH_TOKEN
+ - name: CONTROLLER_OAUTH_TOKEN
verify_ssl:
description:
- Specify whether Ansible should verify the SSL certificate of the controller host.
- Defaults to True, but this is handled by the shared module_utils code
type: bool
env:
- - name: TOWER_VERIFY_SSL
+ - name: CONTROLLER_VERIFY_SSL
aliases: [ validate_certs ]
notes:
diff --git a/awx_collection/plugins/module_utils/controller_module.py b/awx_collection/plugins/module_utils/controller_module.py
index 234f75a43b..032c3c5b27 100644
--- a/awx_collection/plugins/module_utils/controller_module.py
+++ b/awx_collection/plugins/module_utils/controller_module.py
@@ -32,19 +32,19 @@ class ItemNotDefined(Exception):
class ControllerModule(AnsibleModule):
url = None
AUTH_ARGSPEC = dict(
- tower_host=dict(required=False, fallback=(env_fallback, ['CONTROLLER_HOST', 'TOWER_HOST'])),
- tower_username=dict(required=False, fallback=(env_fallback, ['CONTROLLER_USERNAME', 'TOWER_USERNAME'])),
- tower_password=dict(no_log=True, required=False, fallback=(env_fallback, ['CONTROLLER_PASSWORD', 'TOWER_PASSWORD'])),
+ controller_host=dict(required=False, fallback=(env_fallback, ['CONTROLLER_HOST', 'TOWER_HOST'])),
+ controller_username=dict(required=False, fallback=(env_fallback, ['CONTROLLER_USERNAME', 'TOWER_USERNAME'])),
+ controller_password=dict(no_log=True, required=False, fallback=(env_fallback, ['CONTROLLER_PASSWORD', 'TOWER_PASSWORD'])),
validate_certs=dict(type='bool', aliases=['tower_verify_ssl'], required=False, fallback=(env_fallback, ['CONTROLLER_VERIFY_SSL', 'TOWER_VERIFY_SSL'])),
- tower_oauthtoken=dict(type='raw', no_log=True, required=False, fallback=(env_fallback, ['CONTROLLER_OAUTH_TOKEN', 'TOWER_OAUTH_TOKEN'])),
- tower_config_file=dict(type='path', required=False, default=None),
+ controller_oauthtoken=dict(type='raw', no_log=True, required=False, fallback=(env_fallback, ['CONTROLLER_OAUTH_TOKEN', 'TOWER_OAUTH_TOKEN'])),
+ controller_config_file=dict(type='path', required=False, default=None),
)
short_params = {
- 'host': 'tower_host',
- 'username': 'tower_username',
- 'password': 'tower_password',
+ 'host': 'controller_host',
+ 'username': 'controller_username',
+ 'password': 'controller_password',
'verify_ssl': 'validate_certs',
- 'oauth_token': 'tower_oauthtoken',
+ 'oauth_token': 'controller_oauthtoken',
}
host = '127.0.0.1'
username = None
@@ -82,18 +82,18 @@ class ControllerModule(AnsibleModule):
if direct_value is not None:
setattr(self, short_param, direct_value)
- # Perform magic depending on whether tower_oauthtoken is a string or a dict
- if self.params.get('tower_oauthtoken'):
- token_param = self.params.get('tower_oauthtoken')
+ # Perform magic depending on whether controller_oauthtoken is a string or a dict
+ if self.params.get('controller_oauthtoken'):
+ token_param = self.params.get('controller_oauthtoken')
if type(token_param) is dict:
if 'token' in token_param:
- self.oauth_token = self.params.get('tower_oauthtoken')['token']
+ self.oauth_token = self.params.get('controller_oauthtoken')['token']
else:
- self.fail_json(msg="The provided dict in tower_oauthtoken did not properly contain the token entry")
+ self.fail_json(msg="The provided dict in controller_oauthtoken did not properly contain the token entry")
elif isinstance(token_param, string_types):
- self.oauth_token = self.params.get('tower_oauthtoken')
+ self.oauth_token = self.params.get('controller_oauthtoken')
else:
- error_msg = "The provided tower_oauthtoken type was not valid ({0}). Valid options are str or dict.".format(type(token_param).__name__)
+ error_msg = "The provided controller_oauthtoken type was not valid ({0}). Valid options are str or dict.".format(type(token_param).__name__)
self.fail_json(msg=error_msg)
# Perform some basic validation
@@ -104,14 +104,14 @@ class ControllerModule(AnsibleModule):
try:
self.url = urlparse(self.host)
except Exception as e:
- self.fail_json(msg="Unable to parse tower_host as a URL ({1}): {0}".format(self.host, e))
+ self.fail_json(msg="Unable to parse controller_host as a URL ({1}): {0}".format(self.host, e))
# Try to resolve the hostname
hostname = self.url.netloc.split(':')[0]
try:
gethostbyname(hostname)
except Exception as e:
- self.fail_json(msg="Unable to resolve tower_host ({1}): {0}".format(hostname, e))
+ self.fail_json(msg="Unable to resolve controller_host ({1}): {0}".format(hostname, e))
def build_url(self, endpoint, query_params=None):
# Make sure we start with /api/vX
@@ -140,18 +140,18 @@ class ControllerModule(AnsibleModule):
config_files.insert(2, join(local_dir, ".{0}".format(self.config_name)))
# If we have a specified tower config, load it
- if self.params.get('tower_config_file'):
- duplicated_params = [fn for fn in self.AUTH_ARGSPEC if fn != 'tower_config_file' and self.params.get(fn) is not None]
+ if self.params.get('controller_config_file'):
+ duplicated_params = [fn for fn in self.AUTH_ARGSPEC if fn != 'controller_config_file' and self.params.get(fn) is not None]
if duplicated_params:
self.warn(
(
- 'The parameter(s) {0} were provided at the same time as tower_config_file. '
+ 'The parameter(s) {0} were provided at the same time as controller_config_file. '
'Precedence may be unstable, we suggest either using config file or params.'
).format(', '.join(duplicated_params))
)
try:
# TODO: warn if there are conflicts with other params
- self.load_config(self.params.get('tower_config_file'))
+ self.load_config(self.params.get('controller_config_file'))
except ConfigFileException as cfe:
# Since we were told specifically to load this we want it to fail if we have an error
self.fail_json(msg=cfe)
diff --git a/awx_collection/plugins/modules/credential.py b/awx_collection/plugins/modules/credential.py
index 5146039928..a32d656654 100644
--- a/awx_collection/plugins/modules/credential.py
+++ b/awx_collection/plugins/modules/credential.py
@@ -210,7 +210,7 @@ EXAMPLES = '''
organization: test-org
credential_type: Machine
state: present
- tower_config_file: "~/tower_cli.cfg"
+ controller_config_file: "~/tower_cli.cfg"
- name: Create a valid SCM credential from a private_key file
credential:
@@ -244,9 +244,9 @@ EXAMPLES = '''
name: Workshop Credential
credential_type: MyCloudCredential
organization: Default
- tower_username: admin
- tower_password: ansible
- tower_host: https://localhost
+ controller_username: admin
+ controller_password: ansible
+ controller_host: https://localhost
- name: Create a Vaiult credential (example for notes)
credential:
diff --git a/awx_collection/plugins/modules/group.py b/awx_collection/plugins/modules/group.py
index 752fe4891a..91b22f56ad 100644
--- a/awx_collection/plugins/modules/group.py
+++ b/awx_collection/plugins/modules/group.py
@@ -84,7 +84,7 @@ EXAMPLES = '''
description: "Local Host Group"
inventory: "Local Inventory"
state: present
- tower_config_file: "~/tower_cli.cfg"
+ controller_config_file: "~/tower_cli.cfg"
- name: Add group
group:
diff --git a/awx_collection/plugins/modules/host.py b/awx_collection/plugins/modules/host.py
index ee7f6899b1..8e1490f423 100644
--- a/awx_collection/plugins/modules/host.py
+++ b/awx_collection/plugins/modules/host.py
@@ -65,7 +65,7 @@ EXAMPLES = '''
description: "Local Host Group"
inventory: "Local Inventory"
state: present
- tower_config_file: "~/tower_cli.cfg"
+ controller_config_file: "~/tower_cli.cfg"
variables:
example_var: 123
'''
diff --git a/awx_collection/plugins/modules/inventory.py b/awx_collection/plugins/modules/inventory.py
index 8b63983b3f..5778aadaba 100644
--- a/awx_collection/plugins/modules/inventory.py
+++ b/awx_collection/plugins/modules/inventory.py
@@ -83,7 +83,7 @@ EXAMPLES = '''
description: "Our Foo Cloud Servers"
organization: "Bar Org"
state: present
- tower_config_file: "~/tower_cli.cfg"
+ controller_config_file: "~/tower_cli.cfg"
- name: Copy inventory
inventory:
diff --git a/awx_collection/plugins/modules/job_list.py b/awx_collection/plugins/modules/job_list.py
index 61cf6c3418..95f9ea6f37 100644
--- a/awx_collection/plugins/modules/job_list.py
+++ b/awx_collection/plugins/modules/job_list.py
@@ -48,7 +48,7 @@ EXAMPLES = '''
job_list:
status: running
query: {"playbook": "testing.yml"}
- tower_config_file: "~/tower_cli.cfg"
+ controller_config_file: "~/tower_cli.cfg"
register: testing_jobs
'''
diff --git a/awx_collection/plugins/modules/job_template.py b/awx_collection/plugins/modules/job_template.py
index 2bae27bb64..52010b48b7 100644
--- a/awx_collection/plugins/modules/job_template.py
+++ b/awx_collection/plugins/modules/job_template.py
@@ -315,7 +315,7 @@ EXAMPLES = '''
credentials:
- "Local"
state: "present"
- tower_config_file: "~/tower_cli.cfg"
+ controller_config_file: "~/tower_cli.cfg"
survey_enabled: yes
survey_spec: "{{ lookup('file', 'my_survey.json') }}"
diff --git a/awx_collection/plugins/modules/notification_template.py b/awx_collection/plugins/modules/notification_template.py
index 8ea0a8dd23..bc3b9b7f19 100644
--- a/awx_collection/plugins/modules/notification_template.py
+++ b/awx_collection/plugins/modules/notification_template.py
@@ -226,7 +226,7 @@ EXAMPLES = '''
error:
message: "{{ '{{ job_friendly_name }} FAILED! Please look at {{ job.url }}' }}"
state: present
- tower_config_file: "~/tower_cli.cfg"
+ controller_config_file: "~/tower_cli.cfg"
- name: Add webhook notification
notification_template:
@@ -237,7 +237,7 @@ EXAMPLES = '''
headers:
X-Custom-Header: value123
state: present
- tower_config_file: "~/tower_cli.cfg"
+ controller_config_file: "~/tower_cli.cfg"
- name: Add email notification
notification_template:
@@ -254,7 +254,7 @@ EXAMPLES = '''
use_tls: no
use_ssl: no
state: present
- tower_config_file: "~/tower_cli.cfg"
+ controller_config_file: "~/tower_cli.cfg"
- name: Add twilio notification
notification_template:
@@ -267,7 +267,7 @@ EXAMPLES = '''
to_numbers:
- '+15553334444'
state: present
- tower_config_file: "~/tower_cli.cfg"
+ controller_config_file: "~/tower_cli.cfg"
- name: Add PagerDuty notification
notification_template:
@@ -279,7 +279,7 @@ EXAMPLES = '''
client_name: client
service_key: a_key
state: present
- tower_config_file: "~/tower_cli.cfg"
+ controller_config_file: "~/tower_cli.cfg"
- name: Add IRC notification
notification_template:
@@ -294,13 +294,13 @@ EXAMPLES = '''
server: irc.example.com
use_ssl: no
state: present
- tower_config_file: "~/tower_cli.cfg"
+ controller_config_file: "~/tower_cli.cfg"
- name: Delete notification
notification_template:
name: old notification
state: absent
- tower_config_file: "~/tower_cli.cfg"
+ controller_config_file: "~/tower_cli.cfg"
- name: Copy webhook notification
notification_template:
diff --git a/awx_collection/plugins/modules/organization.py b/awx_collection/plugins/modules/organization.py
index fd45452509..c9547de77c 100644
--- a/awx_collection/plugins/modules/organization.py
+++ b/awx_collection/plugins/modules/organization.py
@@ -91,14 +91,14 @@ EXAMPLES = '''
name: "Foo"
description: "Foo bar organization"
state: present
- tower_config_file: "~/tower_cli.cfg"
+ controller_config_file: "~/tower_cli.cfg"
- name: Create organization using 'foo-venv' as default Python virtualenv
organization:
name: "Foo"
description: "Foo bar organization using foo-venv"
state: present
- tower_config_file: "~/tower_cli.cfg"
+ controller_config_file: "~/tower_cli.cfg"
- name: Create organization that pulls content from galaxy.ansible.com
organization:
@@ -106,7 +106,7 @@ EXAMPLES = '''
state: present
galaxy_credentials:
- Ansible Galaxy
- tower_config_file: "~/tower_cli.cfg"
+ controller_config_file: "~/tower_cli.cfg"
'''
from ..module_utils.controller_api import ControllerAPIModule
diff --git a/awx_collection/plugins/modules/project.py b/awx_collection/plugins/modules/project.py
index 0f6f68ce2c..f01fb9f034 100644
--- a/awx_collection/plugins/modules/project.py
+++ b/awx_collection/plugins/modules/project.py
@@ -176,7 +176,7 @@ EXAMPLES = '''
description: "Foo bar project"
organization: "test"
state: present
- tower_config_file: "~/tower_cli.cfg"
+ controller_config_file: "~/tower_cli.cfg"
- name: Add Project with cache timeout
project:
@@ -186,7 +186,7 @@ EXAMPLES = '''
scm_update_on_launch: True
scm_update_cache_timeout: 60
state: present
- tower_config_file: "~/tower_cli.cfg"
+ controller_config_file: "~/tower_cli.cfg"
- name: Copy project
project:
diff --git a/awx_collection/plugins/modules/receive.py b/awx_collection/plugins/modules/receive.py
index e941b648ec..4463355525 100644
--- a/awx_collection/plugins/modules/receive.py
+++ b/awx_collection/plugins/modules/receive.py
@@ -104,7 +104,7 @@ EXAMPLES = '''
- name: Export all Automation Platform Controller assets
receive:
all: True
- tower_config_file: "~/tower_cli.cfg"
+ controller_config_file: "~/tower_cli.cfg"
- name: Export all inventories
receive:
diff --git a/awx_collection/plugins/modules/send.py b/awx_collection/plugins/modules/send.py
index 2f5588a7e9..7bff90ea64 100644
--- a/awx_collection/plugins/modules/send.py
+++ b/awx_collection/plugins/modules/send.py
@@ -65,7 +65,7 @@ EXAMPLES = '''
- name: Import all Automation Platform Controller assets
send:
assets: "{{ export_output.assets }}"
- tower_config_file: "~/tower_cli.cfg"
+ controller_config_file: "~/tower_cli.cfg"
'''
RETURN = '''
diff --git a/awx_collection/plugins/modules/team.py b/awx_collection/plugins/modules/team.py
index e66d541e8a..5482b4c850 100644
--- a/awx_collection/plugins/modules/team.py
+++ b/awx_collection/plugins/modules/team.py
@@ -56,7 +56,7 @@ EXAMPLES = '''
description: Team Description
organization: test-org
state: present
- tower_config_file: "~/tower_cli.cfg"
+ controller_config_file: "~/tower_cli.cfg"
'''
from ..module_utils.controller_api import ControllerAPIModule
diff --git a/awx_collection/plugins/modules/token.py b/awx_collection/plugins/modules/token.py
index c49c4f8f67..26da2d3f5f 100644
--- a/awx_collection/plugins/modules/token.py
+++ b/awx_collection/plugins/modules/token.py
@@ -22,7 +22,7 @@ description:
- Create or destroy Automation Platform Controller tokens. See
U(https://www.ansible.com/tower) for an overview.
- In addition, the module sets an Ansible fact which can be passed into other
- controller modules as the parameter tower_oauthtoken. See examples for usage.
+ controller modules as the parameter controller_oauthtoken. See examples for usage.
- Because of the sensitive nature of tokens, the created token value is only available once
through the Ansible fact. (See RETURN for details)
- Due to the nature of tokens this module is not idempotent. A second will
@@ -49,7 +49,7 @@ options:
default: 'write'
choices: ["read", "write"]
existing_token:
- description: The data structure produced from tower_token in create mode to be used with state absent.
+ description: The data structure produced from token in create mode to be used with state absent.
type: dict
existing_token_id:
description: A token ID (number) which can be used to delete an arbitrary token with state absent.
@@ -70,11 +70,11 @@ EXAMPLES = '''
description: '{{ token_description }}'
scope: "write"
state: present
- tower_oauthtoken: "{{ my_existing_token }}"
+ controller_oauthtoken: "{{ my_existing_token }}"
- name: Delete this token
token:
- existing_token: "{{ tower_token }}"
+ existing_token: "{{ token }}"
state: absent
- name: Create a new token using username/password
@@ -82,19 +82,19 @@ EXAMPLES = '''
description: '{{ token_description }}'
scope: "write"
state: present
- tower_username: "{{ my_username }}"
- tower_password: "{{ my_password }}"
+ controller_username: "{{ my_username }}"
+ controller_password: "{{ my_password }}"
- name: Use our new token to make another call
job_list:
- tower_oauthtoken: "{{ tower_token }}"
+ controller_oauthtoken: "{{ token }}"
always:
- name: Delete our Token with the token we created
token:
- existing_token: "{{ tower_token }}"
+ existing_token: "{{ token }}"
state: absent
- when: tower_token is defined
+ when: token is defined
- name: Delete a token by its id
token:
@@ -125,7 +125,7 @@ def return_token(module, last_response):
# This method will return the entire token object we got back so that a user has access to the token
module.json_output['ansible_facts'] = {
- 'tower_token': last_response,
+ 'token': last_response,
}
module.exit_json(**module.json_output)
diff --git a/awx_collection/plugins/modules/user.py b/awx_collection/plugins/modules/user.py
index befb48e732..3867f9dd73 100644
--- a/awx_collection/plugins/modules/user.py
+++ b/awx_collection/plugins/modules/user.py
@@ -79,7 +79,7 @@ EXAMPLES = '''
first_name: John
last_name: Doe
state: present
- tower_config_file: "~/tower_cli.cfg"
+ controller_config_file: "~/tower_cli.cfg"
- name: Add user as a system administrator
user:
@@ -88,7 +88,7 @@ EXAMPLES = '''
email: jdoe@example.org
superuser: yes
state: present
- tower_config_file: "~/tower_cli.cfg"
+ controller_config_file: "~/tower_cli.cfg"
- name: Add user as a system auditor
user:
@@ -97,14 +97,14 @@ EXAMPLES = '''
email: jdoe@example.org
auditor: yes
state: present
- tower_config_file: "~/tower_cli.cfg"
+ controller_config_file: "~/tower_cli.cfg"
- name: Delete user
user:
username: jdoe
email: jdoe@example.org
state: absent
- tower_config_file: "~/tower_cli.cfg"
+ controller_config_file: "~/tower_cli.cfg"
'''
from ..module_utils.controller_api import ControllerAPIModule
diff --git a/awx_collection/test/awx/test_module_utils.py b/awx_collection/test/awx/test_module_utils.py
index fdfc382f77..5d41d3ccb8 100644
--- a/awx_collection/test/awx/test_module_utils.py
+++ b/awx_collection/test/awx/test_module_utils.py
@@ -129,7 +129,7 @@ def test_type_warning(collection_import, silence_warning):
def test_duplicate_config(collection_import, silence_warning):
# imports done here because of PATH issues unique to this test suite
ControllerAPIModule = collection_import('plugins.module_utils.controller_api').ControllerAPIModule
- data = {'name': 'zigzoom', 'zig': 'zoom', 'tower_username': 'bob', 'tower_config_file': 'my_config'}
+ data = {'name': 'zigzoom', 'zig': 'zoom', 'controller_username': 'bob', 'controller_config_file': 'my_config'}
with mock.patch.object(ControllerAPIModule, 'load_config') as mock_load:
argument_spec = dict(
@@ -140,8 +140,8 @@ def test_duplicate_config(collection_import, silence_warning):
assert mock_load.mock_calls[-1] == mock.call('my_config')
silence_warning.assert_called_once_with(
- 'The parameter(s) tower_username were provided at the same time as '
- 'tower_config_file. Precedence may be unstable, '
+ 'The parameter(s) controller_username were provided at the same time as '
+ 'controller_config_file. Precedence may be unstable, '
'we suggest either using config file or params.'
)
@@ -167,7 +167,7 @@ def test_conflicting_name_and_id(run_module, admin_user):
one item has an id that matches input
one item has a name that matches input
We should preference the id over the name.
- Otherwise, the universality of the tower_api lookup plugin is compromised.
+ Otherwise, the universality of the controller_api lookup plugin is compromised.
"""
org_by_id = Organization.objects.create(name='foo')
slug = str(org_by_id.id)
diff --git a/awx_collection/test/awx/test_organization.py b/awx_collection/test/awx/test_organization.py
index a3f3a724e1..08d35ed6f7 100644
--- a/awx_collection/test/awx/test_organization.py
+++ b/awx_collection/test/awx/test_organization.py
@@ -15,12 +15,12 @@ def test_create_organization(run_module, admin_user):
'description': 'barfoo',
'state': 'present',
'max_hosts': '0',
- 'tower_host': None,
- 'tower_username': None,
- 'tower_password': None,
+ 'controller_host': None,
+ 'controller_username': None,
+ 'controller_password': None,
'validate_certs': None,
- 'tower_oauthtoken': None,
- 'tower_config_file': None,
+ 'controller_oauthtoken': None,
+ 'controller_config_file': None,
}
result = run_module('organization', module_args, admin_user)
diff --git a/awx_collection/test/awx/test_token.py b/awx_collection/test/awx/test_token.py
index a09cb4762e..d49dd01df9 100644
--- a/awx_collection/test/awx/test_token.py
+++ b/awx_collection/test/awx/test_token.py
@@ -14,12 +14,12 @@ def test_create_token(run_module, admin_user):
'description': 'barfoo',
'state': 'present',
'scope': 'read',
- 'tower_host': None,
- 'tower_username': None,
- 'tower_password': None,
+ 'controller_host': None,
+ 'controller_username': None,
+ 'controller_password': None,
'validate_certs': None,
- 'tower_oauthtoken': None,
- 'tower_config_file': None,
+ 'controller_oauthtoken': None,
+ 'controller_config_file': None,
}
result = run_module('token', module_args, admin_user)
diff --git a/awx_collection/tests/integration/targets/job_template/tasks/main.yml b/awx_collection/tests/integration/targets/job_template/tasks/main.yml
index 9cbc5b9c2a..612e32ecc0 100644
--- a/awx_collection/tests/integration/targets/job_template/tasks/main.yml
+++ b/awx_collection/tests/integration/targets/job_template/tasks/main.yml
@@ -18,7 +18,7 @@
group_name1: "AWX-Collection-tests-instance_group-group1-{{ test_id }}"
- name: "Create a new organization"
- tower_organization:
+ organization:
name: "{{ org_name }}"
galaxy_credentials:
- Ansible Galaxy
@@ -53,7 +53,7 @@
kind: ssh
- name: Create Labels
- tower_label:
+ label:
name: "{{ lab1 }}"
organization: "{{ item }}"
loop:
@@ -423,7 +423,7 @@
state: absent
- name: "Remove the organization"
- tower_organization:
+ organization:
name: "{{ org_name }}"
state: absent
register: result
diff --git a/awx_collection/tests/integration/targets/token/tasks/main.yml b/awx_collection/tests/integration/targets/token/tasks/main.yml
index 144c4d7175..f6f76f49cf 100644
--- a/awx_collection/tests/integration/targets/token/tasks/main.yml
+++ b/awx_collection/tests/integration/targets/token/tasks/main.yml
@@ -5,7 +5,7 @@
- name: Try to use a token as a dict which is missing the token parameter
job_list:
- tower_oauthtoken:
+ controller_oauthtoken:
not_token: "This has no token entry"
register: results
ignore_errors: true
@@ -13,11 +13,11 @@
- assert:
that:
- results is failed
- - '"The provided dict in tower_oauthtoken did not properly contain the token entry" == results.msg'
+ - '"The provided dict in controller_oauthtoken did not properly contain the token entry" == results.msg'
- name: Try to use a token as a list
job_list:
- tower_oauthtoken:
+ controller_oauthtoken:
- dummy_token
register: results
ignore_errors: true
@@ -25,7 +25,7 @@
- assert:
that:
- results is failed
- - '"The provided tower_oauthtoken type was not valid (list). Valid options are str or dict." == results.msg'
+ - '"The provided controller_oauthtoken type was not valid (list). Valid options are str or dict." == results.msg'
- name: Try to delete a token with no existing_token or existing_token_id
token:
@@ -63,21 +63,21 @@
- name: Validate our token works by token
job_list:
- tower_oauthtoken: "{{ tower_token.token }}"
+ oauthtoken: "{{ token.token }}"
register: job_list
- name: Validate out token works by object
job_list:
- tower_oauthtoken: "{{ tower_token }}"
+ oauthtoken: "{{ token }}"
register: job_list
always:
- name: Delete our Token with our own token
token:
- existing_token: "{{ tower_token }}"
- tower_oauthtoken: "{{ tower_token }}"
+ existing_token: "{{ token }}"
+ oauthtoken: "{{ token }}"
state: absent
- when: tower_token is defined
+ when: token is defined
register: results
- assert:
@@ -99,10 +99,10 @@
always:
- name: Delete the second Token with our own token
token:
- existing_token_id: "{{ tower_token['id'] }}"
- tower_oauthtoken: "{{ tower_token }}"
+ existing_token_id: "{{ token['id'] }}"
+ oauthtoken: "{{ token }}"
state: absent
- when: tower_token is defined
+ when: token is defined
register: results
- assert:
diff --git a/awx_collection/tests/integration/targets/user/tasks/main.yml b/awx_collection/tests/integration/targets/user/tasks/main.yml
index bd5a2c4660..fee9876a3c 100644
--- a/awx_collection/tests/integration/targets/user/tasks/main.yml
+++ b/awx_collection/tests/integration/targets/user/tasks/main.yml
@@ -110,11 +110,11 @@
email: joe@example.org
state: present
validate_certs: true
- tower_host: http://foo.invalid
+ controller_host: http://foo.invalid
ignore_errors: true
register: result
- assert:
that:
- - "'Unable to resolve tower_host' in result.msg or
+ - "'Unable to resolve controller_host' in result.msg or
'Can not verify ssl with non-https protocol' in result.exception"
diff --git a/awx_collection/tests/integration/targets/workflow_job_template/tasks/main.yml b/awx_collection/tests/integration/targets/workflow_job_template/tasks/main.yml
index fd61783266..527481281b 100644
--- a/awx_collection/tests/integration/targets/workflow_job_template/tasks/main.yml
+++ b/awx_collection/tests/integration/targets/workflow_job_template/tasks/main.yml
@@ -19,7 +19,7 @@
project_inv_source: "AWX-Collection-tests-inventory_source-inv-source-project-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
- name: "Create a new organization"
- tower_organization:
+ organization:
name: "{{ org_name }}"
galaxy_credentials:
- Ansible Galaxy
@@ -64,7 +64,7 @@
register: result
- name: Create Labels
- tower_label:
+ label:
name: "{{ lab1 }}"
organization: "{{ item }}"
loop:
@@ -667,7 +667,7 @@
state: absent
- name: "Remove the organization"
- tower_organization:
+ organization:
name: "{{ org_name }}"
state: absent
register: result
diff --git a/awx_collection/tools/roles/template_galaxy/tasks/main.yml b/awx_collection/tools/roles/template_galaxy/tasks/main.yml
index 0e3f0630a9..b53d339771 100644
--- a/awx_collection/tools/roles/template_galaxy/tasks/main.yml
+++ b/awx_collection/tools/roles/template_galaxy/tasks/main.yml
@@ -36,9 +36,9 @@
- name: Change runtime.yml redirect destinations
replace:
- path: "{{ collection_path}}/meta/runtime.yml"
+ path: "{{ collection_path }}/meta/runtime.yml"
regexp: "redirect: awx.awx."
- replace: "redirect: '{{ collection_namespace }}.{{ collection_package }}."
+ replace: "redirect: {{ collection_namespace }}.{{ collection_package }}."
- name: get list of test files
find: