From 6c8be35284345d6bc84d6a8bdd13089d119d0afa Mon Sep 17 00:00:00 2001 From: root Date: Fri, 7 Feb 2025 00:27:56 +0100 Subject: [PATCH] adding set stats feature to workflows --- collections/awx/base.yaml | 16 +++++++++++++++- collections/awx/surveys.yaml | 7 +++---- collections/awx/vm.yaml | 20 +++++++++++++++++++- 3 files changed, 37 insertions(+), 6 deletions(-) diff --git a/collections/awx/base.yaml b/collections/awx/base.yaml index 1f3b403..e42be17 100644 --- a/collections/awx/base.yaml +++ b/collections/awx/base.yaml @@ -267,6 +267,19 @@ playbooks: organization: name: "{{ item.value.organization }}" type: inventory_source + related: + success_nodes: + - identifier: set-stats + failure_nodes: [] + always_nodes: [] + - identifier: set-stats + unified_job_template: + organization: + name: "{{ item.value.organization }}" + name: set-stats + type: job_template + credentials: "{{ item.value.credentials }}" + #extra_data: "{{ item.value.extra_data_execute }}" related: success_nodes: - identifier: baseos @@ -280,7 +293,8 @@ playbooks: name: baseos type: job_template credentials: "{{ item.value.credentials }}" - extra_data: "{{ item.value.extra_data_baseos}}" + #extra_data: "{{ item.value.extra_data_baseos}}" + extra_data: {} related: success_nodes: [] failure_nodes: [] diff --git a/collections/awx/surveys.yaml b/collections/awx/surveys.yaml index 2bd5dab..72d3464 100644 --- a/collections/awx/surveys.yaml +++ b/collections/awx/surveys.yaml @@ -224,12 +224,11 @@ vars: name: VM count? description: Choose VM count required: false - type: multiplechoice + type: integer variable: vmCount - min: "null" + min: "0" max: "null" - choices: '["1", "2", "3", "4", "5"]' - default: "1" + default: "" OS: name: Which VM OS-template? description: Choose OS diff --git a/collections/awx/vm.yaml b/collections/awx/vm.yaml index e1b72fb..b7c4dee 100644 --- a/collections/awx/vm.yaml +++ b/collections/awx/vm.yaml @@ -119,6 +119,24 @@ vars: survey_enabled: true survey_spec: "{{ lookup('file', 'vars/rendered.json') }}" + - name: job-set-stats + file: | + --- + job_templates: + stuttgartThings: + name: set-stats + organization: stuttgart-things + inventory: dynamic-inventory-vsphere + project: stuttgart-things + playbook: plays/set-hosts.yaml + credentials: sthings-ssh + executionenv: sthings-ee + state: present + ask_verbosity_on_launch: true + survey_enabled: false + #survey_spec: "{{ lookup('file', 'vars/rendered.json') }}" + + - name: job-create-vm-workflow file: | --- @@ -137,7 +155,7 @@ vars: # target_host, bucket_name can be changed extra_data_render: "{'target_host': 'localhost', 'bucket_name': 'vspherevm-labul'}" extra_data_execute: "{'target_host': 'rahul-awx-test', 'bucket_name': 'vspherevm-labul'}" - extra_data_baseos: "{'target_host': 'rahul-awx-as-code'}" + #extra_data_baseos: "{'target_host': 'rahul-awx-as-code'}" extra_vars: "{'ansible_ssh_retries': 10}" - name: labul