mirror of
https://github.com/ansible/awx.git
synced 2026-05-08 01:47:35 -02:30
Merge pull request #6319 from squidboylan/collection_test_refactor
Collection test refactor Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
@@ -1,4 +1,25 @@
|
|||||||
---
|
---
|
||||||
|
- name: Generate names
|
||||||
|
set_fact:
|
||||||
|
ssh_cred_name1: "AWX-Collection-tests-tower_credential-ssh-cred1-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
ssh_cred_name2: "AWX-Collection-tests-tower_credential-ssh-cred2-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
ssh_cred_name3: "AWX-Collection-tests-tower_credential-ssh-cred-lookup-source-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
ssh_cred_name4: "AWX-Collection-tests-tower_credential-ssh-cred-file-source-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
vault_cred_name1: "AWX-Collection-tests-tower_credential-vault-cred1-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
vault_cred_name2: "AWX-Collection-tests-tower_credential-vault-ssh-cred1-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
net_cred_name1: "AWX-Collection-tests-tower_credential-net-cred1-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
scm_cred_name1: "AWX-Collection-tests-tower_credential-scm-cred1-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
aws_cred_name1: "AWX-Collection-tests-tower_credential-aws-cred1-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
vmware_cred_name1: "AWX-Collection-tests-tower_credential-vmware-cred1-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
sat6_cred_name1: "AWX-Collection-tests-tower_credential-sat6-cred1-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
cf_cred_name1: "AWX-Collection-tests-tower_credential-cf-cred1-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
gce_cred_name1: "AWX-Collection-tests-tower_credential-gce-cred1-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
azurerm_cred_name1: "AWX-Collection-tests-tower_credential-azurerm-cred1-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
openstack_cred_name1: "AWX-Collection-tests-tower_credential-openstack-cred1-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
rhv_cred_name1: "AWX-Collection-tests-tower_credential-rhv-cred1-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
insights_cred_name1: "AWX-Collection-tests-tower_credential-insights-cred1-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
tower_cred_name1: "AWX-Collection-tests-tower_credential-tower-cred1-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
|
||||||
- name: create a tempdir for an SSH key
|
- name: create a tempdir for an SSH key
|
||||||
local_action: shell mktemp -d
|
local_action: shell mktemp -d
|
||||||
register: tempdir
|
register: tempdir
|
||||||
@@ -12,7 +33,7 @@
|
|||||||
|
|
||||||
- name: Create a User-specific credential
|
- name: Create a User-specific credential
|
||||||
tower_credential:
|
tower_credential:
|
||||||
name: SSH Credential
|
name: "{{ ssh_cred_name1 }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
user: admin
|
user: admin
|
||||||
state: present
|
state: present
|
||||||
@@ -25,7 +46,7 @@
|
|||||||
|
|
||||||
- name: Delete a User-specific credential
|
- name: Delete a User-specific credential
|
||||||
tower_credential:
|
tower_credential:
|
||||||
name: SSH Credential
|
name: "{{ ssh_cred_name1 }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
user: admin
|
user: admin
|
||||||
state: absent
|
state: absent
|
||||||
@@ -38,7 +59,7 @@
|
|||||||
|
|
||||||
- name: Create a valid SSH credential
|
- name: Create a valid SSH credential
|
||||||
tower_credential:
|
tower_credential:
|
||||||
name: SSH Credential
|
name: "{{ ssh_cred_name2 }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
state: present
|
state: present
|
||||||
kind: ssh
|
kind: ssh
|
||||||
@@ -58,7 +79,7 @@
|
|||||||
|
|
||||||
- name: Create a valid SSH credential from lookup source
|
- name: Create a valid SSH credential from lookup source
|
||||||
tower_credential:
|
tower_credential:
|
||||||
name: SSH Credential from lookup source
|
name: "{{ ssh_cred_name3 }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
state: present
|
state: present
|
||||||
kind: ssh
|
kind: ssh
|
||||||
@@ -78,7 +99,7 @@
|
|||||||
|
|
||||||
- name: Create a valid SSH credential from file source
|
- name: Create a valid SSH credential from file source
|
||||||
tower_credential:
|
tower_credential:
|
||||||
name: SSH Credential from file source
|
name: "{{ ssh_cred_name4 }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
state: present
|
state: present
|
||||||
kind: ssh
|
kind: ssh
|
||||||
@@ -131,7 +152,31 @@
|
|||||||
|
|
||||||
- name: Delete an SSH credential
|
- name: Delete an SSH credential
|
||||||
tower_credential:
|
tower_credential:
|
||||||
name: SSH Credential
|
name: "{{ ssh_cred_name2 }}"
|
||||||
|
organization: Default
|
||||||
|
state: absent
|
||||||
|
kind: ssh
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- "result is changed"
|
||||||
|
|
||||||
|
- name: Delete an SSH credential
|
||||||
|
tower_credential:
|
||||||
|
name: "{{ ssh_cred_name3 }}"
|
||||||
|
organization: Default
|
||||||
|
state: absent
|
||||||
|
kind: ssh
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- "result is changed"
|
||||||
|
|
||||||
|
- name: Delete an SSH credential
|
||||||
|
tower_credential:
|
||||||
|
name: "{{ ssh_cred_name4 }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
state: absent
|
state: absent
|
||||||
kind: ssh
|
kind: ssh
|
||||||
@@ -143,7 +188,7 @@
|
|||||||
|
|
||||||
- name: Create a valid Vault credential
|
- name: Create a valid Vault credential
|
||||||
tower_credential:
|
tower_credential:
|
||||||
name: Vault Credential
|
name: "{{ vault_cred_name1 }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
state: present
|
state: present
|
||||||
kind: vault
|
kind: vault
|
||||||
@@ -155,9 +200,10 @@
|
|||||||
that:
|
that:
|
||||||
- "result is changed"
|
- "result is changed"
|
||||||
|
|
||||||
|
# We should decide when to delete this test
|
||||||
- name: Create a valid Vault credential w/ kind=ssh (deprecated)
|
- name: Create a valid Vault credential w/ kind=ssh (deprecated)
|
||||||
tower_credential:
|
tower_credential:
|
||||||
name: Vault Credential
|
name: "{{ vault_cred_name2 }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
state: present
|
state: present
|
||||||
kind: ssh
|
kind: ssh
|
||||||
@@ -171,7 +217,19 @@
|
|||||||
|
|
||||||
- name: Delete a Vault credential
|
- name: Delete a Vault credential
|
||||||
tower_credential:
|
tower_credential:
|
||||||
name: Vault Credential
|
name: "{{ vault_cred_name1 }}"
|
||||||
|
organization: Default
|
||||||
|
state: absent
|
||||||
|
kind: vault
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- "result is changed"
|
||||||
|
|
||||||
|
- name: Delete a Vault credential
|
||||||
|
tower_credential:
|
||||||
|
name: "{{ vault_cred_name2 }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
state: absent
|
state: absent
|
||||||
kind: vault
|
kind: vault
|
||||||
@@ -183,7 +241,7 @@
|
|||||||
|
|
||||||
- name: Create a valid Network credential
|
- name: Create a valid Network credential
|
||||||
tower_credential:
|
tower_credential:
|
||||||
name: Network Credential
|
name: "{{ net_cred_name1 }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
state: present
|
state: present
|
||||||
kind: net
|
kind: net
|
||||||
@@ -199,7 +257,7 @@
|
|||||||
|
|
||||||
- name: Delete a Network credential
|
- name: Delete a Network credential
|
||||||
tower_credential:
|
tower_credential:
|
||||||
name: Network Credential
|
name: "{{ net_cred_name1 }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
state: absent
|
state: absent
|
||||||
kind: net
|
kind: net
|
||||||
@@ -211,7 +269,7 @@
|
|||||||
|
|
||||||
- name: Create a valid SCM credential
|
- name: Create a valid SCM credential
|
||||||
tower_credential:
|
tower_credential:
|
||||||
name: SCM Credential
|
name: "{{ scm_cred_name1 }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
state: present
|
state: present
|
||||||
kind: scm
|
kind: scm
|
||||||
@@ -227,7 +285,7 @@
|
|||||||
|
|
||||||
- name: Delete an SCM credential
|
- name: Delete an SCM credential
|
||||||
tower_credential:
|
tower_credential:
|
||||||
name: SCM Credential
|
name: "{{ scm_cred_name1 }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
state: absent
|
state: absent
|
||||||
kind: scm
|
kind: scm
|
||||||
@@ -239,7 +297,7 @@
|
|||||||
|
|
||||||
- name: Create a valid AWS credential
|
- name: Create a valid AWS credential
|
||||||
tower_credential:
|
tower_credential:
|
||||||
name: AWS Credential
|
name: "{{ aws_cred_name1 }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
state: present
|
state: present
|
||||||
kind: aws
|
kind: aws
|
||||||
@@ -254,7 +312,7 @@
|
|||||||
|
|
||||||
- name: Delete an AWS credential
|
- name: Delete an AWS credential
|
||||||
tower_credential:
|
tower_credential:
|
||||||
name: AWS Credential
|
name: "{{ aws_cred_name1 }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
state: absent
|
state: absent
|
||||||
kind: aws
|
kind: aws
|
||||||
@@ -266,7 +324,7 @@
|
|||||||
|
|
||||||
- name: Create a valid VMWare credential
|
- name: Create a valid VMWare credential
|
||||||
tower_credential:
|
tower_credential:
|
||||||
name: VMWare Credential
|
name: "{{ vmware_cred_name1 }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
state: present
|
state: present
|
||||||
kind: vmware
|
kind: vmware
|
||||||
@@ -281,7 +339,7 @@
|
|||||||
|
|
||||||
- name: Delete an VMWare credential
|
- name: Delete an VMWare credential
|
||||||
tower_credential:
|
tower_credential:
|
||||||
name: VMWare Credential
|
name: "{{ vmware_cred_name1 }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
state: absent
|
state: absent
|
||||||
kind: vmware
|
kind: vmware
|
||||||
@@ -293,7 +351,7 @@
|
|||||||
|
|
||||||
- name: Create a valid Satellite6 credential
|
- name: Create a valid Satellite6 credential
|
||||||
tower_credential:
|
tower_credential:
|
||||||
name: Satellite6 Credential
|
name: "{{ sat6_cred_name1 }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
state: present
|
state: present
|
||||||
kind: satellite6
|
kind: satellite6
|
||||||
@@ -308,7 +366,7 @@
|
|||||||
|
|
||||||
- name: Delete a Satellite6 credential
|
- name: Delete a Satellite6 credential
|
||||||
tower_credential:
|
tower_credential:
|
||||||
name: Satellite6 Credential
|
name: "{{ sat6_cred_name1 }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
state: absent
|
state: absent
|
||||||
kind: satellite6
|
kind: satellite6
|
||||||
@@ -320,7 +378,7 @@
|
|||||||
|
|
||||||
- name: Create a valid CloudForms credential
|
- name: Create a valid CloudForms credential
|
||||||
tower_credential:
|
tower_credential:
|
||||||
name: CloudForms Credential
|
name: "{{ cf_cred_name1 }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
state: present
|
state: present
|
||||||
kind: cloudforms
|
kind: cloudforms
|
||||||
@@ -335,7 +393,7 @@
|
|||||||
|
|
||||||
- name: Delete a CloudForms credential
|
- name: Delete a CloudForms credential
|
||||||
tower_credential:
|
tower_credential:
|
||||||
name: CloudForms Credential
|
name: "{{ cf_cred_name1 }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
state: absent
|
state: absent
|
||||||
kind: cloudforms
|
kind: cloudforms
|
||||||
@@ -347,7 +405,7 @@
|
|||||||
|
|
||||||
- name: Create a valid GCE credential
|
- name: Create a valid GCE credential
|
||||||
tower_credential:
|
tower_credential:
|
||||||
name: GCE Credential
|
name: "{{ gce_cred_name1 }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
state: present
|
state: present
|
||||||
kind: gce
|
kind: gce
|
||||||
@@ -362,7 +420,7 @@
|
|||||||
|
|
||||||
- name: Delete a GCE credential
|
- name: Delete a GCE credential
|
||||||
tower_credential:
|
tower_credential:
|
||||||
name: GCE Credential
|
name: "{{ gce_cred_name1 }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
state: absent
|
state: absent
|
||||||
kind: gce
|
kind: gce
|
||||||
@@ -374,7 +432,7 @@
|
|||||||
|
|
||||||
- name: Create a valid AzureRM credential
|
- name: Create a valid AzureRM credential
|
||||||
tower_credential:
|
tower_credential:
|
||||||
name: AzureRM Credential
|
name: "{{ azurerm_cred_name1 }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
state: present
|
state: present
|
||||||
kind: azure_rm
|
kind: azure_rm
|
||||||
@@ -389,7 +447,7 @@
|
|||||||
|
|
||||||
- name: Create a valid AzureRM credential with a tenant
|
- name: Create a valid AzureRM credential with a tenant
|
||||||
tower_credential:
|
tower_credential:
|
||||||
name: AzureRM Credential
|
name: "{{ azurerm_cred_name1 }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
state: present
|
state: present
|
||||||
kind: azure_rm
|
kind: azure_rm
|
||||||
@@ -405,7 +463,7 @@
|
|||||||
|
|
||||||
- name: Delete an AzureRM credential
|
- name: Delete an AzureRM credential
|
||||||
tower_credential:
|
tower_credential:
|
||||||
name: AzureRM Credential
|
name: "{{ azurerm_cred_name1 }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
state: absent
|
state: absent
|
||||||
kind: azure_rm
|
kind: azure_rm
|
||||||
@@ -417,7 +475,7 @@
|
|||||||
|
|
||||||
- name: Create a valid OpenStack credential
|
- name: Create a valid OpenStack credential
|
||||||
tower_credential:
|
tower_credential:
|
||||||
name: OpenStack Credential
|
name: "{{ openstack_cred_name1 }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
state: present
|
state: present
|
||||||
kind: openstack
|
kind: openstack
|
||||||
@@ -434,7 +492,7 @@
|
|||||||
|
|
||||||
- name: Delete a OpenStack credential
|
- name: Delete a OpenStack credential
|
||||||
tower_credential:
|
tower_credential:
|
||||||
name: OpenStack Credential
|
name: "{{ openstack_cred_name1 }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
state: absent
|
state: absent
|
||||||
kind: openstack
|
kind: openstack
|
||||||
@@ -446,7 +504,7 @@
|
|||||||
|
|
||||||
- name: Create a valid RHV credential
|
- name: Create a valid RHV credential
|
||||||
tower_credential:
|
tower_credential:
|
||||||
name: RHV Credential
|
name: "{{ rhv_cred_name1 }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
state: present
|
state: present
|
||||||
kind: rhv
|
kind: rhv
|
||||||
@@ -461,7 +519,7 @@
|
|||||||
|
|
||||||
- name: Delete an RHV credential
|
- name: Delete an RHV credential
|
||||||
tower_credential:
|
tower_credential:
|
||||||
name: RHV Credential
|
name: "{{ rhv_cred_name1 }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
state: absent
|
state: absent
|
||||||
kind: rhv
|
kind: rhv
|
||||||
@@ -473,7 +531,7 @@
|
|||||||
|
|
||||||
- name: Create a valid Insights credential
|
- name: Create a valid Insights credential
|
||||||
tower_credential:
|
tower_credential:
|
||||||
name: Insights Credential
|
name: "{{ insights_cred_name1 }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
state: present
|
state: present
|
||||||
kind: insights
|
kind: insights
|
||||||
@@ -487,7 +545,7 @@
|
|||||||
|
|
||||||
- name: Delete an Insights credential
|
- name: Delete an Insights credential
|
||||||
tower_credential:
|
tower_credential:
|
||||||
name: Insights Credential
|
name: "{{ insights_cred_name1 }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
state: absent
|
state: absent
|
||||||
kind: insights
|
kind: insights
|
||||||
@@ -499,7 +557,7 @@
|
|||||||
|
|
||||||
- name: Create a valid Tower-to-Tower credential
|
- name: Create a valid Tower-to-Tower credential
|
||||||
tower_credential:
|
tower_credential:
|
||||||
name: Tower Credential
|
name: "{{ tower_cred_name1 }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
state: present
|
state: present
|
||||||
kind: tower
|
kind: tower
|
||||||
@@ -514,7 +572,7 @@
|
|||||||
|
|
||||||
- name: Delete a Tower-to-Tower credential
|
- name: Delete a Tower-to-Tower credential
|
||||||
tower_credential:
|
tower_credential:
|
||||||
name: Tower Credential
|
name: "{{ tower_cred_name1 }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
state: absent
|
state: absent
|
||||||
kind: tower
|
kind: tower
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
---
|
---
|
||||||
|
- name: Generate names
|
||||||
|
set_fact:
|
||||||
|
cred_type_name: "AWX-Collection-tests-tower_credential_type-cred-type-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
|
||||||
- name: Add Tower credential type
|
- name: Add Tower credential type
|
||||||
tower_credential_type:
|
tower_credential_type:
|
||||||
description: Credential type for Test
|
description: Credential type for Test
|
||||||
name: test-credential-type
|
name: "{{ cred_type_name }}"
|
||||||
kind: cloud
|
kind: cloud
|
||||||
inputs: {"fields": [{"type": "string", "id": "username", "label": "Username"}, {"secret": true, "type": "string", "id": "password", "label": "Password"}], "required": ["username", "password"]}
|
inputs: {"fields": [{"type": "string", "id": "username", "label": "Username"}, {"secret": true, "type": "string", "id": "password", "label": "Password"}], "required": ["username", "password"]}
|
||||||
injectors: {"extra_vars": {"test": "foo"}}
|
injectors: {"extra_vars": {"test": "foo"}}
|
||||||
@@ -14,7 +18,7 @@
|
|||||||
|
|
||||||
- name: Remove a Tower credential type
|
- name: Remove a Tower credential type
|
||||||
tower_credential_type:
|
tower_credential_type:
|
||||||
name: test-credential-type
|
name: "{{ cred_type_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
---
|
---
|
||||||
- name: Generate an inventory name
|
- name: Generate names
|
||||||
set_fact:
|
set_fact:
|
||||||
inv_name: "inv-for-group-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
group_name: "AWX-Collection-tests-tower_group-group-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
inv_name: "AWX-Collection-test-tower_group-inv-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
|
||||||
- name: Create an Inventory
|
- name: Create an Inventory
|
||||||
tower_inventory:
|
tower_inventory:
|
||||||
@@ -11,7 +12,7 @@
|
|||||||
|
|
||||||
- name: Create a Group
|
- name: Create a Group
|
||||||
tower_group:
|
tower_group:
|
||||||
name: Some Group
|
name: "{{ group_name }}"
|
||||||
inventory: "{{ inv_name }}"
|
inventory: "{{ inv_name }}"
|
||||||
state: present
|
state: present
|
||||||
variables:
|
variables:
|
||||||
@@ -24,7 +25,7 @@
|
|||||||
|
|
||||||
- name: Delete a Group
|
- name: Delete a Group
|
||||||
tower_group:
|
tower_group:
|
||||||
name: Some Group
|
name: "{{ group_name }}"
|
||||||
inventory: "{{ inv_name }}"
|
inventory: "{{ inv_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
---
|
---
|
||||||
- name: Generate an inventory name
|
- name: Generate names
|
||||||
set_fact:
|
set_fact:
|
||||||
inv_name: "inv-for-group-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
host_name: "AWX-Collection-tests-tower_host-host-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
inv_name: "AWX-Collection-tests-tower_host-inv-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
|
||||||
- name: Create an Inventory
|
- name: Create an Inventory
|
||||||
tower_inventory:
|
tower_inventory:
|
||||||
@@ -11,7 +12,7 @@
|
|||||||
|
|
||||||
- name: Create a Host
|
- name: Create a Host
|
||||||
tower_host:
|
tower_host:
|
||||||
name: "some-host"
|
name: "{{ host_name }}"
|
||||||
inventory: "{{ inv_name }}"
|
inventory: "{{ inv_name }}"
|
||||||
state: present
|
state: present
|
||||||
variables:
|
variables:
|
||||||
@@ -24,7 +25,7 @@
|
|||||||
|
|
||||||
- name: Delete a Host
|
- name: Delete a Host
|
||||||
tower_host:
|
tower_host:
|
||||||
name: "some-host"
|
name: "{{ host_name }}"
|
||||||
inventory: "{{ inv_name }}"
|
inventory: "{{ inv_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
|
|||||||
@@ -1,15 +1,12 @@
|
|||||||
---
|
---
|
||||||
- name: Clean up any pre-existing test Inventory
|
- name: Generate names
|
||||||
tower_inventory:
|
set_fact:
|
||||||
name: my-inventory
|
inv_name1: "AWX-Collection-tests-tower_inventory-inv1-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
organization: Default
|
inv_name2: "AWX-Collection-tests-tower_inventory-inv2-{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
state: absent
|
|
||||||
ignore_errors: true
|
|
||||||
|
|
||||||
|
|
||||||
- name: Create an Inventory
|
- name: Create an Inventory
|
||||||
tower_inventory:
|
tower_inventory:
|
||||||
name: my-inventory
|
name: "{{ inv_name1 }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
@@ -20,7 +17,7 @@
|
|||||||
|
|
||||||
- name: Test Inventory module idempotency
|
- name: Test Inventory module idempotency
|
||||||
tower_inventory:
|
tower_inventory:
|
||||||
name: my-inventory
|
name: "{{ inv_name1 }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
@@ -31,7 +28,7 @@
|
|||||||
|
|
||||||
- name: Fail Change Regular to Smart
|
- name: Fail Change Regular to Smart
|
||||||
tower_inventory:
|
tower_inventory:
|
||||||
name: my-inventory
|
name: "{{ inv_name1 }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
kind: smart
|
kind: smart
|
||||||
register: result
|
register: result
|
||||||
@@ -41,9 +38,9 @@
|
|||||||
that:
|
that:
|
||||||
- "result is failed"
|
- "result is failed"
|
||||||
|
|
||||||
- name: create a smart inventory
|
- name: Create a smart inventory
|
||||||
tower_inventory:
|
tower_inventory:
|
||||||
name: smart-inventory
|
name: "{{ inv_name2 }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
kind: smart
|
kind: smart
|
||||||
host_filter: name=foo
|
host_filter: name=foo
|
||||||
@@ -53,9 +50,22 @@
|
|||||||
that:
|
that:
|
||||||
- "result is changed"
|
- "result is changed"
|
||||||
|
|
||||||
|
- name: Delete a smart inventory
|
||||||
|
tower_inventory:
|
||||||
|
name: "{{ inv_name2 }}"
|
||||||
|
organization: Default
|
||||||
|
kind: smart
|
||||||
|
host_filter: name=foo
|
||||||
|
state: absent
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- "result is changed"
|
||||||
|
|
||||||
- name: Delete an Inventory
|
- name: Delete an Inventory
|
||||||
tower_inventory:
|
tower_inventory:
|
||||||
name: my-inventory
|
name: "{{ inv_name1 }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
@@ -66,7 +76,7 @@
|
|||||||
|
|
||||||
- name: Delete a Non-Existent Inventory
|
- name: Delete a Non-Existent Inventory
|
||||||
tower_inventory:
|
tower_inventory:
|
||||||
name: my-inventory
|
name: "{{ inv_name1 }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
|
|||||||
@@ -1,8 +1,14 @@
|
|||||||
---
|
---
|
||||||
|
- name: Generate names
|
||||||
|
set_fact:
|
||||||
|
openstack_cred: "AWX-Collection-tests-tower_inventory_source-cred-openstack-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
openstack_inv: "AWX-Collection-tests-tower_inventory_source-inv-openstack-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
openstack_inv_source: "AWX-Collection-tests-tower_inventory_source-inv-source-openstack-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
|
||||||
- name: Add a Tower credential
|
- name: Add a Tower credential
|
||||||
tower_credential:
|
tower_credential:
|
||||||
description: Credentials for Openstack Test project
|
description: Credentials for Openstack Test project
|
||||||
name: openstack-test-credential
|
name: "{{ openstack_cred }}"
|
||||||
kind: openstack
|
kind: openstack
|
||||||
organization: Default
|
organization: Default
|
||||||
project: Test
|
project: Test
|
||||||
@@ -15,14 +21,14 @@
|
|||||||
tower_inventory:
|
tower_inventory:
|
||||||
description: Test inventory
|
description: Test inventory
|
||||||
organization: Default
|
organization: Default
|
||||||
name: openstack-test-inventory
|
name: "{{ openstack_inv }}"
|
||||||
|
|
||||||
- name: Create a source inventory
|
- name: Create a source inventory
|
||||||
tower_inventory_source:
|
tower_inventory_source:
|
||||||
name: "source-test-inventory {{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
name: "{{ openstack_inv_source }}"
|
||||||
description: Source for Test inventory
|
description: Source for Test inventory
|
||||||
inventory: openstack-test-inventory
|
inventory: "{{ openstack_inv }}"
|
||||||
credential: openstack-test-credential
|
credential: "{{ openstack_cred }}"
|
||||||
overwrite: true
|
overwrite: true
|
||||||
update_on_launch: true
|
update_on_launch: true
|
||||||
source_vars:
|
source_vars:
|
||||||
@@ -36,14 +42,45 @@
|
|||||||
|
|
||||||
- name: Delete the source inventory
|
- name: Delete the source inventory
|
||||||
tower_inventory_source:
|
tower_inventory_source:
|
||||||
name: "{{ result.name }}"
|
name: "{{ openstack_inv_source }}"
|
||||||
description: Source for Test inventory
|
description: Source for Test inventory
|
||||||
inventory: openstack-test-inventory
|
inventory: "{{ openstack_inv }}"
|
||||||
credential: openstack-test-credential
|
credential: "{{ openstack_cred }}"
|
||||||
overwrite: true
|
overwrite: true
|
||||||
update_on_launch: true
|
update_on_launch: true
|
||||||
source_vars:
|
source_vars:
|
||||||
private: false
|
private: false
|
||||||
source: openstack
|
source: openstack
|
||||||
state: absent
|
state: absent
|
||||||
ignore_errors: true
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- "result is changed"
|
||||||
|
|
||||||
|
- name: Delete the credential
|
||||||
|
tower_credential:
|
||||||
|
description: Credentials for Openstack Test project
|
||||||
|
name: "{{ openstack_cred }}"
|
||||||
|
kind: openstack
|
||||||
|
organization: Default
|
||||||
|
project: Test
|
||||||
|
username: admin
|
||||||
|
host: https://example.org:5000
|
||||||
|
password: passw0rd
|
||||||
|
domain: test
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- "result is changed"
|
||||||
|
|
||||||
|
- name: Delete the inventory
|
||||||
|
tower_inventory:
|
||||||
|
description: Test inventory
|
||||||
|
organization: Default
|
||||||
|
name: "{{ openstack_inv }}"
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- "result is changed"
|
||||||
|
|||||||
@@ -1,4 +1,10 @@
|
|||||||
---
|
---
|
||||||
|
- name: Generate names
|
||||||
|
set_fact:
|
||||||
|
jt_name1: "AWX-Collection-tests-tower_job_launch-jt1-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
jt_name2: "AWX-Collection-tests-tower_job_launch-jt2-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
proj_name: "AWX-Collection-tests-tower_job_launch-project-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
|
||||||
- name: Launch a Job Template
|
- name: Launch a Job Template
|
||||||
tower_job_launch:
|
tower_job_launch:
|
||||||
job_template: "Demo Job Template"
|
job_template: "Demo Job Template"
|
||||||
@@ -36,7 +42,7 @@
|
|||||||
|
|
||||||
- name: Create a Job Template for testing prompt on launch
|
- name: Create a Job Template for testing prompt on launch
|
||||||
tower_job_template:
|
tower_job_template:
|
||||||
name: "Demo Job Template - ask inventory and credential"
|
name: "{{ jt_name1 }}"
|
||||||
project: Demo Project
|
project: Demo Project
|
||||||
playbook: hello_world.yml
|
playbook: hello_world.yml
|
||||||
job_type: run
|
job_type: run
|
||||||
@@ -47,7 +53,7 @@
|
|||||||
|
|
||||||
- name: Launch job template with inventory and credential for prompt on launch
|
- name: Launch job template with inventory and credential for prompt on launch
|
||||||
tower_job_launch:
|
tower_job_launch:
|
||||||
job_template: "Demo Job Template - ask inventory and credential"
|
job_template: "{{ jt_name1 }}"
|
||||||
inventory: "Demo Inventory"
|
inventory: "Demo Inventory"
|
||||||
credential: "Demo Credential"
|
credential: "Demo Credential"
|
||||||
register: result
|
register: result
|
||||||
@@ -59,15 +65,15 @@
|
|||||||
|
|
||||||
- name: Create a project for testing extra_vars
|
- name: Create a project for testing extra_vars
|
||||||
tower_project:
|
tower_project:
|
||||||
name: test-playbooks
|
name: "{{ proj_name }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
scm_type: git
|
scm_type: git
|
||||||
scm_url: https://github.com/ansible/test-playbooks
|
scm_url: https://github.com/ansible/test-playbooks
|
||||||
|
|
||||||
- name: Create a Job Template for testing extra_vars
|
- name: Create a Job Template for testing extra_vars
|
||||||
tower_job_template:
|
tower_job_template:
|
||||||
name: "Demo Job Template - extra_vars"
|
name: "{{ jt_name2 }}"
|
||||||
project: test-playbooks
|
project: "{{ proj_name }}"
|
||||||
playbook: debug.yml
|
playbook: debug.yml
|
||||||
job_type: run
|
job_type: run
|
||||||
state: present
|
state: present
|
||||||
@@ -78,7 +84,7 @@
|
|||||||
|
|
||||||
- name: Launch job template with inventory and credential for prompt on launch
|
- name: Launch job template with inventory and credential for prompt on launch
|
||||||
tower_job_launch:
|
tower_job_launch:
|
||||||
job_template: "Demo Job Template - extra_vars"
|
job_template: "{{ jt_name2 }}"
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
@@ -94,9 +100,37 @@
|
|||||||
that:
|
that:
|
||||||
- '{"foo": "bar"} | to_json in result.results[0].extra_vars'
|
- '{"foo": "bar"} | to_json in result.results[0].extra_vars'
|
||||||
|
|
||||||
- name: Delete the job
|
- name: Delete the first jt
|
||||||
|
tower_job_template:
|
||||||
|
name: "{{ jt_name1 }}"
|
||||||
|
project: Demo Project
|
||||||
|
playbook: hello_world.yml
|
||||||
|
state: absent
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- "result is changed"
|
||||||
|
|
||||||
|
- name: Delete the second jt
|
||||||
|
tower_job_template:
|
||||||
|
name: "{{ jt_name2 }}"
|
||||||
|
project: "{{ proj_name }}"
|
||||||
|
playbook: debug.yml
|
||||||
|
state: absent
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- "result is changed"
|
||||||
|
|
||||||
|
- name: Delete the extra_vars project
|
||||||
tower_project:
|
tower_project:
|
||||||
name: "Demo Job Template - extra_vars"
|
name: "{{ proj_name }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
state: absent
|
state: absent
|
||||||
ignore_errors: true
|
register: result
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- "result is changed"
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
---
|
---
|
||||||
- name: generate random string for project
|
- name: generate random string for project
|
||||||
set_fact:
|
set_fact:
|
||||||
cred1: "{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
cred1: "AWX-Collection-tests-tower_job_template-cred1-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
cred2: "{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
cred2: "AWX-Collection-tests-tower_job_template-cred2-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
cred3: "{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
cred3: "AWX-Collection-tests-tower_job_template-cred3-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
proj1: "{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
proj1: "AWX-Collection-tests-tower_job_template-proj-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
jt1: "hello-world {{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
jt1: "AWX-Collection-tests-tower_job_template-jt1-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
jt2: "hello-world {{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
jt2: "AWX-Collection-tests-tower_job_template-jt2-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
|
||||||
- name: Create Credential1
|
- name: Create Credential1
|
||||||
tower_credential:
|
tower_credential:
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
---
|
---
|
||||||
|
- name: Generate names
|
||||||
|
set_fact:
|
||||||
|
label_name: "AWX-Collection-tests-tower_label-label-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
|
||||||
- name: Create a Label
|
- name: Create a Label
|
||||||
tower_label:
|
tower_label:
|
||||||
name: important
|
name: "{{ label_name }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,17 @@
|
|||||||
---
|
---
|
||||||
|
- name: Generate names
|
||||||
|
set_fact:
|
||||||
|
slack_not: "AWX-Collection-tests-tower_notification-slack-not-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
webhook_not: "AWX-Collection-tests-tower_notification-wehbook-not-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
email_not: "AWX-Collection-tests-tower_notification-email-not-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
twillo_not: "AWX-Collection-tests-tower_notification-twillo-not-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
pd_not: "AWX-Collection-tests-tower_notification-pd-not-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
hipchat_not: "AWX-Collection-tests-tower_notification-hipchat-not-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
irc_not: "AWX-Collection-tests-tower_notification-irc-not-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
|
||||||
- name: Create Slack notification
|
- name: Create Slack notification
|
||||||
tower_notification:
|
tower_notification:
|
||||||
name: notification1
|
name: "{{ slack_not }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
notification_type: slack
|
notification_type: slack
|
||||||
token: a_token
|
token: a_token
|
||||||
@@ -16,7 +26,7 @@
|
|||||||
|
|
||||||
- name: Delete Slack notification
|
- name: Delete Slack notification
|
||||||
tower_notification:
|
tower_notification:
|
||||||
name: notification1
|
name: "{{ slack_not }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
notification_type: slack
|
notification_type: slack
|
||||||
state: absent
|
state: absent
|
||||||
@@ -28,7 +38,7 @@
|
|||||||
|
|
||||||
- name: Add webhook notification
|
- name: Add webhook notification
|
||||||
tower_notification:
|
tower_notification:
|
||||||
name: notification2
|
name: "{{ webhook_not }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
notification_type: webhook
|
notification_type: webhook
|
||||||
url: http://www.example.com/hook
|
url: http://www.example.com/hook
|
||||||
@@ -43,7 +53,7 @@
|
|||||||
|
|
||||||
- name: Delete webhook notification
|
- name: Delete webhook notification
|
||||||
tower_notification:
|
tower_notification:
|
||||||
name: notification2
|
name: "{{ webhook_not }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
notification_type: webhook
|
notification_type: webhook
|
||||||
state: absent
|
state: absent
|
||||||
@@ -55,7 +65,7 @@
|
|||||||
|
|
||||||
- name: Add email notification
|
- name: Add email notification
|
||||||
tower_notification:
|
tower_notification:
|
||||||
name: notification3
|
name: "{{ email_not }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
notification_type: email
|
notification_type: email
|
||||||
username: user
|
username: user
|
||||||
@@ -76,7 +86,7 @@
|
|||||||
|
|
||||||
- name: Delete email notification
|
- name: Delete email notification
|
||||||
tower_notification:
|
tower_notification:
|
||||||
name: notification3
|
name: "{{ email_not }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
notification_type: email
|
notification_type: email
|
||||||
state: absent
|
state: absent
|
||||||
@@ -88,7 +98,7 @@
|
|||||||
|
|
||||||
- name: Add twilio notification
|
- name: Add twilio notification
|
||||||
tower_notification:
|
tower_notification:
|
||||||
name: notification4
|
name: "{{ twillo_not }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
notification_type: twilio
|
notification_type: twilio
|
||||||
account_token: a_token
|
account_token: a_token
|
||||||
@@ -105,7 +115,7 @@
|
|||||||
|
|
||||||
- name: Delete twilio notification
|
- name: Delete twilio notification
|
||||||
tower_notification:
|
tower_notification:
|
||||||
name: notification4
|
name: "{{ twillo_not }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
notification_type: twilio
|
notification_type: twilio
|
||||||
state: absent
|
state: absent
|
||||||
@@ -117,7 +127,7 @@
|
|||||||
|
|
||||||
- name: Add PagerDuty notification
|
- name: Add PagerDuty notification
|
||||||
tower_notification:
|
tower_notification:
|
||||||
name: notification5
|
name: "{{ pd_not }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
notification_type: pagerduty
|
notification_type: pagerduty
|
||||||
token: a_token
|
token: a_token
|
||||||
@@ -133,7 +143,7 @@
|
|||||||
|
|
||||||
- name: Delete PagerDuty notification
|
- name: Delete PagerDuty notification
|
||||||
tower_notification:
|
tower_notification:
|
||||||
name: notification5
|
name: "{{ pd_not }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
notification_type: pagerduty
|
notification_type: pagerduty
|
||||||
state: absent
|
state: absent
|
||||||
@@ -145,7 +155,7 @@
|
|||||||
|
|
||||||
- name: Add HipChat notification
|
- name: Add HipChat notification
|
||||||
tower_notification:
|
tower_notification:
|
||||||
name: notification6
|
name: "{{ hipchat_not }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
notification_type: hipchat
|
notification_type: hipchat
|
||||||
token: a_token
|
token: a_token
|
||||||
@@ -164,7 +174,7 @@
|
|||||||
|
|
||||||
- name: Delete HipChat notification
|
- name: Delete HipChat notification
|
||||||
tower_notification:
|
tower_notification:
|
||||||
name: notification6
|
name: "{{ hipchat_not }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
notification_type: hipchat
|
notification_type: hipchat
|
||||||
state: absent
|
state: absent
|
||||||
@@ -176,7 +186,7 @@
|
|||||||
|
|
||||||
- name: Add IRC notification
|
- name: Add IRC notification
|
||||||
tower_notification:
|
tower_notification:
|
||||||
name: notification7
|
name: "{{ irc_not }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
notification_type: irc
|
notification_type: irc
|
||||||
nickname: tower
|
nickname: tower
|
||||||
@@ -195,7 +205,7 @@
|
|||||||
|
|
||||||
- name: Delete IRC notification
|
- name: Delete IRC notification
|
||||||
tower_notification:
|
tower_notification:
|
||||||
name: notification7
|
name: "{{ irc_not }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
notification_type: irc
|
notification_type: irc
|
||||||
state: absent
|
state: absent
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
- name: Generate an org name
|
- name: Generate an org name
|
||||||
set_fact:
|
set_fact:
|
||||||
org_name: "org-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
org_name: "AWX-Collection-tests-tower_organization-org-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
|
||||||
- name: Make sure {{ org_name }} is not there
|
- name: Make sure {{ org_name }} is not there
|
||||||
tower_organization:
|
tower_organization:
|
||||||
|
|||||||
@@ -1,20 +1,26 @@
|
|||||||
---
|
---
|
||||||
- name: Delete old git project from any previous test runs
|
- name: Generate names
|
||||||
tower_project:
|
set_fact:
|
||||||
name: "git project"
|
project_name1: "AWX-Collection-tests-tower_project-project1-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
organization: Default
|
project_name2: "AWX-Collection-tests-tower_project-project2-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
state: absent
|
scm_cred_name: "AWX-Collection-tests-tower_project-scm-cred-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
ignore_errors: true
|
org_name: "AWX-Collection-tests-tower_project-org-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
cred_name: "AWX-Collection-tests-tower_project-cred-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
|
||||||
- name: Create an SCM Credential
|
- name: Create an SCM Credential
|
||||||
tower_credential:
|
tower_credential:
|
||||||
name: SCM Credential for Project
|
name: "{{ scm_cred_name }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
kind: scm
|
kind: scm
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- result is changed
|
||||||
|
|
||||||
- name: Create a git project without credentials without waiting
|
- name: Create a git project without credentials without waiting
|
||||||
tower_project:
|
tower_project:
|
||||||
name: "git project"
|
name: "{{ project_name1 }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
scm_type: git
|
scm_type: git
|
||||||
scm_url: https://github.com/ansible/test-playbooks
|
scm_url: https://github.com/ansible/test-playbooks
|
||||||
@@ -27,7 +33,7 @@
|
|||||||
|
|
||||||
- name: Recreate the project to validate not changed
|
- name: Recreate the project to validate not changed
|
||||||
tower_project:
|
tower_project:
|
||||||
name: "git project"
|
name: "{{ project_name1 }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
scm_type: git
|
scm_type: git
|
||||||
scm_url: https://github.com/ansible/test-playbooks
|
scm_url: https://github.com/ansible/test-playbooks
|
||||||
@@ -40,36 +46,40 @@
|
|||||||
|
|
||||||
- name: Create organizations
|
- name: Create organizations
|
||||||
tower_organization:
|
tower_organization:
|
||||||
name: TestOrg
|
name: "{{ org_name }}"
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- result is changed
|
||||||
|
|
||||||
- name: Create credential
|
- name: Create credential
|
||||||
tower_credential:
|
tower_credential:
|
||||||
kind: scm
|
kind: scm
|
||||||
name: TestCred
|
name: "{{ cred_name }}"
|
||||||
organization: TestOrg
|
organization: "{{ org_name }}"
|
||||||
|
register: result
|
||||||
|
|
||||||
register: new_credentials
|
- assert:
|
||||||
|
that:
|
||||||
- name: Generate random project name appender
|
- result is changed
|
||||||
set_fact:
|
|
||||||
project_name_rand: "{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
|
||||||
|
|
||||||
- name: Create a new test project in check_mode
|
- name: Create a new test project in check_mode
|
||||||
tower_project:
|
tower_project:
|
||||||
name: "TestProject {{ project_name_rand }}"
|
name: "{{ project_name2 }}"
|
||||||
organization: TestOrg
|
organization: "{{ org_name }}"
|
||||||
scm_type: git
|
scm_type: git
|
||||||
scm_url: https://github.com/ansible/test-playbooks
|
scm_url: https://github.com/ansible/test-playbooks
|
||||||
scm_credential: TestCred
|
scm_credential: "{{ cred_name }}"
|
||||||
check_mode: true
|
check_mode: true
|
||||||
|
|
||||||
- name: Create a new test project
|
- name: Create a new test project
|
||||||
tower_project:
|
tower_project:
|
||||||
name: "TestProject {{ project_name_rand }}"
|
name: "{{ project_name2 }}"
|
||||||
organization: TestOrg
|
organization: "{{ org_name }}"
|
||||||
scm_type: git
|
scm_type: git
|
||||||
scm_url: https://github.com/ansible/test-playbooks
|
scm_url: https://github.com/ansible/test-playbooks
|
||||||
scm_credential: TestCred
|
scm_credential: "{{ cred_name }}"
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
# If this fails it may be because the check_mode task actually already created
|
# If this fails it may be because the check_mode task actually already created
|
||||||
@@ -80,11 +90,11 @@
|
|||||||
|
|
||||||
- name: Check module fails with correct msg when given non-existing org as param
|
- name: Check module fails with correct msg when given non-existing org as param
|
||||||
tower_project:
|
tower_project:
|
||||||
name: "TestProject {{ project_name_rand }}"
|
name: "{{ project_name2 }}"
|
||||||
organization: Non Existing Org
|
organization: Non Existing Org
|
||||||
scm_type: git
|
scm_type: git
|
||||||
scm_url: https://github.com/ansible/test-playbooks
|
scm_url: https://github.com/ansible/test-playbooks
|
||||||
scm_credential: TestCred
|
scm_credential: "{{ cred_name }}"
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
||||||
@@ -95,8 +105,8 @@
|
|||||||
|
|
||||||
- name: Check module fails with correct msg when given non-existing credential as param
|
- name: Check module fails with correct msg when given non-existing credential as param
|
||||||
tower_project:
|
tower_project:
|
||||||
name: "TestProject {{ project_name_rand }}"
|
name: "{{ project_name2 }}"
|
||||||
organization: TestOrg
|
organization: "{{ org_name }}"
|
||||||
scm_type: git
|
scm_type: git
|
||||||
scm_url: https://github.com/ansible/test-playbooks
|
scm_url: https://github.com/ansible/test-playbooks
|
||||||
scm_credential: Non Existing Credential
|
scm_credential: Non Existing Credential
|
||||||
@@ -110,6 +120,51 @@
|
|||||||
|
|
||||||
- name: Delete the test project
|
- name: Delete the test project
|
||||||
tower_project:
|
tower_project:
|
||||||
name: "TestProject {{ project_name_rand }}"
|
name: "{{ project_name2 }}"
|
||||||
organization: TestOrg
|
organization: "{{ org_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
|
- name: Delete the SCM Credential
|
||||||
|
tower_credential:
|
||||||
|
name: "{{ scm_cred_name }}"
|
||||||
|
organization: Default
|
||||||
|
kind: scm
|
||||||
|
state: absent
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- result is changed
|
||||||
|
|
||||||
|
- name: Delete the other test project
|
||||||
|
tower_project:
|
||||||
|
name: "{{ project_name1 }}"
|
||||||
|
organization: Default
|
||||||
|
state: absent
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- result is changed
|
||||||
|
|
||||||
|
- name: Delete credential
|
||||||
|
tower_credential:
|
||||||
|
kind: scm
|
||||||
|
name: "{{ cred_name }}"
|
||||||
|
organization: "{{ org_name }}"
|
||||||
|
state: absent
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- result is changed
|
||||||
|
|
||||||
|
- name: Delete the organization
|
||||||
|
tower_organization:
|
||||||
|
name: "{{ org_name }}"
|
||||||
|
state: absent
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- result is changed
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
---
|
---
|
||||||
|
- name: Generate names
|
||||||
|
set_fact:
|
||||||
|
username: "AWX-Collection-tests-tower_role-user-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
|
||||||
- name: Create a User
|
- name: Create a User
|
||||||
tower_user:
|
tower_user:
|
||||||
first_name: Joe
|
first_name: Joe
|
||||||
last_name: User
|
last_name: User
|
||||||
username: joe
|
username: "{{ username }}"
|
||||||
password: "{{ 65535 | random | to_uuid }}"
|
password: "{{ 65535 | random | to_uuid }}"
|
||||||
email: joe@example.org
|
email: joe@example.org
|
||||||
state: present
|
state: present
|
||||||
@@ -15,7 +19,7 @@
|
|||||||
|
|
||||||
- name: Add Joe to the update role of the default Project
|
- name: Add Joe to the update role of the default Project
|
||||||
tower_role:
|
tower_role:
|
||||||
user: joe
|
user: "{{ username }}"
|
||||||
role: update
|
role: update
|
||||||
project: Demo Project
|
project: Demo Project
|
||||||
state: "{{ item }}"
|
state: "{{ item }}"
|
||||||
@@ -48,7 +52,7 @@
|
|||||||
|
|
||||||
- name: Delete a User
|
- name: Delete a User
|
||||||
tower_user:
|
tower_user:
|
||||||
username: joe
|
username: "{{ username }}"
|
||||||
email: joe@example.org
|
email: joe@example.org
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
---
|
---
|
||||||
|
- name: Generate names
|
||||||
|
set_fact:
|
||||||
|
team_name: "AWX-Collection-tests-tower_team-team-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
|
||||||
- name: Attempt to add a Tower team to a non-existant Organization
|
- name: Attempt to add a Tower team to a non-existant Organization
|
||||||
tower_team:
|
tower_team:
|
||||||
name: Test Team
|
name: Test Team
|
||||||
@@ -16,7 +20,7 @@
|
|||||||
|
|
||||||
- name: Create a Tower team
|
- name: Create a Tower team
|
||||||
tower_team:
|
tower_team:
|
||||||
name: Test Team
|
name: "{{ team_name }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
@@ -26,7 +30,7 @@
|
|||||||
|
|
||||||
- name: Delete a Tower team
|
- name: Delete a Tower team
|
||||||
tower_team:
|
tower_team:
|
||||||
name: Test Team
|
name: "{{ team_name }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
@@ -37,7 +41,7 @@
|
|||||||
|
|
||||||
- name: Check module fails with correct msg
|
- name: Check module fails with correct msg
|
||||||
tower_team:
|
tower_team:
|
||||||
name: Test Team
|
name: "{{ team_name }}"
|
||||||
organization: Non Existing Org
|
organization: Non Existing Org
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
---
|
---
|
||||||
|
- name: Generate names
|
||||||
|
set_fact:
|
||||||
|
username: "AWX-Collection-tests-tower_user-user-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
|
||||||
- name: Create a User
|
- name: Create a User
|
||||||
tower_user:
|
tower_user:
|
||||||
username: joe
|
username: "{{ username }}"
|
||||||
first_name: Joe
|
first_name: Joe
|
||||||
password: "{{ 65535 | random | to_uuid }}"
|
password: "{{ 65535 | random | to_uuid }}"
|
||||||
state: present
|
state: present
|
||||||
@@ -13,7 +17,7 @@
|
|||||||
|
|
||||||
- name: Change a User
|
- name: Change a User
|
||||||
tower_user:
|
tower_user:
|
||||||
username: joe
|
username: "{{ username }}"
|
||||||
last_name: User
|
last_name: User
|
||||||
email: joe@example.org
|
email: joe@example.org
|
||||||
state: present
|
state: present
|
||||||
@@ -25,7 +29,7 @@
|
|||||||
|
|
||||||
- name: Check idempotency
|
- name: Check idempotency
|
||||||
tower_user:
|
tower_user:
|
||||||
username: joe
|
username: "{{ username }}"
|
||||||
first_name: Joe
|
first_name: Joe
|
||||||
last_name: User
|
last_name: User
|
||||||
register: result
|
register: result
|
||||||
@@ -36,7 +40,7 @@
|
|||||||
|
|
||||||
- name: Delete a User
|
- name: Delete a User
|
||||||
tower_user:
|
tower_user:
|
||||||
username: joe
|
username: "{{ username }}"
|
||||||
email: joe@example.org
|
email: joe@example.org
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
@@ -49,7 +53,7 @@
|
|||||||
tower_user:
|
tower_user:
|
||||||
first_name: Joe
|
first_name: Joe
|
||||||
last_name: Auditor
|
last_name: Auditor
|
||||||
username: joe
|
username: "{{ username }}"
|
||||||
password: "{{ 65535 | random | to_uuid }}"
|
password: "{{ 65535 | random | to_uuid }}"
|
||||||
email: joe@example.org
|
email: joe@example.org
|
||||||
state: present
|
state: present
|
||||||
@@ -62,7 +66,7 @@
|
|||||||
|
|
||||||
- name: Delete an Auditor
|
- name: Delete an Auditor
|
||||||
tower_user:
|
tower_user:
|
||||||
username: joe
|
username: "{{ username }}"
|
||||||
email: joe@example.org
|
email: joe@example.org
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
@@ -75,7 +79,7 @@
|
|||||||
tower_user:
|
tower_user:
|
||||||
first_name: Joe
|
first_name: Joe
|
||||||
last_name: Super
|
last_name: Super
|
||||||
username: joe
|
username: "{{ username }}"
|
||||||
password: "{{ 65535 | random | to_uuid }}"
|
password: "{{ 65535 | random | to_uuid }}"
|
||||||
email: joe@example.org
|
email: joe@example.org
|
||||||
state: present
|
state: present
|
||||||
@@ -88,7 +92,7 @@
|
|||||||
|
|
||||||
- name: Delete a Superuser
|
- name: Delete a Superuser
|
||||||
tower_user:
|
tower_user:
|
||||||
username: joe
|
username: "{{ username }}"
|
||||||
email: joe@example.org
|
email: joe@example.org
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
@@ -101,7 +105,7 @@
|
|||||||
tower_user:
|
tower_user:
|
||||||
first_name: Joe
|
first_name: Joe
|
||||||
last_name: User
|
last_name: User
|
||||||
username: joe
|
username: "{{ username }}"
|
||||||
password: "{{ 65535 | random | to_uuid }}"
|
password: "{{ 65535 | random | to_uuid }}"
|
||||||
email: joe@example.org
|
email: joe@example.org
|
||||||
state: present
|
state: present
|
||||||
|
|||||||
@@ -1,44 +1,71 @@
|
|||||||
---
|
---
|
||||||
|
- name: Generate names
|
||||||
|
set_fact:
|
||||||
|
scm_cred_name: "AWX-Collection-tests-tower_workflow_template-scm-cred-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
demo_project_name: "AWX-Collection-tests-tower_workflow_template-proj-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
jt1_name: "AWX-Collection-tests-tower_workflow_template-jt1-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
jt2_name: "AWX-Collection-tests-tower_workflow_template-jt2-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
wfjt_name: "AWX-Collection-tests-tower_workflow_template-wfjt-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
|
||||||
- name: Create an SCM Credential
|
- name: Create an SCM Credential
|
||||||
tower_credential:
|
tower_credential:
|
||||||
name: SCM Credential for JT
|
name: "{{ scm_cred_name }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
kind: scm
|
kind: scm
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- "result is changed"
|
||||||
|
|
||||||
- name: Create a Demo Project
|
- name: Create a Demo Project
|
||||||
tower_project:
|
tower_project:
|
||||||
name: Job Template Test Project
|
name: "{{ demo_project_name }}"
|
||||||
organization: Default
|
organization: Default
|
||||||
state: present
|
state: present
|
||||||
scm_type: git
|
scm_type: git
|
||||||
scm_url: https://github.com/ansible/ansible-tower-samples.git
|
scm_url: https://github.com/ansible/ansible-tower-samples.git
|
||||||
scm_credential: SCM Credential for JT
|
scm_credential: "{{ scm_cred_name }}"
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- "result is changed"
|
||||||
|
|
||||||
- name: Create a Job Template
|
- name: Create a Job Template
|
||||||
tower_job_template:
|
tower_job_template:
|
||||||
name: my-job-1
|
name: "{{ jt1_name }}"
|
||||||
project: Job Template Test Project
|
project: "{{ demo_project_name }}"
|
||||||
inventory: Demo Inventory
|
inventory: Demo Inventory
|
||||||
playbook: hello_world.yml
|
playbook: hello_world.yml
|
||||||
credential: Demo Credential
|
credential: Demo Credential
|
||||||
job_type: run
|
job_type: run
|
||||||
state: present
|
state: present
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- "result is changed"
|
||||||
|
|
||||||
- name: Create a second Job Template
|
- name: Create a second Job Template
|
||||||
tower_job_template:
|
tower_job_template:
|
||||||
name: my-job-2
|
name: "{{ jt2_name }}"
|
||||||
project: Job Template Test Project
|
project: "{{ demo_project_name }}"
|
||||||
inventory: Demo Inventory
|
inventory: Demo Inventory
|
||||||
playbook: hello_world.yml
|
playbook: hello_world.yml
|
||||||
credential: Demo Credential
|
credential: Demo Credential
|
||||||
job_type: run
|
job_type: run
|
||||||
state: present
|
state: present
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- "result is changed"
|
||||||
|
|
||||||
- name: Add a Survey to second Job Template
|
- name: Add a Survey to second Job Template
|
||||||
tower_job_template:
|
tower_job_template:
|
||||||
name: my-job-2
|
name: "{{ jt2_name }}"
|
||||||
project: Job Template Test Project
|
project: "{{ demo_project_name }}"
|
||||||
inventory: Demo Inventory
|
inventory: Demo Inventory
|
||||||
playbook: hello_world.yml
|
playbook: hello_world.yml
|
||||||
credential: Demo Credential
|
credential: Demo Credential
|
||||||
@@ -46,11 +73,15 @@
|
|||||||
state: present
|
state: present
|
||||||
survey_enabled: true
|
survey_enabled: true
|
||||||
survey_spec: '{"spec": [{"index": 0, "question_name": "my question?", "default": "mydef", "variable": "myvar", "type": "text", "required": false}], "description": "test", "name": "test"}'
|
survey_spec: '{"spec": [{"index": 0, "question_name": "my question?", "default": "mydef", "variable": "myvar", "type": "text", "required": false}], "description": "test", "name": "test"}'
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- "result is changed"
|
||||||
|
|
||||||
- name: Create a workflow job template
|
- name: Create a workflow job template
|
||||||
tower_workflow_template:
|
tower_workflow_template:
|
||||||
name: my-workflow
|
name: "{{ wfjt_name }}"
|
||||||
schema: [{"success": [{"job_template": "my-job-1"}], "job_template": "my-job-2"}]
|
schema: [{"success": [{"job_template": "my-job-1"}], "job_template": "my-job-2"}]
|
||||||
extra_vars: {'foo': 'bar', 'another-foo': {'barz': 'bar2'}}
|
extra_vars: {'foo': 'bar', 'another-foo': {'barz': 'bar2'}}
|
||||||
register: result
|
register: result
|
||||||
@@ -61,7 +92,7 @@
|
|||||||
|
|
||||||
- name: Delete a workflow job template
|
- name: Delete a workflow job template
|
||||||
tower_workflow_template:
|
tower_workflow_template:
|
||||||
name: my-workflow
|
name: "{{ wfjt_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
@@ -71,7 +102,7 @@
|
|||||||
|
|
||||||
- name: Check module fails with correct msg
|
- name: Check module fails with correct msg
|
||||||
tower_workflow_template:
|
tower_workflow_template:
|
||||||
name: my-workflow
|
name: "{{ wfjt_name }}"
|
||||||
organization: Non Existing Organization
|
organization: Non Existing Organization
|
||||||
schema: [{"success": [{"job_template": "my-job-1"}], "job_template": "my-job-2"}]
|
schema: [{"success": [{"job_template": "my-job-1"}], "job_template": "my-job-2"}]
|
||||||
register: result
|
register: result
|
||||||
@@ -80,3 +111,59 @@
|
|||||||
- assert:
|
- assert:
|
||||||
that:
|
that:
|
||||||
- "result.msg =='Failed to update organization source,organization not found: The requested object could not be found.'"
|
- "result.msg =='Failed to update organization source,organization not found: The requested object could not be found.'"
|
||||||
|
|
||||||
|
- name: Delete the Job Template
|
||||||
|
tower_job_template:
|
||||||
|
name: "{{ jt1_name }}"
|
||||||
|
project: "{{ demo_project_name }}"
|
||||||
|
inventory: Demo Inventory
|
||||||
|
playbook: hello_world.yml
|
||||||
|
credential: Demo Credential
|
||||||
|
job_type: run
|
||||||
|
state: absent
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- "result is changed"
|
||||||
|
|
||||||
|
- name: Delete the second Job Template
|
||||||
|
tower_job_template:
|
||||||
|
name: "{{ jt2_name }}"
|
||||||
|
project: "{{ demo_project_name }}"
|
||||||
|
inventory: Demo Inventory
|
||||||
|
playbook: hello_world.yml
|
||||||
|
credential: Demo Credential
|
||||||
|
job_type: run
|
||||||
|
state: absent
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- "result is changed"
|
||||||
|
|
||||||
|
- name: Delete the Demo Project
|
||||||
|
tower_project:
|
||||||
|
name: "{{ demo_project_name }}"
|
||||||
|
organization: Default
|
||||||
|
scm_type: git
|
||||||
|
scm_url: https://github.com/ansible/ansible-tower-samples.git
|
||||||
|
scm_credential: "{{ scm_cred_name }}"
|
||||||
|
state: absent
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- "result is changed"
|
||||||
|
|
||||||
|
- name: Delete the SCM Credential
|
||||||
|
tower_credential:
|
||||||
|
name: "{{ scm_cred_name }}"
|
||||||
|
organization: Default
|
||||||
|
kind: scm
|
||||||
|
state: absent
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- "result is changed"
|
||||||
|
|||||||
Reference in New Issue
Block a user