Merge pull request #11380 from sean-m-sullivan/new_name

add new name to multiple modules
This commit is contained in:
Shane McDonald
2022-01-11 01:42:55 +08:00
committed by GitHub
17 changed files with 172 additions and 34 deletions

View File

@@ -66,6 +66,18 @@
that:
- "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:
- name: Delete our application
application:
@@ -77,3 +89,4 @@
- "{{ app1_name }}"
- "{{ app2_name }}"
- "{{ app3_name }}"
- "{{ app3_name }}a"

View File

@@ -3,25 +3,42 @@
set_fact:
cred_type_name: "AWX-Collection-tests-credential_type-cred-type-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
- name: Add Tower credential type
credential_type:
description: Credential type for Test
name: "{{ cred_type_name }}"
kind: cloud
inputs: {"fields": [{"type": "string", "id": "username", "label": "Username"}, {"secret": true, "type": "string", "id": "password", "label": "Password"}], "required": ["username", "password"]}
injectors: {"extra_vars": {"test": "foo"}}
register: result
- block:
- name: Add Tower credential type
credential_type:
description: Credential type for Test
name: "{{ cred_type_name }}"
kind: cloud
inputs: {"fields": [{"type": "string", "id": "username", "label": "Username"}, {"secret": true, "type": "string", "id": "password", "label": "Password"}], "required": ["username", "password"]}
injectors: {"extra_vars": {"test": "foo"}}
register: result
- assert:
that:
- "result is changed"
- assert:
that:
- "result is changed"
- name: Remove a Tower credential type
credential_type:
name: "{{ result.id }}"
state: absent
register: result
- name: Rename Tower credential type
credential_type:
name: "{{ cred_type_name }}"
new_name: "{{ cred_type_name }}a"
kind: cloud
- assert:
that:
- "result is changed"
register: result
- 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"

View File

@@ -34,14 +34,28 @@
that:
- "result is failed"
always:
- name: Delete the Test EE
- name: Rename the Test EEs
execution_environment:
name: "{{ ee_name }}"
state: absent
new_name: "{{ ee_name }}a"
image: quay.io/ansible/awx-ee
register: result
- assert:
that:
- "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"

View File

@@ -74,9 +74,21 @@
that:
- result.copied
- name: Delete an Inventory
- name: Rename an inventory
inventory:
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
state: absent
register: result

View File

@@ -70,9 +70,19 @@
name: "{{ group_name1 }}"
state: absent
- name: "Remove the organization"
- name: "Rename the organization"
organization:
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
register: result

View File

@@ -183,6 +183,18 @@
that:
- 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:
- name: Delete the test job_template
job_template:
@@ -197,6 +209,12 @@
organization: Default
state: absent
- name: Delete the test project 3a
project:
name: "{{ project_name3 }}a"
organization: Default
state: absent
- name: Delete the test project 2
project:
name: "{{ project_name2 }}"

View File

@@ -38,9 +38,20 @@
that:
- "result is not changed"
- name: Delete a User
- name: Rename a User
user:
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
state: absent
register: result