-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support to collection for named urls
- Loading branch information
1 parent
3624fe2
commit caca1b3
Showing
3 changed files
with
126 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
awx_collection/tests/integration/targets/module_utils/tasks/main.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
- name: Generate a random string for test | ||
set_fact: | ||
test_id: "{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}" | ||
when: test_id is not defined | ||
|
||
- include_tasks: | ||
file: test_named_reference.yml |
73 changes: 73 additions & 0 deletions
73
awx_collection/tests/integration/targets/module_utils/tasks/test_named_reference.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
--- | ||
- block: | ||
- name: generate random string for project | ||
set_fact: | ||
org_name: "AWX-Collection-tests-organization-org-{{ test_id }}" | ||
cred: "AWX-Collection-tests-job_template-cred-{{ test_id }}" | ||
inv: "AWX-Collection-tests-job_template-inv-{{ test_id }}" | ||
proj: "AWX-Collection-tests-job_template-proj-{{ test_id }}" | ||
jt: "AWX-Collection-tests-job_template-jt-{{ test_id }}" | ||
|
||
- name: "Create a new organization" | ||
organization: | ||
name: "{{ org_name }}" | ||
galaxy_credentials: | ||
- Ansible Galaxy | ||
|
||
- name: Create an inventory | ||
inventory: | ||
name: "{{ inv }}" | ||
organization: "{{ org_name }}" | ||
|
||
- name: Create a Demo Project | ||
project: | ||
name: "{{ proj }}" | ||
organization: "{{ org_name }}" | ||
state: present | ||
scm_type: git | ||
scm_url: https://github.com/ansible/ansible-tower-samples.git | ||
|
||
- name: Create Credential | ||
credential: | ||
name: "{{ cred }}" | ||
organization: "{{ org_name }}" | ||
credential_type: Machine | ||
|
||
- name: Create Job Template | ||
job_template: | ||
name: "{{ jt }}" | ||
project: "{{ proj }}++{{ org_name }}" | ||
inventory: "{{ inv }}++{{ org_name }}" | ||
playbook: hello_world.yml | ||
credentials: | ||
- "{{ cred }}++Machine+ssh++" | ||
job_type: run | ||
state: present | ||
|
||
always: | ||
- name: Delete the Job Template | ||
job_template: | ||
name: "{{ jt }}" | ||
state: absent | ||
|
||
- name: Delete the Demo Project | ||
project: | ||
name: "{{ proj }}++{{ org_name }}" | ||
state: absent | ||
|
||
- name: Delete Credential | ||
credential: | ||
name: "{{ cred }}++Machine+ssh++{{ org_name }}" | ||
credential_type: Machine | ||
state: absent | ||
|
||
- name: Delete the inventory | ||
inventory: | ||
name: "{{ inv }}++{{ org_name }}" | ||
organization: "{{ org_name }}" | ||
state: absent | ||
|
||
- name: Remove the organization | ||
organization: | ||
name: "{{ org_name }}" | ||
state: absent |