Added set_stats example to cloud workflow (#173)
This commit is contained in:
@@ -23,3 +23,8 @@
|
|||||||
state: present
|
state: present
|
||||||
tags:
|
tags:
|
||||||
owner: "{{ aws_keypair_owner }}"
|
owner: "{{ aws_keypair_owner }}"
|
||||||
|
|
||||||
|
- name: Set VPC stats
|
||||||
|
ansible.builtin.set_stats:
|
||||||
|
data:
|
||||||
|
stat_aws_key_pair: '{{ aws_key_name }}'
|
||||||
|
|||||||
@@ -126,8 +126,8 @@
|
|||||||
- name: Set VPC stats
|
- name: Set VPC stats
|
||||||
ansible.builtin.set_stats:
|
ansible.builtin.set_stats:
|
||||||
data:
|
data:
|
||||||
__aws_region: '{{ create_vm_aws_region }}'
|
stat_aws_region: '{{ create_vm_aws_region }}'
|
||||||
__aws_vpc_id: '{{ aws_vpc.vpc.id }}'
|
stat_aws_vpc_id: '{{ aws_vpc.vpc.id }}'
|
||||||
__aws_vpc_cidr: '{{ aws_vpc_cidr_block }}'
|
stat_aws_vpc_cidr: '{{ aws_vpc_cidr_block }}'
|
||||||
__aws_subnet_id: '{{ aws_subnet.subnet.id }}'
|
stat_aws_subnet_id: '{{ aws_subnet.subnet.id }}'
|
||||||
__aws_subnet_cidr: '{{ aws_subnet_cidr }}'
|
stat_aws_subnet_cidr: '{{ aws_subnet_cidr }}'
|
||||||
|
|||||||
18
cloud/display-ec2-stats.yml
Normal file
18
cloud/display-ec2-stats.yml
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
---
|
||||||
|
- name: Display EC2 stats
|
||||||
|
hosts: localhost
|
||||||
|
gather_facts: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Display stats for EC2 VPC and key pair
|
||||||
|
ansible.builtin.debug:
|
||||||
|
var: '{{ item }}'
|
||||||
|
loop:
|
||||||
|
- stat_aws_region
|
||||||
|
- stat_aws_key_pair
|
||||||
|
- stat_aws_vpc_id
|
||||||
|
- stat_aws_vpc_cidr
|
||||||
|
- stat_aws_subnet_id
|
||||||
|
- stat_aws_subnet_cidr
|
||||||
|
|
||||||
|
...
|
||||||
@@ -184,6 +184,18 @@ controller_templates:
|
|||||||
variable: _hosts
|
variable: _hosts
|
||||||
required: false
|
required: false
|
||||||
|
|
||||||
|
- name: Cloud / AWS / Display EC2 Stats
|
||||||
|
job_type: run
|
||||||
|
organization: Default
|
||||||
|
credentials:
|
||||||
|
- AWS
|
||||||
|
project: Ansible official demo project
|
||||||
|
playbook: cloud/display-ec2-stats.yml
|
||||||
|
inventory: Demo Inventory
|
||||||
|
notification_templates_started: Telemetry
|
||||||
|
notification_templates_success: Telemetry
|
||||||
|
notification_templates_error: Telemetry
|
||||||
|
|
||||||
- name: "LINUX / Patching"
|
- name: "LINUX / Patching"
|
||||||
job_type: check
|
job_type: check
|
||||||
inventory: "Demo Inventory"
|
inventory: "Demo Inventory"
|
||||||
@@ -254,19 +266,24 @@ controller_workflows:
|
|||||||
- identifier: Create Keypair
|
- identifier: Create Keypair
|
||||||
unified_job_template: Cloud / AWS / Create Keypair
|
unified_job_template: Cloud / AWS / Create Keypair
|
||||||
success_nodes:
|
success_nodes:
|
||||||
- VPC Report
|
- EC2 Stats
|
||||||
failure_nodes:
|
failure_nodes:
|
||||||
- Ticket - Keypair Failed
|
- Ticket - Keypair Failed
|
||||||
- identifier: Create VPC
|
- identifier: Create VPC
|
||||||
unified_job_template: Cloud / AWS / Create VPC
|
unified_job_template: Cloud / AWS / Create VPC
|
||||||
success_nodes:
|
success_nodes:
|
||||||
- VPC Report
|
- EC2 Stats
|
||||||
failure_nodes:
|
failure_nodes:
|
||||||
- Ticket - VPC Failed
|
- Ticket - VPC Failed
|
||||||
- identifier: Ticket - Keypair Failed
|
- identifier: Ticket - Keypair Failed
|
||||||
unified_job_template: 'SUBMIT FEEDBACK'
|
unified_job_template: 'SUBMIT FEEDBACK'
|
||||||
extra_data:
|
extra_data:
|
||||||
feedback: Failed to create AWS keypair
|
feedback: Failed to create AWS keypair
|
||||||
|
- identifier: EC2 Stats
|
||||||
|
unified_job_template: Cloud / AWS / Display EC2 Stats
|
||||||
|
all_parents_must_converge: true
|
||||||
|
always_nodes:
|
||||||
|
- VPC Report
|
||||||
- identifier: VPC Report
|
- identifier: VPC Report
|
||||||
unified_job_template: Cloud / AWS / VPC Report
|
unified_job_template: Cloud / AWS / VPC Report
|
||||||
all_parents_must_converge: true
|
all_parents_must_converge: true
|
||||||
@@ -321,10 +338,6 @@ controller_workflows:
|
|||||||
- Update Inventory
|
- Update Inventory
|
||||||
failure_nodes:
|
failure_nodes:
|
||||||
- Ticket - Instance Failed
|
- Ticket - Instance Failed
|
||||||
- identifier: Ticket - VPC Failed
|
|
||||||
unified_job_template: 'SUBMIT FEEDBACK'
|
|
||||||
extra_data:
|
|
||||||
feedback: Failed to create AWS VPC
|
|
||||||
- identifier: Update Inventory
|
- identifier: Update Inventory
|
||||||
unified_job_template: AWS Inventory
|
unified_job_template: AWS Inventory
|
||||||
success_nodes:
|
success_nodes:
|
||||||
@@ -335,6 +348,10 @@ controller_workflows:
|
|||||||
feedback: Failed to create AWS instance
|
feedback: Failed to create AWS instance
|
||||||
- identifier: Tag Report
|
- identifier: Tag Report
|
||||||
unified_job_template: Cloud / AWS / Tags Report
|
unified_job_template: Cloud / AWS / Tags Report
|
||||||
|
- identifier: Ticket - VPC Failed
|
||||||
|
unified_job_template: 'SUBMIT FEEDBACK'
|
||||||
|
extra_data:
|
||||||
|
feedback: Failed to create AWS VPC
|
||||||
|
|
||||||
- name: Cloud / AWS / Patch EC2 Workflow
|
- name: Cloud / AWS / Patch EC2 Workflow
|
||||||
description: A workflow to patch ec2 instances with snapshot and restore on failure.
|
description: A workflow to patch ec2 instances with snapshot and restore on failure.
|
||||||
|
|||||||
Reference in New Issue
Block a user