From ddb4c091571e9e67553d2cffc9ca97a7f0b3111d Mon Sep 17 00:00:00 2001 From: willtome Date: Tue, 22 Aug 2023 09:03:34 -0400 Subject: [PATCH] Move to Demo Creds and Inventory (#88) --- cloud/aws_key.yml | 4 ++-- cloud/create_vpc.yml | 11 +++++------ cloud/setup.yml | 38 ++++++++++++++++++++++---------------- windows/setup.yml | 4 ++-- 4 files changed, 31 insertions(+), 26 deletions(-) diff --git a/cloud/aws_key.yml b/cloud/aws_key.yml index 82e1802..e4ffcee 100644 --- a/cloud/aws_key.yml +++ b/cloud/aws_key.yml @@ -10,7 +10,7 @@ ansible.builtin.assert: that: - aws_key_name is defined - - aws_region is defined + - create_vm_aws_region is defined - aws_public_key is defined - aws_keypair_owner is defined fail_msg: "Required variables not set" @@ -18,7 +18,7 @@ - name: Create AWS keypair amazon.aws.ec2_key: name: "{{ aws_key_name }}" - region: "{{ aws_region }}" + region: "{{ create_vm_aws_region }}" key_material: "{{ aws_public_key }}" state: present tags: diff --git a/cloud/create_vpc.yml b/cloud/create_vpc.yml index bb6005c..67be5cb 100644 --- a/cloud/create_vpc.yml +++ b/cloud/create_vpc.yml @@ -9,7 +9,6 @@ aws_tenancy: default aws_vpc_cidr_block: 10.0.0.0/16 aws_subnet_cidr: 10.0.1.0/24 - aws_region: us-east-1 aws_sg_name: aws-test-sg aws_subnet_name: aws-test-subnet aws_rt_name: aws-test-rt @@ -21,7 +20,7 @@ name: "{{ aws_vpc_name }}" cidr_block: "{{ aws_vpc_cidr_block }}" tenancy: "{{ aws_tenancy }}" - region: "{{ aws_region }}" + region: "{{ create_vm_aws_region }}" tags: owner: "{{ aws_owner_tag }}" purpose: "{{ aws_purpose_tag }}" @@ -31,7 +30,7 @@ amazon.aws.ec2_vpc_igw: state: present vpc_id: "{{ aws_vpc.vpc.id }}" - region: "{{ aws_region }}" + region: "{{ create_vm_aws_region }}" tags: Name: "{{ aws_vpc_name }}" owner: "{{ aws_owner_tag }}" @@ -42,7 +41,7 @@ amazon.aws.ec2_security_group: state: present name: "{{ aws_sg_name }}" - region: "{{ aws_region }}" + region: "{{ create_vm_aws_region }}" description: Inbound WinRM and RDP, http for demo servers and internal AD ports rules: - proto: tcp @@ -101,7 +100,7 @@ state: present vpc_id: "{{ aws_vpc.vpc.id }}" cidr: "{{ aws_subnet_cidr }}" - region: "{{ aws_region }}" + region: "{{ create_vm_aws_region }}" map_public: true tags: Name: "{{ aws_subnet_name }}" @@ -113,7 +112,7 @@ amazon.aws.ec2_vpc_route_table: state: present vpc_id: "{{ aws_vpc.vpc.id }}" - region: "{{ aws_region }}" + region: "{{ create_vm_aws_region }}" subnets: - "{{ aws_subnet.subnet.id }}" routes: diff --git a/cloud/setup.yml b/cloud/setup.yml index 260b9da..64ece26 100644 --- a/cloud/setup.yml +++ b/cloud/setup.yml @@ -164,7 +164,7 @@ controller_templates: spec: - question_name: AWS Region type: multiplechoice - variable: aws_region + variable: create_vm_aws_region required: true choices: - us-east-1 @@ -263,8 +263,6 @@ controller_templates: notification_templates_success: Telemetry notification_templates_error: Telemetry survey_enabled: true - extra_vars: - aws_region: us-east-1 survey: name: '' description: '' @@ -286,8 +284,21 @@ controller_templates: notification_templates_success: Telemetry notification_templates_error: Telemetry extra_vars: - aws_region: us-east-1 aws_report: vpc + survey_enabled: true + survey: + name: '' + description: '' + spec: + - question_name: AWS Region + type: multiplechoice + variable: create_vm_aws_region + required: true + choices: + - us-east-1 + - us-east-2 + - us-west-1 + - us-west-2 - name: Cloud / AWS / Tags Report job_type: run @@ -309,7 +320,7 @@ controller_templates: spec: - question_name: AWS Region type: multiplechoice - variable: aws_region + variable: create_vm_aws_region required: true choices: - us-east-1 @@ -335,7 +346,7 @@ controller_templates: spec: - question_name: AWS Region type: multiplechoice - variable: aws_region + variable: create_vm_aws_region required: true choices: - us-east-1 @@ -372,7 +383,7 @@ controller_workflows: spec: - question_name: AWS Region type: multiplechoice - variable: aws_region + variable: create_vm_aws_region required: true choices: - us-east-1 @@ -381,7 +392,7 @@ controller_workflows: - us-west-2 - question_name: Owner type: text - variable: aws_owner_tag + variable: create_vm_aws_owner_tag required: true - question_name: Environment type: multiplechoice @@ -402,8 +413,6 @@ controller_workflows: simplified_workflow_nodes: - identifier: Create Keypair unified_job_template: Cloud / AWS / Create Keypair - extra_data: - aws_keypair_owner: !unsafe "{{ aws_owner_tag }}" success_nodes: - VPC Report failure_nodes: @@ -428,9 +437,8 @@ controller_workflows: - identifier: Deploy Windows Blueprint unified_job_template: Cloud / AWS / Create VM extra_data: - vm_name: aws_win + create_vm_vm_name: aws_win vm_blueprint: windows_full - vm_owner: !unsafe "{{ aws_owner_tag }}" success_nodes: - Update Inventory failure_nodes: @@ -438,9 +446,8 @@ controller_workflows: - identifier: Deploy RHEL8 Blueprint unified_job_template: Cloud / AWS / Create VM extra_data: - vm_name: aws_rhel8 + create_vm_vm_name: aws_rhel8 vm_blueprint: rhel8 - vm_owner: !unsafe "{{ aws_owner_tag }}" success_nodes: - Update Inventory failure_nodes: @@ -448,9 +455,8 @@ controller_workflows: - identifier: Deploy RHEL9 Blueprint unified_job_template: Cloud / AWS / Create VM extra_data: - vm_name: aws_rhel9 + create_vm_vm_name: aws_rhel9 vm_blueprint: rhel9 - vm_owner: !unsafe "{{ aws_owner_tag }}" success_nodes: - Update Inventory failure_nodes: diff --git a/windows/setup.yml b/windows/setup.yml index ebc7293..977b93f 100644 --- a/windows/setup.yml +++ b/windows/setup.yml @@ -224,14 +224,14 @@ controller_templates: - name: "WINDOWS / AD / Join Domain" job_type: run - inventory: "Workshop Inventory" + inventory: "Demo Inventory" project: "Ansible official demo project" playbook: "windows/join_ad_domain.yml" notification_templates_started: Telemetry notification_templates_success: Telemetry notification_templates_error: Telemetry credentials: - - "Workshop Credential" + - "Demo Credential" survey_enabled: true survey: name: ''