mirror of
https://github.com/ansible/awx.git
synced 2026-05-20 07:17:40 -02:30
pycharm refactor rename files and class, linux rename tower_ controller_
This commit is contained in:
1
awx_collection/tests/integration/targets/import/aliases
Normal file
1
awx_collection/tests/integration/targets/import/aliases
Normal file
@@ -0,0 +1 @@
|
||||
skip/python2
|
||||
105
awx_collection/tests/integration/targets/import/tasks/main.yml
Normal file
105
awx_collection/tests/integration/targets/import/tasks/main.yml
Normal file
@@ -0,0 +1,105 @@
|
||||
---
|
||||
- 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
|
||||
|
||||
- name: Generate names
|
||||
set_fact:
|
||||
org_name1: "AWX-Collection-tests-tower_import-organization-{{ test_id }}"
|
||||
org_name2: "AWX-Collection-tests-tower_import-organization2-{{ test_id }}"
|
||||
|
||||
- block:
|
||||
- name: "Import something"
|
||||
tower_import:
|
||||
assets:
|
||||
organizations:
|
||||
- name: "{{ org_name1 }}"
|
||||
description: ""
|
||||
max_hosts: 0
|
||||
related:
|
||||
notification_templates: []
|
||||
notification_templates_started: []
|
||||
notification_templates_success: []
|
||||
notification_templates_error: []
|
||||
notification_templates_approvals: []
|
||||
natural_key:
|
||||
name: "{{ org_name1 }}"
|
||||
type: "organization"
|
||||
register: import_output
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- import_output is changed
|
||||
|
||||
- name: "Import the same thing again"
|
||||
tower_import:
|
||||
assets:
|
||||
organizations:
|
||||
- name: "{{ org_name1 }}"
|
||||
description: ""
|
||||
max_hosts: 0
|
||||
related:
|
||||
notification_templates: []
|
||||
notification_templates_started: []
|
||||
notification_templates_success: []
|
||||
notification_templates_error: []
|
||||
notification_templates_approvals: []
|
||||
natural_key:
|
||||
name: "{{ org_name1 }}"
|
||||
type: "organization"
|
||||
register: import_output
|
||||
ignore_errors: true
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- import_output is not failed
|
||||
# - import_output is not changed # FIXME: module not idempotent
|
||||
|
||||
- name: "Write out a json file"
|
||||
copy:
|
||||
content: |
|
||||
{
|
||||
"organizations": [
|
||||
{
|
||||
"name": "{{ org_name2 }}",
|
||||
"description": "",
|
||||
"max_hosts": 0,
|
||||
"related": {
|
||||
"notification_templates": [],
|
||||
"notification_templates_started": [],
|
||||
"notification_templates_success": [],
|
||||
"notification_templates_error": [],
|
||||
"notification_templates_approvals": []
|
||||
},
|
||||
"natural_key": {
|
||||
"name": "{{ org_name2 }}",
|
||||
"type": "organization"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
dest: ./org.json
|
||||
|
||||
- name: "Load assets from a file"
|
||||
tower_import:
|
||||
assets: "{{ lookup('file', 'org.json') | from_json() }}"
|
||||
register: import_output
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- import_output is changed
|
||||
|
||||
always:
|
||||
- name: Remove organizations
|
||||
tower_organization:
|
||||
name: "{{ item }}"
|
||||
state: absent
|
||||
loop:
|
||||
- "{{ org_name1 }}"
|
||||
- "{{ org_name2 }}"
|
||||
|
||||
- name: Delete org.json
|
||||
file:
|
||||
path: ./org.json
|
||||
state: absent
|
||||
Reference in New Issue
Block a user