pycharm refactor rename files and class, linux rename tower_ controller_

This commit is contained in:
Seth Foster
2021-04-28 18:13:22 -04:00
parent 2ad84b60b3
commit 44fed1d7c1
93 changed files with 234 additions and 149 deletions

View File

@@ -0,0 +1 @@
skip/python2

View 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