mirror of
https://github.com/ansible/awx.git
synced 2026-03-13 15:09:32 -02:30
Merge pull request #8043 from john-westcott-iv/instance_groups_module
Adding tower_instance_group module Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
---
|
||||
- name: Generate test id
|
||||
set_fact:
|
||||
test_id: "{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||
|
||||
- name: Generate names
|
||||
set_fact:
|
||||
group_name1: "AWX-Collection-tests-tower_instance_group-group1-{{ test_id }}"
|
||||
group_name2: "AWX-Collection-tests-tower_instance_group-group2-{{ test_id }}"
|
||||
cred_name1: "AWX-Collection-tests-tower_instance_group-cred1-{{ test_id }}"
|
||||
|
||||
- block:
|
||||
- name: Create an OpenShift Credential
|
||||
tower_credential:
|
||||
name: "{{ cred_name1 }}"
|
||||
organization: "Default"
|
||||
credential_type: "OpenShift or Kubernetes API Bearer Token"
|
||||
inputs:
|
||||
host: "https://openshift.org"
|
||||
bearer_token: "asdf1234"
|
||||
verify_ssl: false
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result is changed"
|
||||
|
||||
- name: Create an Instance Group
|
||||
tower_instance_group:
|
||||
name: "{{ group_name1 }}"
|
||||
policy_instance_percentage: 34
|
||||
policy_instance_minimum: 12
|
||||
state: present
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result is changed"
|
||||
|
||||
- name: Create a container group
|
||||
tower_instance_group:
|
||||
name: "{{ group_name2 }}"
|
||||
credential: "{{ cred_name1 }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result is changed"
|
||||
|
||||
always:
|
||||
- name: Delete the instance groups
|
||||
tower_instance_group:
|
||||
name: "{{ item }}"
|
||||
state: absent
|
||||
loop:
|
||||
- "{{ group_name1 }}"
|
||||
- "{{ group_name2 }}"
|
||||
|
||||
- name: Delete the credential
|
||||
tower_credential:
|
||||
name: "{{ cred_name1 }}"
|
||||
organization: "Default"
|
||||
credential_type: "OpenShift or Kubernetes API Bearer Token"
|
||||
Reference in New Issue
Block a user