mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 18:09:57 -03:30
regex replace tower_*: to ''
This commit is contained in:
parent
44fed1d7c1
commit
a695274cb6
@ -11,24 +11,24 @@
|
||||
org_name: "AWX-Collection-tests-tower_tower_ad_hoc_command-org-{{ test_id }}"
|
||||
|
||||
- name: Create a New Organization
|
||||
tower_organization:
|
||||
organization:
|
||||
name: "{{ org_name }}"
|
||||
|
||||
- name: Create an Inventory
|
||||
tower_inventory:
|
||||
inventory:
|
||||
name: "{{ inv_name }}"
|
||||
organization: "{{ org_name }}"
|
||||
state: present
|
||||
|
||||
- name: Add localhost to the Inventory
|
||||
tower_host:
|
||||
host:
|
||||
name: localhost
|
||||
inventory: "{{ inv_name }}"
|
||||
variables:
|
||||
ansible_connection: local
|
||||
|
||||
- name: Create a Credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ ssh_cred_name }}"
|
||||
organization: "{{ org_name }}"
|
||||
credential_type: 'Machine'
|
||||
@ -76,19 +76,19 @@
|
||||
- "'Does not exist' in result.response['json']['module_name'][0]"
|
||||
|
||||
- name: Delete the Credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ ssh_cred_name }}"
|
||||
organization: "{{ org_name }}"
|
||||
credential_type: 'Machine'
|
||||
state: absent
|
||||
|
||||
- name: Delete the Inventory
|
||||
tower_inventory:
|
||||
inventory:
|
||||
name: "{{ inv_name }}"
|
||||
organization: "{{ org_name }}"
|
||||
state: absent
|
||||
|
||||
- name: Remove the Organization
|
||||
tower_organization:
|
||||
organization:
|
||||
name: "{{ org_name }}"
|
||||
state: absent
|
||||
|
||||
@ -11,24 +11,24 @@
|
||||
org_name: "AWX-Collection-tests-tower_tower_ad_hoc_command_cancel-org-{{ test_id }}"
|
||||
|
||||
- name: Create a New Organization
|
||||
tower_organization:
|
||||
organization:
|
||||
name: "{{ org_name }}"
|
||||
|
||||
- name: Create an Inventory
|
||||
tower_inventory:
|
||||
inventory:
|
||||
name: "{{ inv_name }}"
|
||||
organization: "{{ org_name }}"
|
||||
state: present
|
||||
|
||||
- name: Add localhost to the Inventory
|
||||
tower_host:
|
||||
host:
|
||||
name: localhost
|
||||
inventory: "{{ inv_name }}"
|
||||
variables:
|
||||
ansible_connection: local
|
||||
|
||||
- name: Create a Credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ ssh_cred_name }}"
|
||||
organization: "{{ org_name }}"
|
||||
credential_type: 'Machine'
|
||||
@ -91,19 +91,19 @@
|
||||
- "result.msg == 'Unable to find command with id 9999999999'"
|
||||
|
||||
- name: Delete the Credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ ssh_cred_name }}"
|
||||
organization: "{{ org_name }}"
|
||||
credential_type: 'Machine'
|
||||
state: absent
|
||||
|
||||
- name: Delete the Inventory
|
||||
tower_inventory:
|
||||
inventory:
|
||||
name: "{{ inv_name }}"
|
||||
organization: "{{ org_name }}"
|
||||
state: absent
|
||||
|
||||
- name: Remove the Organization
|
||||
tower_organization:
|
||||
organization:
|
||||
name: "{{ org_name }}"
|
||||
state: absent
|
||||
|
||||
@ -11,24 +11,24 @@
|
||||
org_name: "AWX-Collection-tests-tower_ad_hoc_command_wait-org-{{ test_id }}"
|
||||
|
||||
- name: Create a New Organization
|
||||
tower_organization:
|
||||
organization:
|
||||
name: "{{ org_name }}"
|
||||
|
||||
- name: Create an Inventory
|
||||
tower_inventory:
|
||||
inventory:
|
||||
name: "{{ inv_name }}"
|
||||
organization: "{{ org_name }}"
|
||||
state: present
|
||||
|
||||
- name: Add localhost to the Inventory
|
||||
tower_host:
|
||||
host:
|
||||
name: localhost
|
||||
inventory: "{{ inv_name }}"
|
||||
variables:
|
||||
ansible_connection: local
|
||||
|
||||
- name: Create a Credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ ssh_cred_name }}"
|
||||
organization: "{{ org_name }}"
|
||||
credential_type: 'Machine'
|
||||
@ -113,19 +113,19 @@
|
||||
- "wait_results.msg == 'The ad hoc command - {{ command.id }}, failed'"
|
||||
|
||||
- name: Delete the Credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ ssh_cred_name }}"
|
||||
organization: "{{ org_name }}"
|
||||
credential_type: 'Machine'
|
||||
state: absent
|
||||
|
||||
- name: Delete the Inventory
|
||||
tower_inventory:
|
||||
inventory:
|
||||
name: "{{ inv_name }}"
|
||||
organization: "{{ org_name }}"
|
||||
state: absent
|
||||
|
||||
- name: Remove the Organization
|
||||
tower_organization:
|
||||
organization:
|
||||
name: "{{ org_name }}"
|
||||
state: absent
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
|
||||
- block:
|
||||
- name: Create an application
|
||||
tower_application:
|
||||
application:
|
||||
name: "{{ app1_name }}"
|
||||
authorization_grant_type: "password"
|
||||
client_type: "public"
|
||||
@ -24,7 +24,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Delete our application
|
||||
tower_application:
|
||||
application:
|
||||
name: "{{ app1_name }}"
|
||||
organization: "Default"
|
||||
state: absent
|
||||
@ -35,7 +35,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Create a second application
|
||||
tower_application:
|
||||
application:
|
||||
name: "{{ app2_name }}"
|
||||
authorization_grant_type: "authorization-code"
|
||||
client_type: "confidential"
|
||||
@ -52,7 +52,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Create an all trusting application
|
||||
tower_application:
|
||||
application:
|
||||
name: "{{ app3_name }}"
|
||||
organization: "Default"
|
||||
description: "All Trusting Application"
|
||||
@ -68,7 +68,7 @@
|
||||
|
||||
always:
|
||||
- name: Delete our application
|
||||
tower_application:
|
||||
application:
|
||||
name: "{{ item }}"
|
||||
organization: "Default"
|
||||
state: absent
|
||||
|
||||
@ -36,7 +36,7 @@
|
||||
ssh_key_data: "{{ lookup('file', tempdir.stdout + '/id_rsa') }}"
|
||||
|
||||
- name: Test deprecation warnings
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ ssh_cred_name1 }}"
|
||||
organization: Default
|
||||
kind: ssh
|
||||
@ -70,7 +70,7 @@
|
||||
- result['deprecations'] | length() == 20
|
||||
|
||||
- name: Create an Org-specific credential (old school)
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ ssh_cred_name1 }}"
|
||||
organization: Default
|
||||
state: present
|
||||
@ -82,7 +82,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Re-create the Org-specific credential (new school) with an ID
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ result.id }}"
|
||||
organization: Default
|
||||
credential_type: 'Machine'
|
||||
@ -94,7 +94,7 @@
|
||||
- "result is not changed"
|
||||
|
||||
- name: Delete a Org-specific credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ ssh_cred_name1 }}"
|
||||
organization: Default
|
||||
state: absent
|
||||
@ -106,7 +106,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Create the User-specific credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ ssh_cred_name1 }}"
|
||||
user: admin
|
||||
credential_type: 'Machine'
|
||||
@ -118,7 +118,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Delete a User-specific credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ ssh_cred_name1 }}"
|
||||
user: admin
|
||||
state: absent
|
||||
@ -130,7 +130,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Create a valid SSH credential (old school)
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ ssh_cred_name2 }}"
|
||||
organization: Default
|
||||
state: present
|
||||
@ -150,7 +150,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Create a valid SSH credential (new school)
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ ssh_cred_name2 }}"
|
||||
organization: Default
|
||||
state: present
|
||||
@ -173,7 +173,7 @@
|
||||
- result is changed
|
||||
|
||||
- name: Create a valid SSH credential (new school)
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ ssh_cred_name2 }}"
|
||||
organization: Default
|
||||
state: present
|
||||
@ -191,7 +191,7 @@
|
||||
- result is changed
|
||||
|
||||
- name: Check for inputs idempotency (when "inputs" is blank)
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ ssh_cred_name2 }}"
|
||||
organization: Default
|
||||
state: present
|
||||
@ -204,7 +204,7 @@
|
||||
- result is not changed
|
||||
|
||||
- name: Copy ssh Credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "copy_{{ ssh_cred_name2 }}"
|
||||
copy_from: "{{ ssh_cred_name2 }}"
|
||||
credential_type: Machine
|
||||
@ -215,7 +215,7 @@
|
||||
- result.copied
|
||||
|
||||
- name: Delete an SSH credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "copy_{{ ssh_cred_name2 }}"
|
||||
organization: Default
|
||||
state: absent
|
||||
@ -227,7 +227,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Create a valid SSH credential from lookup source (old school)
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ ssh_cred_name3 }}"
|
||||
organization: Default
|
||||
state: present
|
||||
@ -247,7 +247,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Create a valid SSH credential from lookup source (new school)
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ ssh_cred_name3 }}"
|
||||
organization: Default
|
||||
state: present
|
||||
@ -269,7 +269,7 @@
|
||||
- result is changed
|
||||
|
||||
- name: Fail to create an SSH credential from a file source (old school format)
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ ssh_cred_name4 }}"
|
||||
organization: Default
|
||||
state: present
|
||||
@ -292,7 +292,7 @@
|
||||
- "'Invalid certificate or key' in result.msg"
|
||||
|
||||
- name: Create an invalid SSH credential (passphrase required)
|
||||
tower_credential:
|
||||
credential:
|
||||
name: SSH Credential
|
||||
organization: Default
|
||||
state: present
|
||||
@ -308,7 +308,7 @@
|
||||
- "'must be set when SSH key is encrypted' in result.msg"
|
||||
|
||||
- name: Create an invalid SSH credential (Organization not found)
|
||||
tower_credential:
|
||||
credential:
|
||||
name: SSH Credential
|
||||
organization: Missing_Organization
|
||||
state: present
|
||||
@ -325,7 +325,7 @@
|
||||
- "result.total_results == 0"
|
||||
|
||||
- name: Delete an SSH credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ ssh_cred_name2 }}"
|
||||
organization: Default
|
||||
state: absent
|
||||
@ -337,7 +337,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Delete an SSH credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ ssh_cred_name3 }}"
|
||||
organization: Default
|
||||
state: absent
|
||||
@ -349,7 +349,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Delete an SSH credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ ssh_cred_name4 }}"
|
||||
organization: Default
|
||||
state: absent
|
||||
@ -362,7 +362,7 @@
|
||||
- "result is not changed"
|
||||
|
||||
- name: Create a valid Vault credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ vault_cred_name1 }}"
|
||||
organization: Default
|
||||
state: present
|
||||
@ -376,7 +376,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Delete a Vault credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ vault_cred_name1 }}"
|
||||
organization: Default
|
||||
state: absent
|
||||
@ -388,7 +388,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Delete a Vault credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ vault_cred_name2 }}"
|
||||
organization: Default
|
||||
state: absent
|
||||
@ -401,7 +401,7 @@
|
||||
- "result is not changed"
|
||||
|
||||
- name: Create a valid Network credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ net_cred_name1 }}"
|
||||
organization: Default
|
||||
state: present
|
||||
@ -417,7 +417,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Delete a Network credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ net_cred_name1 }}"
|
||||
organization: Default
|
||||
state: absent
|
||||
@ -429,7 +429,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Create a valid SCM credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ scm_cred_name1 }}"
|
||||
organization: Default
|
||||
state: present
|
||||
@ -445,7 +445,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Delete an SCM credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ scm_cred_name1 }}"
|
||||
organization: Default
|
||||
state: absent
|
||||
@ -457,7 +457,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Create a valid AWS credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ aws_cred_name1 }}"
|
||||
organization: Default
|
||||
state: present
|
||||
@ -472,7 +472,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Delete an AWS credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ aws_cred_name1 }}"
|
||||
organization: Default
|
||||
state: absent
|
||||
@ -484,7 +484,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Create a valid VMWare credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ vmware_cred_name1 }}"
|
||||
organization: Default
|
||||
state: present
|
||||
@ -499,7 +499,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Delete an VMWare credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ vmware_cred_name1 }}"
|
||||
organization: Default
|
||||
state: absent
|
||||
@ -511,7 +511,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Create a valid Satellite6 credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ sat6_cred_name1 }}"
|
||||
organization: Default
|
||||
state: present
|
||||
@ -526,7 +526,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Delete a Satellite6 credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ sat6_cred_name1 }}"
|
||||
organization: Default
|
||||
state: absent
|
||||
@ -538,7 +538,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Create a valid GCE credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ gce_cred_name1 }}"
|
||||
organization: Default
|
||||
state: present
|
||||
@ -553,7 +553,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Delete a GCE credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ gce_cred_name1 }}"
|
||||
organization: Default
|
||||
state: absent
|
||||
@ -565,7 +565,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Create a valid AzureRM credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ azurerm_cred_name1 }}"
|
||||
organization: Default
|
||||
state: present
|
||||
@ -580,7 +580,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Create a valid AzureRM credential with a tenant
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ azurerm_cred_name1 }}"
|
||||
organization: Default
|
||||
state: present
|
||||
@ -596,7 +596,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Delete an AzureRM credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ azurerm_cred_name1 }}"
|
||||
organization: Default
|
||||
state: absent
|
||||
@ -608,7 +608,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Create a valid OpenStack credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ openstack_cred_name1 }}"
|
||||
organization: Default
|
||||
state: present
|
||||
@ -625,7 +625,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Delete a OpenStack credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ openstack_cred_name1 }}"
|
||||
organization: Default
|
||||
state: absent
|
||||
@ -637,7 +637,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Create a valid RHV credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ rhv_cred_name1 }}"
|
||||
organization: Default
|
||||
state: present
|
||||
@ -652,7 +652,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Delete an RHV credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ rhv_cred_name1 }}"
|
||||
organization: Default
|
||||
state: absent
|
||||
@ -664,7 +664,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Create a valid Insights credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ insights_cred_name1 }}"
|
||||
organization: Default
|
||||
state: present
|
||||
@ -678,7 +678,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Delete an Insights credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ insights_cred_name1 }}"
|
||||
organization: Default
|
||||
state: absent
|
||||
@ -690,7 +690,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Create a valid Tower-to-Tower credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ tower_cred_name1 }}"
|
||||
organization: Default
|
||||
state: present
|
||||
@ -705,7 +705,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Delete a Tower-to-Tower credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ tower_cred_name1 }}"
|
||||
organization: Default
|
||||
state: absent
|
||||
@ -717,7 +717,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Check module fails with correct msg
|
||||
tower_credential:
|
||||
credential:
|
||||
name: test-credential
|
||||
description: Credential Description
|
||||
kind: ssh
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
|
||||
- block:
|
||||
- name: Add Tower credential Lookup
|
||||
tower_credential:
|
||||
credential:
|
||||
description: Credential for Testing Source
|
||||
name: "{{ src_cred_name }}"
|
||||
credential_type: CyberArk AIM Central Credential Provider Lookup
|
||||
@ -26,7 +26,7 @@
|
||||
- "src_cred_result is changed"
|
||||
|
||||
- name: Add Tower credential Target
|
||||
tower_credential:
|
||||
credential:
|
||||
description: Credential for Testing Target
|
||||
name: "{{ target_cred_name }}"
|
||||
credential_type: Machine
|
||||
@ -55,7 +55,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Add Second Tower credential Lookup
|
||||
tower_credential:
|
||||
credential:
|
||||
description: Credential for Testing Source Change
|
||||
name: "{{ src_cred_name }}-2"
|
||||
credential_type: CyberArk AIM Central Credential Provider Lookup
|
||||
@ -89,7 +89,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Remove Tower credential Lookup
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ src_cred_name }}"
|
||||
organization: Default
|
||||
credential_type: CyberArk AIM Central Credential Provider Lookup
|
||||
@ -97,7 +97,7 @@
|
||||
register: result
|
||||
|
||||
- name: Remove Alt Tower credential Lookup
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ src_cred_name }}-2"
|
||||
organization: Default
|
||||
credential_type: CyberArk AIM Central Credential Provider Lookup
|
||||
@ -105,7 +105,7 @@
|
||||
register: result
|
||||
|
||||
- name: Remove Tower credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ target_cred_name }}"
|
||||
organization: Default
|
||||
credential_type: Machine
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
---
|
||||
- name: Assure that default organization exists
|
||||
tower_organization:
|
||||
organization:
|
||||
name: Default
|
||||
|
||||
- name: HACK - delete orphaned projects from preload data where organization deletd
|
||||
tower_project:
|
||||
project:
|
||||
name: "{{ item['id'] }}"
|
||||
scm_type: git
|
||||
state: absent
|
||||
@ -16,7 +16,7 @@
|
||||
label: "Deleting Demo Project with null organization id={{ item['id'] }}"
|
||||
|
||||
- name: Assure that demo project exists
|
||||
tower_project:
|
||||
project:
|
||||
name: "Demo Project"
|
||||
scm_type: 'git'
|
||||
scm_url: 'https://github.com/ansible/ansible-tower-samples'
|
||||
@ -24,12 +24,12 @@
|
||||
organization: Default
|
||||
|
||||
- name: Assure that demo inventory exists
|
||||
tower_inventory:
|
||||
inventory:
|
||||
name: "Demo Inventory"
|
||||
organization: Default
|
||||
|
||||
- name: Create a Host
|
||||
tower_host:
|
||||
host:
|
||||
name: "localhost"
|
||||
inventory: "Demo Inventory"
|
||||
state: present
|
||||
|
||||
@ -12,19 +12,19 @@
|
||||
|
||||
- block:
|
||||
- name: Create some organizations
|
||||
tower_organization:
|
||||
organization:
|
||||
name: "{{ item }}"
|
||||
loop:
|
||||
- "{{ org_name1 }}"
|
||||
- "{{ org_name2 }}"
|
||||
|
||||
- name: Create an inventory
|
||||
tower_inventory:
|
||||
inventory:
|
||||
name: "{{ inventory_name1 }}"
|
||||
organization: "{{ org_name1 }}"
|
||||
|
||||
- name: Export all tower assets
|
||||
tower_export:
|
||||
export:
|
||||
all: true
|
||||
register: all_assets
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
- all_assets['assets']['organizations'] | length() >= 2
|
||||
|
||||
- name: Export all inventories
|
||||
tower_export:
|
||||
export:
|
||||
inventory: 'all'
|
||||
register: inventory_export
|
||||
|
||||
@ -48,7 +48,7 @@
|
||||
|
||||
# This mimics the example in the module
|
||||
- name: Export an all and a specific
|
||||
tower_export:
|
||||
export:
|
||||
inventory: 'all'
|
||||
organizations: "{{ org_name1 }}"
|
||||
register: mixed_export
|
||||
@ -63,13 +63,13 @@
|
||||
|
||||
always:
|
||||
- name: Remove our inventory
|
||||
tower_inventory:
|
||||
inventory:
|
||||
name: "{{ inventory_name1 }}"
|
||||
organization: "{{ org_name1 }}"
|
||||
state: absent
|
||||
|
||||
- name: Remove test organizations
|
||||
tower_organization:
|
||||
organization:
|
||||
name: "{{ item }}"
|
||||
state: absent
|
||||
loop:
|
||||
|
||||
@ -10,14 +10,14 @@
|
||||
host_name3: "AWX-Collection-test-tower_group-host-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||
|
||||
- name: Create an Inventory
|
||||
tower_inventory:
|
||||
inventory:
|
||||
name: "{{ inv_name }}"
|
||||
organization: Default
|
||||
state: present
|
||||
register: result
|
||||
|
||||
- name: Create a Group
|
||||
tower_group:
|
||||
group:
|
||||
name: "{{ group_name1 }}"
|
||||
inventory: "{{ result.id }}"
|
||||
state: present
|
||||
@ -30,7 +30,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Create a Group
|
||||
tower_group:
|
||||
group:
|
||||
name: "{{ group_name2 }}"
|
||||
inventory: "{{ inv_name }}"
|
||||
state: present
|
||||
@ -43,7 +43,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Create a Group
|
||||
tower_group:
|
||||
group:
|
||||
name: "{{ group_name3 }}"
|
||||
inventory: "{{ inv_name }}"
|
||||
state: present
|
||||
@ -56,7 +56,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: add hosts
|
||||
tower_host:
|
||||
host:
|
||||
name: "{{ item }}"
|
||||
inventory: "{{ inv_name }}"
|
||||
loop:
|
||||
@ -65,7 +65,7 @@
|
||||
- "{{ host_name3 }}"
|
||||
|
||||
- name: Create a Group with hosts and sub group
|
||||
tower_group:
|
||||
group:
|
||||
name: "{{ group_name1 }}"
|
||||
inventory: "{{ inv_name }}"
|
||||
hosts:
|
||||
@ -79,7 +79,7 @@
|
||||
register: result
|
||||
|
||||
- name: Create a Group with hosts and sub group
|
||||
tower_group:
|
||||
group:
|
||||
name: "{{ group_name1 }}"
|
||||
inventory: "{{ inv_name }}"
|
||||
hosts:
|
||||
@ -100,7 +100,7 @@
|
||||
- group1_host_count == "3"
|
||||
|
||||
- name: Delete a Group
|
||||
tower_group:
|
||||
group:
|
||||
name: "{{ group_name1 }}"
|
||||
inventory: "{{ inv_name }}"
|
||||
state: absent
|
||||
@ -111,7 +111,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Delete a Group
|
||||
tower_group:
|
||||
group:
|
||||
name: "{{ group_name2 }}"
|
||||
inventory: "{{ inv_name }}"
|
||||
state: absent
|
||||
@ -122,7 +122,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Delete a Group
|
||||
tower_group:
|
||||
group:
|
||||
name: "{{ group_name3 }}"
|
||||
inventory: "{{ inv_name }}"
|
||||
state: absent
|
||||
@ -133,7 +133,7 @@
|
||||
- "result is not changed"
|
||||
|
||||
- name: Check module fails with correct msg
|
||||
tower_group:
|
||||
group:
|
||||
name: test-group
|
||||
description: Group Description
|
||||
inventory: test-non-existing-inventory
|
||||
@ -149,7 +149,7 @@
|
||||
- "result.total_results == 0"
|
||||
|
||||
- name: add hosts
|
||||
tower_host:
|
||||
host:
|
||||
name: "{{ item }}"
|
||||
inventory: "{{ inv_name }}"
|
||||
loop:
|
||||
@ -158,14 +158,14 @@
|
||||
- "{{ host_name3 }}"
|
||||
|
||||
- name: add mid level group
|
||||
tower_group:
|
||||
group:
|
||||
name: "{{ group_name2 }}"
|
||||
inventory: "{{ inv_name }}"
|
||||
hosts:
|
||||
- "{{ host_name3 }}"
|
||||
|
||||
- name: add top group
|
||||
tower_group:
|
||||
group:
|
||||
name: "{{ group_name3 }}"
|
||||
inventory: "{{ inv_name }}"
|
||||
hosts:
|
||||
@ -175,19 +175,19 @@
|
||||
- "{{ group_name2 }}"
|
||||
|
||||
- name: Delete the parent group
|
||||
tower_group:
|
||||
group:
|
||||
name: "{{ group_name3 }}"
|
||||
inventory: "{{ inv_name }}"
|
||||
state: absent
|
||||
|
||||
- name: Delete the child group
|
||||
tower_group:
|
||||
group:
|
||||
name: "{{ group_name2 }}"
|
||||
inventory: "{{ inv_name }}"
|
||||
state: absent
|
||||
|
||||
- name: Delete an Inventory
|
||||
tower_inventory:
|
||||
inventory:
|
||||
name: "{{ inv_name }}"
|
||||
organization: Default
|
||||
state: absent
|
||||
|
||||
@ -5,14 +5,14 @@
|
||||
inv_name: "AWX-Collection-tests-tower_host-inv-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||
|
||||
- name: Create an Inventory
|
||||
tower_inventory:
|
||||
inventory:
|
||||
name: "{{ inv_name }}"
|
||||
organization: Default
|
||||
state: present
|
||||
register: result
|
||||
|
||||
- name: Create a Host
|
||||
tower_host:
|
||||
host:
|
||||
name: "{{ host_name }}"
|
||||
inventory: "{{ result.id }}"
|
||||
state: present
|
||||
@ -25,7 +25,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Delete a Host
|
||||
tower_host:
|
||||
host:
|
||||
name: "{{ result.id }}"
|
||||
inventory: "{{ inv_name }}"
|
||||
state: absent
|
||||
@ -36,7 +36,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Check module fails with correct msg
|
||||
tower_host:
|
||||
host:
|
||||
name: test-host
|
||||
description: Host Description
|
||||
inventory: test-non-existing-inventory
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
|
||||
- block:
|
||||
- name: "Import something"
|
||||
tower_import:
|
||||
import:
|
||||
assets:
|
||||
organizations:
|
||||
- name: "{{ org_name1 }}"
|
||||
@ -33,7 +33,7 @@
|
||||
- import_output is changed
|
||||
|
||||
- name: "Import the same thing again"
|
||||
tower_import:
|
||||
import:
|
||||
assets:
|
||||
organizations:
|
||||
- name: "{{ org_name1 }}"
|
||||
@ -82,7 +82,7 @@
|
||||
dest: ./org.json
|
||||
|
||||
- name: "Load assets from a file"
|
||||
tower_import:
|
||||
import:
|
||||
assets: "{{ lookup('file', 'org.json') | from_json() }}"
|
||||
register: import_output
|
||||
|
||||
@ -92,7 +92,7 @@
|
||||
|
||||
always:
|
||||
- name: Remove organizations
|
||||
tower_organization:
|
||||
organization:
|
||||
name: "{{ item }}"
|
||||
state: absent
|
||||
loop:
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
|
||||
- block:
|
||||
- name: Create an OpenShift Credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ cred_name1 }}"
|
||||
organization: "Default"
|
||||
credential_type: "OpenShift or Kubernetes API Bearer Token"
|
||||
@ -70,7 +70,7 @@
|
||||
- "{{ group_name2 }}"
|
||||
|
||||
- name: Delete the credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ cred_name1 }}"
|
||||
organization: "Default"
|
||||
credential_type: "OpenShift or Kubernetes API Bearer Token"
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Create an Insights Credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ cred_name1 }}"
|
||||
organization: Default
|
||||
kind: insights
|
||||
@ -38,7 +38,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Create an Inventory
|
||||
tower_inventory:
|
||||
inventory:
|
||||
name: "{{ inv_name1 }}"
|
||||
organization: Default
|
||||
insights_credential: "{{ result.id }}"
|
||||
@ -52,7 +52,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Test Inventory module idempotency
|
||||
tower_inventory:
|
||||
inventory:
|
||||
name: "{{ result.id }}"
|
||||
organization: Default
|
||||
insights_credential: "{{ cred_name1 }}"
|
||||
@ -64,7 +64,7 @@
|
||||
- "result is not changed"
|
||||
|
||||
- name: Copy an inventory
|
||||
tower_inventory:
|
||||
inventory:
|
||||
name: "copy_{{ inv_name1 }}"
|
||||
copy_from: "{{ inv_name1 }}"
|
||||
organization: Default
|
||||
@ -77,7 +77,7 @@
|
||||
- result.copied
|
||||
|
||||
- name: Delete an Inventory
|
||||
tower_inventory:
|
||||
inventory:
|
||||
name: "copy_{{ inv_name1 }}"
|
||||
organization: Default
|
||||
state: absent
|
||||
@ -88,7 +88,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Fail Change Regular to Smart
|
||||
tower_inventory:
|
||||
inventory:
|
||||
name: "{{ inv_name1 }}"
|
||||
organization: Default
|
||||
kind: smart
|
||||
@ -100,7 +100,7 @@
|
||||
- "result is failed"
|
||||
|
||||
- name: Create a smart inventory
|
||||
tower_inventory:
|
||||
inventory:
|
||||
name: "{{ inv_name2 }}"
|
||||
organization: Default
|
||||
kind: smart
|
||||
@ -112,7 +112,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Delete a smart inventory
|
||||
tower_inventory:
|
||||
inventory:
|
||||
name: "{{ inv_name2 }}"
|
||||
organization: Default
|
||||
kind: smart
|
||||
@ -125,7 +125,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Delete an Inventory
|
||||
tower_inventory:
|
||||
inventory:
|
||||
name: "{{ inv_name1 }}"
|
||||
organization: Default
|
||||
state: absent
|
||||
@ -136,7 +136,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Delete a Non-Existent Inventory
|
||||
tower_inventory:
|
||||
inventory:
|
||||
name: "{{ inv_name1 }}"
|
||||
organization: Default
|
||||
state: absent
|
||||
@ -147,7 +147,7 @@
|
||||
- "result is not changed"
|
||||
|
||||
- name: Check module fails with correct msg
|
||||
tower_inventory:
|
||||
inventory:
|
||||
name: test-inventory
|
||||
description: Inventory Description
|
||||
organization: test-non-existing-org
|
||||
@ -164,7 +164,7 @@
|
||||
|
||||
always:
|
||||
- name: Delete Inventories
|
||||
tower_inventory:
|
||||
inventory:
|
||||
name: "{{ item }}"
|
||||
organization: Default
|
||||
state: absent
|
||||
@ -179,7 +179,7 @@
|
||||
state: absent
|
||||
|
||||
- name: Delete Insights Credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ cred_name1 }}"
|
||||
organization: "Default"
|
||||
kind: insights
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
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
|
||||
tower_credential:
|
||||
credential:
|
||||
description: Credentials for Openstack Test project
|
||||
name: "{{ openstack_cred }}"
|
||||
kind: openstack
|
||||
@ -19,7 +19,7 @@
|
||||
register: credential_result
|
||||
|
||||
- name: Add a Tower inventory
|
||||
tower_inventory:
|
||||
inventory:
|
||||
description: Test inventory
|
||||
organization: Default
|
||||
name: "{{ openstack_inv }}"
|
||||
@ -54,7 +54,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Delete the credential
|
||||
tower_credential:
|
||||
credential:
|
||||
description: Credentials for Openstack Test project
|
||||
name: "{{ openstack_cred }}"
|
||||
kind: openstack
|
||||
@ -71,7 +71,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Delete the inventory
|
||||
tower_inventory:
|
||||
inventory:
|
||||
description: Test inventory
|
||||
organization: Default
|
||||
name: "{{ openstack_inv }}"
|
||||
|
||||
@ -16,12 +16,12 @@
|
||||
- block:
|
||||
|
||||
- name: "Create a new organization"
|
||||
tower_organization:
|
||||
organization:
|
||||
name: "{{ org_name }}"
|
||||
register: created_org
|
||||
|
||||
- name: Create a git project without credentials
|
||||
tower_project:
|
||||
project:
|
||||
name: "{{ project_name }}"
|
||||
organization: "{{ org_name }}"
|
||||
scm_type: git
|
||||
@ -29,13 +29,13 @@
|
||||
wait: true
|
||||
|
||||
- name: Create an Inventory
|
||||
tower_inventory:
|
||||
inventory:
|
||||
name: "{{ inv_name }}"
|
||||
organization: "{{ org_name }}"
|
||||
state: present
|
||||
|
||||
- name: Create another inventory w/ same name, different org
|
||||
tower_inventory:
|
||||
inventory:
|
||||
name: "{{ inv_name }}"
|
||||
organization: Default
|
||||
state: present
|
||||
@ -114,18 +114,18 @@
|
||||
|
||||
always:
|
||||
- name: Delete Inventory
|
||||
tower_inventory:
|
||||
inventory:
|
||||
name: "{{ inv_name }}"
|
||||
organization: Default
|
||||
state: absent
|
||||
|
||||
- name: Delete Project
|
||||
tower_project:
|
||||
project:
|
||||
name: "{{ project_name }}"
|
||||
organization: Default
|
||||
state: absent
|
||||
|
||||
- name: "Remove the organization"
|
||||
tower_organization:
|
||||
organization:
|
||||
name: "{{ org_name }}"
|
||||
state: absent
|
||||
|
||||
@ -70,7 +70,7 @@
|
||||
- "result.status == 'pending'"
|
||||
|
||||
- name: Create a project for testing extra_vars
|
||||
tower_project:
|
||||
project:
|
||||
name: "{{ proj_name }}"
|
||||
organization: Default
|
||||
scm_type: git
|
||||
@ -216,7 +216,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Delete the extra_vars project
|
||||
tower_project:
|
||||
project:
|
||||
name: "{{ proj_name }}"
|
||||
organization: Default
|
||||
state: absent
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
register: result
|
||||
|
||||
- name: Create a Demo Project
|
||||
tower_project:
|
||||
project:
|
||||
name: "{{ proj1 }}"
|
||||
organization: Default
|
||||
state: present
|
||||
@ -34,20 +34,20 @@
|
||||
register: proj_result
|
||||
|
||||
- name: Create Credential1
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ cred1 }}"
|
||||
organization: Default
|
||||
kind: tower
|
||||
register: cred1_result
|
||||
|
||||
- name: Create Credential2
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ cred2 }}"
|
||||
organization: Default
|
||||
kind: ssh
|
||||
|
||||
- name: Create Credential3
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ cred3 }}"
|
||||
organization: Default
|
||||
kind: ssh
|
||||
@ -374,7 +374,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Delete the Demo Project
|
||||
tower_project:
|
||||
project:
|
||||
name: "{{ proj1 }}"
|
||||
organization: Default
|
||||
state: absent
|
||||
@ -383,21 +383,21 @@
|
||||
register: result
|
||||
|
||||
- name: Delete Credential1
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ cred1 }}"
|
||||
organization: Default
|
||||
kind: tower
|
||||
state: absent
|
||||
|
||||
- name: Delete Credential2
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ cred2 }}"
|
||||
organization: Default
|
||||
kind: ssh
|
||||
state: absent
|
||||
|
||||
- name: Delete Credential3
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ cred3 }}"
|
||||
organization: Default
|
||||
kind: ssh
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
proj_name: "AWX-Collection-tests-tower_job_wait-long_running-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||
|
||||
- name: Assure that the demo project exists
|
||||
tower_project:
|
||||
project:
|
||||
name: "{{ proj_name }}"
|
||||
scm_type: 'git'
|
||||
scm_url: 'https://github.com/ansible/test-playbooks.git'
|
||||
@ -131,7 +131,7 @@
|
||||
state: absent
|
||||
|
||||
- name: Delete the project
|
||||
tower_project:
|
||||
project:
|
||||
name: "{{ proj_name }}"
|
||||
organization: Default
|
||||
state: absent
|
||||
|
||||
@ -4,13 +4,13 @@
|
||||
label_name: "AWX-Collection-tests-tower_label-label-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||
|
||||
- name: Create a Label
|
||||
tower_label:
|
||||
label:
|
||||
name: "{{ label_name }}"
|
||||
organization: Default
|
||||
state: present
|
||||
|
||||
- name: Check module fails with correct msg
|
||||
tower_label:
|
||||
label:
|
||||
name: "Test Label"
|
||||
organization: "Non_existing_org"
|
||||
state: present
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
group_name: "AWX-Collection-tests-tower_api_lookup-group1-{{ test_id }}"
|
||||
|
||||
- name: Get our collection package
|
||||
tower_meta:
|
||||
meta:
|
||||
register: tower_meta
|
||||
|
||||
- name: Generate the name of our plugin
|
||||
@ -24,7 +24,7 @@
|
||||
plugin_name: "{{ tower_meta.prefix }}.tower_api"
|
||||
|
||||
- name: Create all of our users
|
||||
tower_user:
|
||||
user:
|
||||
username: "{{ item }}"
|
||||
is_superuser: true
|
||||
password: "{{ test_id }}"
|
||||
@ -43,7 +43,7 @@
|
||||
- "'DNE' in results.msg"
|
||||
|
||||
- name: Create our hosts
|
||||
tower_host:
|
||||
host:
|
||||
name: "{{ item }}"
|
||||
inventory: "Demo Inventory"
|
||||
loop: "{{ hosts }}"
|
||||
@ -200,7 +200,7 @@
|
||||
label: "{{ item['name'] }}"
|
||||
|
||||
- name: Make sure user 'john' is an org admin of the default org if the user exists
|
||||
tower_role:
|
||||
role:
|
||||
organization: Default
|
||||
role: admin
|
||||
user: "{{ usernames[0] }}"
|
||||
@ -213,7 +213,7 @@
|
||||
- tower_role_revoke is skipped
|
||||
|
||||
- name: Create an inventory group with all 'foo' hosts
|
||||
tower_group:
|
||||
group:
|
||||
name: "{{ group_name }}"
|
||||
inventory: "Demo Inventory"
|
||||
hosts: >-
|
||||
@ -229,20 +229,20 @@
|
||||
|
||||
always:
|
||||
- name: Cleanup group
|
||||
tower_group:
|
||||
group:
|
||||
name: "{{ group_name }}"
|
||||
inventory: "Demo Inventory"
|
||||
state: absent
|
||||
|
||||
- name: Cleanup hosts
|
||||
tower_host:
|
||||
host:
|
||||
name: "{{ item }}"
|
||||
inventory: "Demo Inventory"
|
||||
state: absent
|
||||
loop: "{{ hosts }}"
|
||||
|
||||
- name: Cleanup users
|
||||
tower_user:
|
||||
user:
|
||||
username: "{{ item }}"
|
||||
state: absent
|
||||
loop: "{{ usernames }}"
|
||||
|
||||
@ -9,13 +9,13 @@
|
||||
group_name1: "AWX-Collection-tests-tower_instance_group-group1-{{ test_id }}"
|
||||
|
||||
- name: Make sure {{ org_name }} is not there
|
||||
tower_organization:
|
||||
organization:
|
||||
name: "{{ org_name }}"
|
||||
state: absent
|
||||
register: result
|
||||
|
||||
- name: "Create a new organization"
|
||||
tower_organization:
|
||||
organization:
|
||||
name: "{{ org_name }}"
|
||||
galaxy_credentials:
|
||||
- Ansible Galaxy
|
||||
@ -25,7 +25,7 @@
|
||||
that: "result is changed"
|
||||
|
||||
- name: "Make sure making the same org is not a change"
|
||||
tower_organization:
|
||||
organization:
|
||||
name: "{{ org_name }}"
|
||||
register: result
|
||||
|
||||
@ -44,7 +44,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: "Pass in all parameters"
|
||||
tower_organization:
|
||||
organization:
|
||||
name: "{{ org_name }}"
|
||||
description: "A description"
|
||||
instance_groups:
|
||||
@ -56,7 +56,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: "Change the description"
|
||||
tower_organization:
|
||||
organization:
|
||||
name: "{{ org_name }}"
|
||||
description: "A new description"
|
||||
register: result
|
||||
@ -71,7 +71,7 @@
|
||||
state: absent
|
||||
|
||||
- name: "Remove the organization"
|
||||
tower_organization:
|
||||
organization:
|
||||
name: "{{ org_name }}"
|
||||
state: absent
|
||||
register: result
|
||||
@ -81,7 +81,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: "Remove a missing organization"
|
||||
tower_organization:
|
||||
organization:
|
||||
name: "{{ org_name }}"
|
||||
state: absent
|
||||
register: result
|
||||
@ -92,7 +92,7 @@
|
||||
|
||||
# Test behaviour common to all tower modules
|
||||
- name: Check that SSL is available and verify_ssl is enabled (task must fail)
|
||||
tower_organization:
|
||||
organization:
|
||||
name: Default
|
||||
validate_certs: true
|
||||
ignore_errors: true
|
||||
@ -104,6 +104,6 @@
|
||||
- "'CERTIFICATE_VERIFY_FAILED' in check_ssl_is_used['msg']"
|
||||
|
||||
- name: Check that verify_ssl is disabled (task must not fail)
|
||||
tower_organization:
|
||||
organization:
|
||||
name: Default
|
||||
validate_certs: false
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
|
||||
- block:
|
||||
- name: Create an SCM Credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ scm_cred_name }}"
|
||||
organization: Default
|
||||
kind: scm
|
||||
@ -22,7 +22,7 @@
|
||||
- result is changed
|
||||
|
||||
- name: Create a git project without credentials and wait
|
||||
tower_project:
|
||||
project:
|
||||
name: "{{ project_name1 }}"
|
||||
organization: Default
|
||||
scm_type: git
|
||||
@ -35,7 +35,7 @@
|
||||
- result is changed
|
||||
|
||||
- name: Recreate the project to validate not changed
|
||||
tower_project:
|
||||
project:
|
||||
name: "{{ project_name1 }}"
|
||||
organization: Default
|
||||
scm_type: git
|
||||
@ -49,7 +49,7 @@
|
||||
- result is not changed
|
||||
|
||||
- name: Create organizations
|
||||
tower_organization:
|
||||
organization:
|
||||
name: "{{ org_name }}"
|
||||
register: result
|
||||
|
||||
@ -58,7 +58,7 @@
|
||||
- result is changed
|
||||
|
||||
- name: Create credential
|
||||
tower_credential:
|
||||
credential:
|
||||
kind: scm
|
||||
name: "{{ cred_name }}"
|
||||
organization: "{{ org_name }}"
|
||||
@ -69,7 +69,7 @@
|
||||
- result is changed
|
||||
|
||||
- name: Create a new test project in check_mode
|
||||
tower_project:
|
||||
project:
|
||||
name: "{{ project_name2 }}"
|
||||
organization: "{{ org_name }}"
|
||||
scm_type: git
|
||||
@ -78,7 +78,7 @@
|
||||
check_mode: true
|
||||
|
||||
- name: "Copy tower project from {{ project_name1 }}"
|
||||
tower_project:
|
||||
project:
|
||||
name: "{{ project_name2 }}"
|
||||
copy_from: "{{ project_name1 }}"
|
||||
organization: "{{ org_name }}"
|
||||
@ -94,7 +94,7 @@
|
||||
- result.copied
|
||||
|
||||
- name: Check module fails with correct msg when given non-existing org as param
|
||||
tower_project:
|
||||
project:
|
||||
name: "{{ project_name2 }}"
|
||||
organization: Non_Existing_Org
|
||||
scm_type: git
|
||||
@ -111,7 +111,7 @@
|
||||
- "result.total_results == 0"
|
||||
|
||||
- name: Check module fails with correct msg when given non-existing credential as param
|
||||
tower_project:
|
||||
project:
|
||||
name: "{{ project_name2 }}"
|
||||
organization: "{{ org_name }}"
|
||||
scm_type: git
|
||||
@ -128,7 +128,7 @@
|
||||
- "result.total_results == 0"
|
||||
|
||||
- name: Create a git project without credentials without waiting
|
||||
tower_project:
|
||||
project:
|
||||
name: "{{ project_name3 }}"
|
||||
organization: Default
|
||||
scm_type: git
|
||||
@ -142,7 +142,7 @@
|
||||
- result is changed
|
||||
|
||||
- name: Update the project and wait. Verify not changed as no change made to repo and refspec not changed
|
||||
tower_project:
|
||||
project:
|
||||
name: "{{ project_name3 }}"
|
||||
organization: Default
|
||||
scm_type: git
|
||||
@ -192,19 +192,19 @@
|
||||
state: absent
|
||||
|
||||
- name: Delete the test project 3
|
||||
tower_project:
|
||||
project:
|
||||
name: "{{ project_name3 }}"
|
||||
organization: Default
|
||||
state: absent
|
||||
|
||||
- name: Delete the test project 2
|
||||
tower_project:
|
||||
project:
|
||||
name: "{{ project_name2 }}"
|
||||
organization: "{{ org_name }}"
|
||||
state: absent
|
||||
|
||||
- name: Delete the SCM Credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ scm_cred_name }}"
|
||||
organization: Default
|
||||
kind: scm
|
||||
@ -216,7 +216,7 @@
|
||||
- result is changed
|
||||
|
||||
- name: Delete the test project 1
|
||||
tower_project:
|
||||
project:
|
||||
name: "{{ project_name1 }}"
|
||||
organization: Default
|
||||
state: absent
|
||||
@ -227,7 +227,7 @@
|
||||
- result is changed
|
||||
|
||||
- name: Delete credential
|
||||
tower_credential:
|
||||
credential:
|
||||
kind: scm
|
||||
name: "{{ cred_name }}"
|
||||
organization: "{{ org_name }}"
|
||||
@ -239,7 +239,7 @@
|
||||
- result is changed
|
||||
|
||||
- name: Delete the organization
|
||||
tower_organization:
|
||||
organization:
|
||||
name: "{{ org_name }}"
|
||||
state: absent
|
||||
register: result
|
||||
|
||||
@ -5,18 +5,18 @@
|
||||
vars:
|
||||
tower_settings: "{{ lookup('awx.awx.tower_api', 'config/') }}"
|
||||
|
||||
- tower_inventory:
|
||||
- inventory:
|
||||
name: localhost
|
||||
organization: Default
|
||||
|
||||
- tower_host:
|
||||
- host:
|
||||
name: localhost
|
||||
inventory: localhost
|
||||
variables:
|
||||
ansible_connection: local
|
||||
|
||||
- name: create an unused SSH / Machine credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: dummy
|
||||
kind: ssh
|
||||
ssh_key_data: |
|
||||
@ -29,7 +29,7 @@
|
||||
|
||||
- block:
|
||||
- name: Add a path to a setting
|
||||
tower_settings:
|
||||
settings:
|
||||
name: AWX_ISOLATION_SHOW_PATHS
|
||||
value: "[{{ project_base_dir }}]"
|
||||
|
||||
@ -44,12 +44,12 @@
|
||||
|
||||
always:
|
||||
- name: Delete path from setting
|
||||
tower_settings:
|
||||
settings:
|
||||
name: AWX_ISOLATION_SHOW_PATHS
|
||||
value: []
|
||||
|
||||
- name: Delete dummy credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: dummy
|
||||
kind: ssh
|
||||
state: absent
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
import_tasks: create_project_dir.yml
|
||||
|
||||
- name: Create a manual project
|
||||
tower_project:
|
||||
project:
|
||||
name: "{{ project_name }}"
|
||||
organization: Default
|
||||
scm_type: manual
|
||||
@ -26,7 +26,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Delete a manual project
|
||||
tower_project:
|
||||
project:
|
||||
name: "{{ project_name }}"
|
||||
organization: Default
|
||||
state: absent
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
project_name1: "AWX-Collection-tests-tower_project_update-project-{{ test_id }}"
|
||||
|
||||
- name: Create a git project without credentials without waiting
|
||||
tower_project:
|
||||
project:
|
||||
name: "{{ project_name1 }}"
|
||||
organization: Default
|
||||
scm_type: git
|
||||
@ -56,7 +56,7 @@
|
||||
- result is not changed
|
||||
|
||||
- name: Delete the test project 1
|
||||
tower_project:
|
||||
project:
|
||||
name: "{{ project_name1 }}"
|
||||
organization: Default
|
||||
state: absent
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
|
||||
- block:
|
||||
- name: Create a User
|
||||
tower_user:
|
||||
user:
|
||||
first_name: Joe
|
||||
last_name: User
|
||||
username: "{{ username }}"
|
||||
@ -27,7 +27,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Create a project
|
||||
tower_project:
|
||||
project:
|
||||
name: "{{ project_name }}"
|
||||
organization: Default
|
||||
scm_type: git
|
||||
@ -55,7 +55,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Add Joe to the update role of the default Project with lookup Organization
|
||||
tower_role:
|
||||
role:
|
||||
user: "{{ username }}"
|
||||
role: update
|
||||
lookup_organization: Default
|
||||
@ -71,7 +71,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Add Joe to the new project by ID
|
||||
tower_role:
|
||||
role:
|
||||
user: "{{ username }}"
|
||||
role: update
|
||||
project: "{{ project_info['id'] }}"
|
||||
@ -92,7 +92,7 @@
|
||||
state: present
|
||||
|
||||
- name: Add Joe to workflow execute role
|
||||
tower_role:
|
||||
role:
|
||||
user: "{{ username }}"
|
||||
role: execute
|
||||
workflow: test-role-workflow
|
||||
@ -107,7 +107,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Add Joe to workflow execute role, no-op
|
||||
tower_role:
|
||||
role:
|
||||
user: "{{ username }}"
|
||||
role: execute
|
||||
workflow: test-role-workflow
|
||||
@ -119,7 +119,7 @@
|
||||
- "result is not changed"
|
||||
|
||||
- name: Add Joe to workflow approve role
|
||||
tower_role:
|
||||
role:
|
||||
user: "{{ username }}"
|
||||
role: approval
|
||||
workflow: test-role-workflow
|
||||
@ -132,7 +132,7 @@
|
||||
|
||||
always:
|
||||
- name: Delete a User
|
||||
tower_user:
|
||||
user:
|
||||
username: "{{ username }}"
|
||||
email: joe@example.org
|
||||
state: absent
|
||||
@ -151,7 +151,7 @@
|
||||
register: result
|
||||
|
||||
- name: Delete the project
|
||||
tower_project:
|
||||
project:
|
||||
name: "{{ project_name }}"
|
||||
organization: Default
|
||||
state: absent
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
sched1: "AWX-Collection-tests-tower_schedule-sched1-{{ test_id }}"
|
||||
|
||||
- name: Try to create without an rrule
|
||||
tower_schedule:
|
||||
schedule:
|
||||
name: "{{ sched1 }}"
|
||||
state: present
|
||||
unified_job_template: "Demo Job Template"
|
||||
@ -22,7 +22,7 @@
|
||||
- "'Unable to create schedule {{ sched1 }}' in result.msg"
|
||||
|
||||
- name: Create with options that the JT does not support
|
||||
tower_schedule:
|
||||
schedule:
|
||||
name: "{{ sched1 }}"
|
||||
state: present
|
||||
unified_job_template: "Demo Job Template"
|
||||
@ -48,7 +48,7 @@
|
||||
- "'Unable to create schedule {{ sched1 }}' in result.msg"
|
||||
|
||||
- name: Build a real schedule
|
||||
tower_schedule:
|
||||
schedule:
|
||||
name: "{{ sched1 }}"
|
||||
state: present
|
||||
unified_job_template: "Demo Job Template"
|
||||
@ -60,7 +60,7 @@
|
||||
- result is changed
|
||||
|
||||
- name: Rebuild the same schedule
|
||||
tower_schedule:
|
||||
schedule:
|
||||
name: "{{ sched1 }}"
|
||||
state: present
|
||||
unified_job_template: "Demo Job Template"
|
||||
@ -72,7 +72,7 @@
|
||||
- result is not changed
|
||||
|
||||
- name: Disable a schedule
|
||||
tower_schedule:
|
||||
schedule:
|
||||
name: "{{ sched1 }}"
|
||||
state: present
|
||||
enabled: "false"
|
||||
@ -83,6 +83,6 @@
|
||||
- result is changed
|
||||
|
||||
- name: Delete the schedule
|
||||
tower_schedule:
|
||||
schedule:
|
||||
name: "{{ sched1 }}"
|
||||
state: absent
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
---
|
||||
- name: Get our collection package
|
||||
tower_meta:
|
||||
meta:
|
||||
register: tower_meta
|
||||
|
||||
- name: Generate the name of our plugin
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
---
|
||||
- name: Set the value of AWX_ISOLATION_SHOW_PATHS to a baseline
|
||||
tower_settings:
|
||||
settings:
|
||||
name: AWX_ISOLATION_SHOW_PATHS
|
||||
value: '["/var/lib/awx/projects/"]'
|
||||
|
||||
- name: Set the value of AWX_ISOLATION_SHOW_PATHS to get an error back from Tower
|
||||
tower_settings:
|
||||
settings:
|
||||
settings:
|
||||
AWX_ISOLATION_SHOW_PATHS:
|
||||
'not': 'a valid'
|
||||
@ -18,7 +18,7 @@
|
||||
- "result is failed"
|
||||
|
||||
- name: Set the value of AWX_ISOLATION_SHOW_PATHS
|
||||
tower_settings:
|
||||
settings:
|
||||
name: AWX_ISOLATION_SHOW_PATHS
|
||||
value: '["/var/lib/awx/projects/", "/tmp"]'
|
||||
register: result
|
||||
@ -28,7 +28,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Attempt to set the value of AWX_ISOLATION_BASE_PATH to what it already is
|
||||
tower_settings:
|
||||
settings:
|
||||
name: AWX_ISOLATION_BASE_PATH
|
||||
value: /tmp
|
||||
register: result
|
||||
@ -41,7 +41,7 @@
|
||||
- "result is not changed"
|
||||
|
||||
- name: Apply a single setting via settings
|
||||
tower_settings:
|
||||
settings:
|
||||
name: AWX_ISOLATION_SHOW_PATHS
|
||||
value: '["/var/lib/awx/projects/", "/var/tmp"]'
|
||||
register: result
|
||||
@ -51,7 +51,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Apply multiple setting via settings with no change
|
||||
tower_settings:
|
||||
settings:
|
||||
settings:
|
||||
AWX_ISOLATION_BASE_PATH: /tmp
|
||||
AWX_ISOLATION_SHOW_PATHS: ["/var/lib/awx/projects/", "/var/tmp"]
|
||||
@ -65,7 +65,7 @@
|
||||
- "result is not changed"
|
||||
|
||||
- name: Apply multiple setting via settings with change
|
||||
tower_settings:
|
||||
settings:
|
||||
settings:
|
||||
AWX_ISOLATION_BASE_PATH: /tmp
|
||||
AWX_ISOLATION_SHOW_PATHS: []
|
||||
@ -76,7 +76,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Handle an omit value
|
||||
tower_settings:
|
||||
settings:
|
||||
name: AWX_ISOLATION_BASE_PATH
|
||||
value: '{{ junk_var | default(omit) }}'
|
||||
register: result
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
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
|
||||
tower_team:
|
||||
team:
|
||||
name: Test Team
|
||||
organization: Missing_Organization
|
||||
state: present
|
||||
@ -20,7 +20,7 @@
|
||||
- "result.total_results == 0"
|
||||
|
||||
- name: Create a Tower team
|
||||
tower_team:
|
||||
team:
|
||||
name: "{{ team_name }}"
|
||||
organization: Default
|
||||
register: result
|
||||
@ -30,7 +30,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Delete a Tower team
|
||||
tower_team:
|
||||
team:
|
||||
name: "{{ team_name }}"
|
||||
organization: Default
|
||||
state: absent
|
||||
@ -41,7 +41,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Check module fails with correct msg
|
||||
tower_team:
|
||||
team:
|
||||
name: "{{ team_name }}"
|
||||
organization: Non_Existing_Org
|
||||
state: present
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
|
||||
- name: Try to use a token as a dict which is missing the token parameter
|
||||
tower_job_list:
|
||||
tower_oauthtoken:
|
||||
oauthtoken:
|
||||
not_token: "This has no token entry"
|
||||
register: results
|
||||
ignore_errors: true
|
||||
@ -17,7 +17,7 @@
|
||||
|
||||
- name: Try to use a token as a list
|
||||
tower_job_list:
|
||||
tower_oauthtoken:
|
||||
oauthtoken:
|
||||
- dummy_token
|
||||
register: results
|
||||
ignore_errors: true
|
||||
@ -28,7 +28,7 @@
|
||||
- '"The provided tower_oauthtoken type was not valid (list). Valid options are str or dict." == results.msg'
|
||||
|
||||
- name: Try to delete a token with no existing_token or existing_token_id
|
||||
tower_token:
|
||||
token:
|
||||
state: absent
|
||||
register: results
|
||||
ignore_errors: true
|
||||
@ -39,7 +39,7 @@
|
||||
# We don't assert a message here because it's handled by ansible
|
||||
|
||||
- name: Try to delete a token with both existing_token or existing_token_id
|
||||
tower_token:
|
||||
token:
|
||||
existing_token:
|
||||
id: 1234
|
||||
existing_token_id: 1234
|
||||
@ -55,7 +55,7 @@
|
||||
|
||||
- block:
|
||||
- name: Create a Token
|
||||
tower_token:
|
||||
token:
|
||||
description: '{{ token_description }}'
|
||||
scope: "write"
|
||||
state: present
|
||||
@ -73,7 +73,7 @@
|
||||
|
||||
always:
|
||||
- name: Delete our Token with our own token
|
||||
tower_token:
|
||||
token:
|
||||
existing_token: "{{ tower_token }}"
|
||||
tower_oauthtoken: "{{ tower_token }}"
|
||||
state: absent
|
||||
@ -86,7 +86,7 @@
|
||||
|
||||
- block:
|
||||
- name: Create a second token
|
||||
tower_token:
|
||||
token:
|
||||
description: '{{ token_description }}'
|
||||
scope: "write"
|
||||
state: present
|
||||
@ -98,7 +98,7 @@
|
||||
|
||||
always:
|
||||
- name: Delete the second Token with our own token
|
||||
tower_token:
|
||||
token:
|
||||
existing_token_id: "{{ tower_token['id'] }}"
|
||||
tower_oauthtoken: "{{ tower_token }}"
|
||||
state: absent
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
username: "AWX-Collection-tests-tower_user-user-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||
|
||||
- name: Create a User
|
||||
tower_user:
|
||||
user:
|
||||
username: "{{ username }}"
|
||||
first_name: Joe
|
||||
password: "{{ 65535 | random | to_uuid }}"
|
||||
@ -16,7 +16,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Change a User by ID
|
||||
tower_user:
|
||||
user:
|
||||
username: "{{ result.id }}"
|
||||
last_name: User
|
||||
email: joe@example.org
|
||||
@ -28,7 +28,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Check idempotency
|
||||
tower_user:
|
||||
user:
|
||||
username: "{{ username }}"
|
||||
first_name: Joe
|
||||
last_name: User
|
||||
@ -39,7 +39,7 @@
|
||||
- "result is not changed"
|
||||
|
||||
- name: Delete a User
|
||||
tower_user:
|
||||
user:
|
||||
username: "{{ username }}"
|
||||
email: joe@example.org
|
||||
state: absent
|
||||
@ -50,7 +50,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Create an Auditor
|
||||
tower_user:
|
||||
user:
|
||||
first_name: Joe
|
||||
last_name: Auditor
|
||||
username: "{{ username }}"
|
||||
@ -65,7 +65,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Delete an Auditor
|
||||
tower_user:
|
||||
user:
|
||||
username: "{{ username }}"
|
||||
email: joe@example.org
|
||||
state: absent
|
||||
@ -76,7 +76,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Create a Superuser
|
||||
tower_user:
|
||||
user:
|
||||
first_name: Joe
|
||||
last_name: Super
|
||||
username: "{{ username }}"
|
||||
@ -91,7 +91,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Delete a Superuser
|
||||
tower_user:
|
||||
user:
|
||||
username: "{{ username }}"
|
||||
email: joe@example.org
|
||||
state: absent
|
||||
@ -102,7 +102,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Test tower SSL parameter
|
||||
tower_user:
|
||||
user:
|
||||
first_name: Joe
|
||||
last_name: User
|
||||
username: "{{ username }}"
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
register: result
|
||||
|
||||
- name: Create an SCM Credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ scm_cred_name }}"
|
||||
organization: Default
|
||||
kind: scm
|
||||
@ -72,7 +72,7 @@
|
||||
- "{{ org_name }}"
|
||||
|
||||
- name: Create a Demo Project
|
||||
tower_project:
|
||||
project:
|
||||
name: "{{ demo_project_name }}"
|
||||
organization: Default
|
||||
state: present
|
||||
@ -86,7 +86,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Add a Tower inventory
|
||||
tower_inventory:
|
||||
inventory:
|
||||
description: Test inventory
|
||||
organization: Default
|
||||
name: "{{ project_inv }}"
|
||||
@ -618,7 +618,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Delete the inventory
|
||||
tower_inventory:
|
||||
inventory:
|
||||
description: Test inventory
|
||||
organization: Default
|
||||
name: "{{ project_inv }}"
|
||||
@ -629,7 +629,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Delete the Demo Project
|
||||
tower_project:
|
||||
project:
|
||||
name: "{{ demo_project_name }}"
|
||||
organization: Default
|
||||
scm_type: git
|
||||
@ -643,7 +643,7 @@
|
||||
- "result is changed"
|
||||
|
||||
- name: Delete the SCM Credential
|
||||
tower_credential:
|
||||
credential:
|
||||
name: "{{ scm_cred_name }}"
|
||||
organization: Default
|
||||
kind: scm
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user