mirror of
https://github.com/ansible/awx.git
synced 2026-03-22 11:25:08 -02:30
add new name to multiple modules
This commit is contained in:
committed by
sean-m-sullivan
parent
03ed6e9755
commit
bb8efbcc82
@@ -26,6 +26,10 @@ options:
|
|||||||
- Name of the application.
|
- Name of the application.
|
||||||
required: True
|
required: True
|
||||||
type: str
|
type: str
|
||||||
|
new_name:
|
||||||
|
description:
|
||||||
|
- Setting this option will change the existing name (looked up via the name field.
|
||||||
|
type: str
|
||||||
description:
|
description:
|
||||||
description:
|
description:
|
||||||
- Description of the application.
|
- Description of the application.
|
||||||
@@ -96,6 +100,7 @@ def main():
|
|||||||
# Any additional arguments that are not fields of the item can be added here
|
# Any additional arguments that are not fields of the item can be added here
|
||||||
argument_spec = dict(
|
argument_spec = dict(
|
||||||
name=dict(required=True),
|
name=dict(required=True),
|
||||||
|
new_name=dict(),
|
||||||
description=dict(),
|
description=dict(),
|
||||||
authorization_grant_type=dict(choices=["password", "authorization-code"]),
|
authorization_grant_type=dict(choices=["password", "authorization-code"]),
|
||||||
client_type=dict(choices=['public', 'confidential']),
|
client_type=dict(choices=['public', 'confidential']),
|
||||||
@@ -110,6 +115,7 @@ def main():
|
|||||||
|
|
||||||
# Extract our parameters
|
# Extract our parameters
|
||||||
name = module.params.get('name')
|
name = module.params.get('name')
|
||||||
|
new_name = module.params.get("new_name")
|
||||||
description = module.params.get('description')
|
description = module.params.get('description')
|
||||||
authorization_grant_type = module.params.get('authorization_grant_type')
|
authorization_grant_type = module.params.get('authorization_grant_type')
|
||||||
client_type = module.params.get('client_type')
|
client_type = module.params.get('client_type')
|
||||||
@@ -129,7 +135,7 @@ def main():
|
|||||||
|
|
||||||
# Create the data that gets sent for create and update
|
# Create the data that gets sent for create and update
|
||||||
application_fields = {
|
application_fields = {
|
||||||
'name': name,
|
'name': new_name if new_name else (module.get_item_name(application) if application else name),
|
||||||
'organization': org_id,
|
'organization': org_id,
|
||||||
}
|
}
|
||||||
if authorization_grant_type is not None:
|
if authorization_grant_type is not None:
|
||||||
|
|||||||
@@ -27,6 +27,10 @@ options:
|
|||||||
- The name of the credential type.
|
- The name of the credential type.
|
||||||
required: True
|
required: True
|
||||||
type: str
|
type: str
|
||||||
|
new_name:
|
||||||
|
description:
|
||||||
|
- Setting this option will change the existing name (looked up via the name field.
|
||||||
|
type: str
|
||||||
description:
|
description:
|
||||||
description:
|
description:
|
||||||
- The description of the credential type to give more detail about it.
|
- The description of the credential type to give more detail about it.
|
||||||
@@ -89,6 +93,7 @@ def main():
|
|||||||
# Any additional arguments that are not fields of the item can be added here
|
# Any additional arguments that are not fields of the item can be added here
|
||||||
argument_spec = dict(
|
argument_spec = dict(
|
||||||
name=dict(required=True),
|
name=dict(required=True),
|
||||||
|
new_name=dict(),
|
||||||
description=dict(),
|
description=dict(),
|
||||||
kind=dict(choices=list(KIND_CHOICES.keys())),
|
kind=dict(choices=list(KIND_CHOICES.keys())),
|
||||||
inputs=dict(type='dict'),
|
inputs=dict(type='dict'),
|
||||||
@@ -101,7 +106,7 @@ def main():
|
|||||||
|
|
||||||
# Extract our parameters
|
# Extract our parameters
|
||||||
name = module.params.get('name')
|
name = module.params.get('name')
|
||||||
new_name = None
|
new_name = module.params.get("new_name")
|
||||||
kind = module.params.get('kind')
|
kind = module.params.get('kind')
|
||||||
state = module.params.get('state')
|
state = module.params.get('state')
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,10 @@ options:
|
|||||||
- Name to use for the execution environment.
|
- Name to use for the execution environment.
|
||||||
required: True
|
required: True
|
||||||
type: str
|
type: str
|
||||||
|
new_name:
|
||||||
|
description:
|
||||||
|
- Setting this option will change the existing name (looked up via the name field.
|
||||||
|
type: str
|
||||||
image:
|
image:
|
||||||
description:
|
description:
|
||||||
- The fully qualified url of the container image.
|
- The fully qualified url of the container image.
|
||||||
@@ -74,6 +78,7 @@ def main():
|
|||||||
# Any additional arguments that are not fields of the item can be added here
|
# Any additional arguments that are not fields of the item can be added here
|
||||||
argument_spec = dict(
|
argument_spec = dict(
|
||||||
name=dict(required=True),
|
name=dict(required=True),
|
||||||
|
new_name=dict(),
|
||||||
image=dict(required=True),
|
image=dict(required=True),
|
||||||
description=dict(default=''),
|
description=dict(default=''),
|
||||||
organization=dict(),
|
organization=dict(),
|
||||||
@@ -87,6 +92,7 @@ def main():
|
|||||||
|
|
||||||
# Extract our parameters
|
# Extract our parameters
|
||||||
name = module.params.get('name')
|
name = module.params.get('name')
|
||||||
|
new_name = module.params.get("new_name")
|
||||||
image = module.params.get('image')
|
image = module.params.get('image')
|
||||||
description = module.params.get('description')
|
description = module.params.get('description')
|
||||||
state = module.params.get('state')
|
state = module.params.get('state')
|
||||||
@@ -98,7 +104,7 @@ def main():
|
|||||||
module.delete_if_needed(existing_item)
|
module.delete_if_needed(existing_item)
|
||||||
|
|
||||||
new_fields = {
|
new_fields = {
|
||||||
'name': name,
|
'name': new_name if new_name else (module.get_item_name(existing_item) if existing_item else name),
|
||||||
'image': image,
|
'image': image,
|
||||||
}
|
}
|
||||||
if description:
|
if description:
|
||||||
|
|||||||
@@ -26,6 +26,10 @@ options:
|
|||||||
- The name to use for the inventory.
|
- The name to use for the inventory.
|
||||||
required: True
|
required: True
|
||||||
type: str
|
type: str
|
||||||
|
new_name:
|
||||||
|
description:
|
||||||
|
- Setting this option will change the existing name (looked up via the name field.
|
||||||
|
type: str
|
||||||
copy_from:
|
copy_from:
|
||||||
description:
|
description:
|
||||||
- Name or id to copy the inventory from.
|
- Name or id to copy the inventory from.
|
||||||
@@ -99,6 +103,7 @@ def main():
|
|||||||
# Any additional arguments that are not fields of the item can be added here
|
# Any additional arguments that are not fields of the item can be added here
|
||||||
argument_spec = dict(
|
argument_spec = dict(
|
||||||
name=dict(required=True),
|
name=dict(required=True),
|
||||||
|
new_name=dict(),
|
||||||
copy_from=dict(),
|
copy_from=dict(),
|
||||||
description=dict(),
|
description=dict(),
|
||||||
organization=dict(required=True),
|
organization=dict(required=True),
|
||||||
@@ -114,6 +119,7 @@ def main():
|
|||||||
|
|
||||||
# Extract our parameters
|
# Extract our parameters
|
||||||
name = module.params.get('name')
|
name = module.params.get('name')
|
||||||
|
new_name = module.params.get("new_name")
|
||||||
copy_from = module.params.get('copy_from')
|
copy_from = module.params.get('copy_from')
|
||||||
description = module.params.get('description')
|
description = module.params.get('description')
|
||||||
organization = module.params.get('organization')
|
organization = module.params.get('organization')
|
||||||
@@ -146,7 +152,7 @@ def main():
|
|||||||
|
|
||||||
# Create the data that gets sent for create and update
|
# Create the data that gets sent for create and update
|
||||||
inventory_fields = {
|
inventory_fields = {
|
||||||
'name': module.get_item_name(inventory) if inventory else name,
|
'name': new_name if new_name else (module.get_item_name(inventory) if inventory else name),
|
||||||
'organization': org_id,
|
'organization': org_id,
|
||||||
'kind': kind,
|
'kind': kind,
|
||||||
'host_filter': host_filter,
|
'host_filter': host_filter,
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ options:
|
|||||||
type: str
|
type: str
|
||||||
new_name:
|
new_name:
|
||||||
description:
|
description:
|
||||||
- Setting this option will change the existing name (looed up via the name field.
|
- Setting this option will change the existing name (looked up via the name field.
|
||||||
type: str
|
type: str
|
||||||
copy_from:
|
copy_from:
|
||||||
description:
|
description:
|
||||||
|
|||||||
@@ -26,6 +26,10 @@ options:
|
|||||||
- Name to use for the organization.
|
- Name to use for the organization.
|
||||||
required: True
|
required: True
|
||||||
type: str
|
type: str
|
||||||
|
new_name:
|
||||||
|
description:
|
||||||
|
- Setting this option will change the existing name (looked up via the name field.
|
||||||
|
type: str
|
||||||
description:
|
description:
|
||||||
description:
|
description:
|
||||||
- The description to use for the organization.
|
- The description to use for the organization.
|
||||||
@@ -116,6 +120,7 @@ def main():
|
|||||||
# Any additional arguments that are not fields of the item can be added here
|
# Any additional arguments that are not fields of the item can be added here
|
||||||
argument_spec = dict(
|
argument_spec = dict(
|
||||||
name=dict(required=True),
|
name=dict(required=True),
|
||||||
|
new_name=dict(),
|
||||||
description=dict(),
|
description=dict(),
|
||||||
default_environment=dict(),
|
default_environment=dict(),
|
||||||
custom_virtualenv=dict(),
|
custom_virtualenv=dict(),
|
||||||
@@ -134,6 +139,7 @@ def main():
|
|||||||
|
|
||||||
# Extract our parameters
|
# Extract our parameters
|
||||||
name = module.params.get('name')
|
name = module.params.get('name')
|
||||||
|
new_name = module.params.get("new_name")
|
||||||
description = module.params.get('description')
|
description = module.params.get('description')
|
||||||
default_ee = module.params.get('default_environment')
|
default_ee = module.params.get('default_environment')
|
||||||
custom_virtualenv = module.params.get('custom_virtualenv')
|
custom_virtualenv = module.params.get('custom_virtualenv')
|
||||||
@@ -186,7 +192,7 @@ def main():
|
|||||||
association_fields['galaxy_credentials'].append(module.resolve_name_to_id('credentials', item))
|
association_fields['galaxy_credentials'].append(module.resolve_name_to_id('credentials', item))
|
||||||
|
|
||||||
# Create the data that gets sent for create and update
|
# Create the data that gets sent for create and update
|
||||||
org_fields = {'name': module.get_item_name(organization) if organization else name}
|
org_fields = {'name': new_name if new_name else (module.get_item_name(organization) if organization else name),}
|
||||||
if description is not None:
|
if description is not None:
|
||||||
org_fields['description'] = description
|
org_fields['description'] = description
|
||||||
if default_ee is not None:
|
if default_ee is not None:
|
||||||
|
|||||||
@@ -26,6 +26,10 @@ options:
|
|||||||
- Name to use for the project.
|
- Name to use for the project.
|
||||||
required: True
|
required: True
|
||||||
type: str
|
type: str
|
||||||
|
new_name:
|
||||||
|
description:
|
||||||
|
- Setting this option will change the existing name (looked up via the name field.
|
||||||
|
type: str
|
||||||
copy_from:
|
copy_from:
|
||||||
description:
|
description:
|
||||||
- Name or id to copy the project from.
|
- Name or id to copy the project from.
|
||||||
@@ -249,6 +253,7 @@ def main():
|
|||||||
# Any additional arguments that are not fields of the item can be added here
|
# Any additional arguments that are not fields of the item can be added here
|
||||||
argument_spec = dict(
|
argument_spec = dict(
|
||||||
name=dict(required=True),
|
name=dict(required=True),
|
||||||
|
new_name=dict(),
|
||||||
copy_from=dict(),
|
copy_from=dict(),
|
||||||
description=dict(),
|
description=dict(),
|
||||||
scm_type=dict(choices=['manual', 'git', 'svn', 'insights'], default='manual'),
|
scm_type=dict(choices=['manual', 'git', 'svn', 'insights'], default='manual'),
|
||||||
@@ -281,6 +286,7 @@ def main():
|
|||||||
|
|
||||||
# Extract our parameters
|
# Extract our parameters
|
||||||
name = module.params.get('name')
|
name = module.params.get('name')
|
||||||
|
new_name = module.params.get("new_name")
|
||||||
copy_from = module.params.get('copy_from')
|
copy_from = module.params.get('copy_from')
|
||||||
scm_type = module.params.get('scm_type')
|
scm_type = module.params.get('scm_type')
|
||||||
if scm_type == "manual":
|
if scm_type == "manual":
|
||||||
@@ -347,7 +353,7 @@ def main():
|
|||||||
|
|
||||||
# Create the data that gets sent for create and update
|
# Create the data that gets sent for create and update
|
||||||
project_fields = {
|
project_fields = {
|
||||||
'name': module.get_item_name(project) if project else name,
|
'name': new_name if new_name else (module.get_item_name(project) if project else name),
|
||||||
'scm_type': scm_type,
|
'scm_type': scm_type,
|
||||||
'organization': org_id,
|
'organization': org_id,
|
||||||
'scm_update_on_launch': scm_update_on_launch,
|
'scm_update_on_launch': scm_update_on_launch,
|
||||||
|
|||||||
@@ -26,6 +26,10 @@ options:
|
|||||||
- Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.
|
- Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.
|
||||||
required: True
|
required: True
|
||||||
type: str
|
type: str
|
||||||
|
new_username:
|
||||||
|
description:
|
||||||
|
- Setting this option will change the existing username (looked up via the name field.
|
||||||
|
type: str
|
||||||
first_name:
|
first_name:
|
||||||
description:
|
description:
|
||||||
- First name of the user.
|
- First name of the user.
|
||||||
@@ -114,6 +118,7 @@ def main():
|
|||||||
# Any additional arguments that are not fields of the item can be added here
|
# Any additional arguments that are not fields of the item can be added here
|
||||||
argument_spec = dict(
|
argument_spec = dict(
|
||||||
username=dict(required=True),
|
username=dict(required=True),
|
||||||
|
new_username=dict(),
|
||||||
first_name=dict(),
|
first_name=dict(),
|
||||||
last_name=dict(),
|
last_name=dict(),
|
||||||
email=dict(),
|
email=dict(),
|
||||||
@@ -129,6 +134,7 @@ def main():
|
|||||||
|
|
||||||
# Extract our parameters
|
# Extract our parameters
|
||||||
username = module.params.get('username')
|
username = module.params.get('username')
|
||||||
|
new_username = module.params.get("new_username")
|
||||||
first_name = module.params.get('first_name')
|
first_name = module.params.get('first_name')
|
||||||
last_name = module.params.get('last_name')
|
last_name = module.params.get('last_name')
|
||||||
email = module.params.get('email')
|
email = module.params.get('email')
|
||||||
@@ -149,7 +155,7 @@ def main():
|
|||||||
# Create the data that gets sent for create and update
|
# Create the data that gets sent for create and update
|
||||||
new_fields = {}
|
new_fields = {}
|
||||||
if username is not None:
|
if username is not None:
|
||||||
new_fields['username'] = module.get_item_name(existing_item) if existing_item else username
|
new_fields['username'] = new_username if new_username else (module.get_item_name(existing_item) if existing_item else username)
|
||||||
if first_name is not None:
|
if first_name is not None:
|
||||||
new_fields['first_name'] = first_name
|
new_fields['first_name'] = first_name
|
||||||
if last_name is not None:
|
if last_name is not None:
|
||||||
|
|||||||
@@ -810,7 +810,7 @@ def main():
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Get Workflow information in case one was just created.
|
# Get Workflow information in case one was just created.
|
||||||
existing_item = module.get_one('workflow_job_templates', name_or_id=name, **{'data': search_fields})
|
existing_item = module.get_one('workflow_job_templates', name_or_id=new_name if new_name else name, **{'data': search_fields})
|
||||||
workflow_job_template_id = existing_item['id']
|
workflow_job_template_id = existing_item['id']
|
||||||
# Destroy current nodes if selected.
|
# Destroy current nodes if selected.
|
||||||
if destroy_current_schema:
|
if destroy_current_schema:
|
||||||
|
|||||||
@@ -67,6 +67,8 @@ no_api_parameter_ok = {
|
|||||||
'ad_hoc_command': ['interval', 'timeout', 'wait'],
|
'ad_hoc_command': ['interval', 'timeout', 'wait'],
|
||||||
# group parameters to perserve hosts and children.
|
# group parameters to perserve hosts and children.
|
||||||
'group': ['preserve_existing_children', 'preserve_existing_hosts'],
|
'group': ['preserve_existing_children', 'preserve_existing_hosts'],
|
||||||
|
# user parameters to rename a user.
|
||||||
|
'user': ['new_username'],
|
||||||
# workflow_approval parameters that do not apply when approving an approval node.
|
# workflow_approval parameters that do not apply when approving an approval node.
|
||||||
'workflow_approval': ['action', 'interval', 'timeout', 'workflow_job_id'],
|
'workflow_approval': ['action', 'interval', 'timeout', 'workflow_job_id'],
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,6 +66,18 @@
|
|||||||
that:
|
that:
|
||||||
- "result is changed"
|
- "result is changed"
|
||||||
|
|
||||||
|
- name: Rename an inventory
|
||||||
|
application:
|
||||||
|
name: "{{ app3_name }}"
|
||||||
|
new_name: "{{ app3_name }}a"
|
||||||
|
organization: Default
|
||||||
|
state: present
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- result.changed
|
||||||
|
|
||||||
always:
|
always:
|
||||||
- name: Delete our application
|
- name: Delete our application
|
||||||
application:
|
application:
|
||||||
@@ -77,3 +89,4 @@
|
|||||||
- "{{ app1_name }}"
|
- "{{ app1_name }}"
|
||||||
- "{{ app2_name }}"
|
- "{{ app2_name }}"
|
||||||
- "{{ app3_name }}"
|
- "{{ app3_name }}"
|
||||||
|
- "{{ app3_name }}a"
|
||||||
|
|||||||
@@ -3,25 +3,42 @@
|
|||||||
set_fact:
|
set_fact:
|
||||||
cred_type_name: "AWX-Collection-tests-credential_type-cred-type-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
cred_type_name: "AWX-Collection-tests-credential_type-cred-type-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
|
||||||
- name: Add Tower credential type
|
- block:
|
||||||
credential_type:
|
- name: Add Tower credential type
|
||||||
description: Credential type for Test
|
credential_type:
|
||||||
name: "{{ cred_type_name }}"
|
description: Credential type for Test
|
||||||
kind: cloud
|
name: "{{ cred_type_name }}"
|
||||||
inputs: {"fields": [{"type": "string", "id": "username", "label": "Username"}, {"secret": true, "type": "string", "id": "password", "label": "Password"}], "required": ["username", "password"]}
|
kind: cloud
|
||||||
injectors: {"extra_vars": {"test": "foo"}}
|
inputs: {"fields": [{"type": "string", "id": "username", "label": "Username"}, {"secret": true, "type": "string", "id": "password", "label": "Password"}], "required": ["username", "password"]}
|
||||||
register: result
|
injectors: {"extra_vars": {"test": "foo"}}
|
||||||
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
that:
|
that:
|
||||||
- "result is changed"
|
- "result is changed"
|
||||||
|
|
||||||
- name: Remove a Tower credential type
|
- name: Rename Tower credential type
|
||||||
credential_type:
|
credential_type:
|
||||||
name: "{{ result.id }}"
|
name: "{{ cred_type_name }}"
|
||||||
state: absent
|
new_name: "{{ cred_type_name }}a"
|
||||||
register: result
|
kind: cloud
|
||||||
|
|
||||||
- assert:
|
register: result
|
||||||
that:
|
|
||||||
- "result is changed"
|
- assert:
|
||||||
|
that:
|
||||||
|
- "result is changed"
|
||||||
|
|
||||||
|
always:
|
||||||
|
- name: Remove a Tower credential type
|
||||||
|
credential_type:
|
||||||
|
name: "{{ item }}"
|
||||||
|
state: absent
|
||||||
|
register: result
|
||||||
|
loop:
|
||||||
|
- "{{ cred_type_name }}"
|
||||||
|
- "{{ cred_type_name }}a"
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- "result is changed"
|
||||||
|
|||||||
@@ -34,14 +34,28 @@
|
|||||||
that:
|
that:
|
||||||
- "result is failed"
|
- "result is failed"
|
||||||
|
|
||||||
always:
|
- name: Rename the Test EEs
|
||||||
- name: Delete the Test EE
|
|
||||||
execution_environment:
|
execution_environment:
|
||||||
name: "{{ ee_name }}"
|
name: "{{ ee_name }}"
|
||||||
state: absent
|
new_name: "{{ ee_name }}a"
|
||||||
image: quay.io/ansible/awx-ee
|
image: quay.io/ansible/awx-ee
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
that:
|
that:
|
||||||
- "result is changed"
|
- "result is changed"
|
||||||
|
|
||||||
|
always:
|
||||||
|
- name: Delete the Test EEs
|
||||||
|
execution_environment:
|
||||||
|
name: "{{ item }}"
|
||||||
|
state: absent
|
||||||
|
image: quay.io/ansible/awx-ee
|
||||||
|
register: result
|
||||||
|
loop:
|
||||||
|
- "{{ ee_name }}"
|
||||||
|
- "{{ ee_name }}a"
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- "result is changed"
|
||||||
|
|||||||
@@ -74,9 +74,21 @@
|
|||||||
that:
|
that:
|
||||||
- result.copied
|
- result.copied
|
||||||
|
|
||||||
- name: Delete an Inventory
|
- name: Rename an inventory
|
||||||
inventory:
|
inventory:
|
||||||
name: "copy_{{ inv_name1 }}"
|
name: "copy_{{ inv_name1 }}"
|
||||||
|
new_name: "copy_{{ inv_name1 }}a"
|
||||||
|
organization: Default
|
||||||
|
state: present
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- result.changed
|
||||||
|
|
||||||
|
- name: Delete an Inventory
|
||||||
|
inventory:
|
||||||
|
name: "copy_{{ inv_name1 }}a"
|
||||||
organization: Default
|
organization: Default
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
|
|||||||
@@ -70,9 +70,19 @@
|
|||||||
name: "{{ group_name1 }}"
|
name: "{{ group_name1 }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
- name: "Remove the organization"
|
- name: "Rename the organization"
|
||||||
organization:
|
organization:
|
||||||
name: "{{ org_name }}"
|
name: "{{ org_name }}"
|
||||||
|
new_name: "{{ org_name }}a"
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- "result is changed"
|
||||||
|
|
||||||
|
- name: "Remove the organization"
|
||||||
|
organization:
|
||||||
|
name: "{{ org_name }}a"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
|
|||||||
@@ -183,6 +183,18 @@
|
|||||||
that:
|
that:
|
||||||
- job is successful
|
- job is successful
|
||||||
|
|
||||||
|
- name: Rename an inventory
|
||||||
|
project:
|
||||||
|
name: "{{ project_name3 }}"
|
||||||
|
new_name: "{{ project_name3 }}a"
|
||||||
|
organization: Default
|
||||||
|
state: present
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- result.changed
|
||||||
|
|
||||||
always:
|
always:
|
||||||
- name: Delete the test job_template
|
- name: Delete the test job_template
|
||||||
job_template:
|
job_template:
|
||||||
@@ -197,6 +209,12 @@
|
|||||||
organization: Default
|
organization: Default
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
|
- name: Delete the test project 3a
|
||||||
|
project:
|
||||||
|
name: "{{ project_name3 }}a"
|
||||||
|
organization: Default
|
||||||
|
state: absent
|
||||||
|
|
||||||
- name: Delete the test project 2
|
- name: Delete the test project 2
|
||||||
project:
|
project:
|
||||||
name: "{{ project_name2 }}"
|
name: "{{ project_name2 }}"
|
||||||
|
|||||||
@@ -38,9 +38,20 @@
|
|||||||
that:
|
that:
|
||||||
- "result is not changed"
|
- "result is not changed"
|
||||||
|
|
||||||
- name: Delete a User
|
- name: Rename a User
|
||||||
user:
|
user:
|
||||||
username: "{{ username }}"
|
username: "{{ username }}"
|
||||||
|
new_username: "{{ username }}-renamed"
|
||||||
|
email: joe@example.org
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- "result is changed"
|
||||||
|
|
||||||
|
- name: Delete a User
|
||||||
|
user:
|
||||||
|
username: "{{ username }}-renamed"
|
||||||
email: joe@example.org
|
email: joe@example.org
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
|
|||||||
Reference in New Issue
Block a user