tower_username to controller_username, etc

This commit is contained in:
Seth Foster
2021-05-13 13:54:37 -04:00
parent 1a2e56c785
commit 7d06fc74dd
25 changed files with 116 additions and 111 deletions

View File

@@ -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:

View File

@@ -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:

View File

@@ -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
'''

View File

@@ -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:

View File

@@ -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
'''

View File

@@ -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') }}"

View File

@@ -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:

View File

@@ -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

View File

@@ -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:

View File

@@ -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:

View File

@@ -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 = '''

View File

@@ -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

View File

@@ -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)

View File

@@ -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