lint fixes

This commit is contained in:
willtome
2023-03-07 16:55:34 -05:00
parent 745b755296
commit 40c31d8e6e
64 changed files with 583 additions and 578 deletions

View File

@@ -6,20 +6,20 @@
aws_keypair_owner: undef
tasks:
- name: Fail if variables not defined
ansible.builtin.assert:
that:
- aws_key_name is defined
- aws_region is defined
- aws_public_key is defined
- aws_keypair_owner is defined
fail_msg: "Required variables not set"
- name: Fail if variables not defined
ansible.builtin.assert:
that:
- aws_key_name is defined
- aws_region is defined
- aws_public_key is defined
- aws_keypair_owner is defined
fail_msg: "Required variables not set"
- name: Create AWS keypair
amazon.aws.ec2_key:
name: "{{ aws_key_name }}"
region: "{{ aws_region }}"
key_material: "{{ aws_public_key }}"
state: present
tags:
owner: "{{ aws_keypair_owner }}"
- name: Create AWS keypair
amazon.aws.ec2_key:
name: "{{ aws_key_name }}"
region: "{{ aws_region }}"
key_material: "{{ aws_public_key }}"
state: present
tags:
owner: "{{ aws_keypair_owner }}"

View File

@@ -4,4 +4,4 @@ vm_providers:
aws_image_owners: 309956199498
aws_instance_size: t2.medium
aws_image_architecture: x86_64
aws_image_filter: 'RHEL-7.9_HVM*'
aws_image_filter: 'RHEL-7.9_HVM*'

View File

@@ -4,4 +4,4 @@ vm_providers:
aws_image_owners: 309956199498
aws_instance_size: t3.micro
aws_image_architecture: x86_64
aws_image_filter: 'RHEL-8*HVM-*Hourly*'
aws_image_filter: 'RHEL-8*HVM-*Hourly*'

View File

@@ -4,4 +4,4 @@ vm_providers:
aws_image_owners: 309956199498
aws_instance_size: t3.micro
aws_image_architecture: x86_64
aws_image_filter: 'RHEL-9*HVM-*Hourly*'
aws_image_filter: 'RHEL-9*HVM-*Hourly*'

View File

@@ -1,7 +1,7 @@
---
vm_blueprint_providers:
- aws
- azure
- aws
- azure
aws_image_filter: 'Windows_Server-2019-English-Core-Base*'
aws_instance_size: t3.medium
aws_userdata_template: aws_windows_userdata
@@ -11,4 +11,4 @@ az_vm_image:
offer: WindowsServer
publisher: MicrosoftWindowsServer
sku: 2022-Datacenter
version: latest
version: latest

View File

@@ -3,4 +3,4 @@ vm_blueprint_providers:
- aws
aws_image_filter: 'Windows_Server-2019-English-Core-Base*'
aws_instance_size: t3.medium
aws_userdata_template: aws_windows_userdata
aws_userdata_template: aws_windows_userdata

View File

@@ -3,4 +3,4 @@ vm_blueprint_providers:
- aws
aws_image_filter: 'Windows_Server-2019-English-Full-Base*'
aws_instance_size: t3.medium
aws_userdata_template: aws_windows_userdata
aws_userdata_template: aws_windows_userdata

View File

@@ -1,11 +1,12 @@
---
- name: Create Cloud Infra
hosts: localhost
gather_facts: no
gather_facts: false
vars:
infra_provider: undef
aws_public_key: undef
tasks:
- include_role:
name: "demo.cloud.{{ infra_provider }}"
tasks_from: create_infra
- name: Include provider role
ansible.builtin.include_role:
name: "demo.cloud.{{ infra_provider }}"
tasks_from: create_infra

View File

@@ -1,7 +1,7 @@
---
- name: Create Cloud Infra
hosts: localhost
gather_facts: no
gather_facts: false
vars:
vm_name: undef
vm_owner: undef
@@ -9,17 +9,17 @@
vm_blueprint: undef
tasks:
- name: "Importing {{ vm_blueprint | upper }} Blueprint"
include_vars:
file: "blueprints/{{ vm_blueprint }}.yml"
- name: "Importing {{ vm_blueprint | upper }}"
ansible.builtin.include_vars:
file: "blueprints/{{ vm_blueprint }}.yml"
- name: "Check Provider Compatibility"
assert:
that: "'{{ vm_provider }}' in {{ vm_blueprint_providers }}"
fail_msg: "{{ vm_blueprint | upper }} is not available for {{ vm_provider | upper }}"
when: "vm_blueprint_providers is defined"
- name: "Check Provider Compatibility"
ansible.builtin.assert:
that: "'{{ vm_provider }}' in {{ vm_blueprint_providers }}"
fail_msg: "{{ vm_blueprint | upper }} is not available for {{ vm_provider | upper }}"
when: "vm_blueprint_providers is defined"
- name: "Building {{ vm_blueprint | upper }} in {{ vm_provider | upper }}"
include_role:
name: "demo.cloud.{{ vm_provider }}"
tasks_from: create_vm
- name: "Building {{ vm_blueprint | upper }}"
ansible.builtin.include_role:
name: "demo.cloud.{{ vm_provider }}"
tasks_from: create_vm

View File

@@ -14,13 +14,13 @@ controller_execution_environments:
image: quay.io/scottharwell/cloud-ee:latest
controller_projects:
- name: Ansible Cloud Content Lab - AWS
organization: Default
scm_type: git
wait: yes
#scm_url: https://github.com/ansible-content-lab/aws.infrastructure_config_demos.git
scm_url: https://github.com/willtome/aws.infrastructure_config_demos.git
default_environment: Cloud Services Execution Environment
- name: Ansible Cloud Content Lab - AWS
organization: Default
scm_type: git
wait: true
# scm_url: https://github.com/ansible-content-lab/aws.infrastructure_config_demos.git
scm_url: https://github.com/willtome/aws.infrastructure_config_demos.git
default_environment: Cloud Services Execution Environment
controller_credentials:
- name: AWS
@@ -31,12 +31,12 @@ controller_credentials:
username: REPLACEME
password: REPLACEME
#- name: Azure
# credential_type: Microsoft Azure Resource Manager
# organization: Default
# update_secrets: false
# inputs:
# subscription: REPLACEME
# - name: Azure
# credential_type: Microsoft Azure Resource Manager
# organization: Default
# update_secrets: false
# inputs:
# subscription: REPLACEME
controller_inventory_sources:
- name: AWS Inventory
@@ -62,22 +62,22 @@ controller_inventory_sources:
- key: tags.owner
prefix: owner
#- name: Azure Inventory
# organization: Default
# source: azure_rm
# inventory: Workshop Inventory
# credential: Azure
# execution_environment: Ansible Engine 2.9 execution environment
# overwrite: true
# source_vars:
# hostnames:
# - tags.Name
# - default
# keyed_groups:
# - key: os_profile.system
# prefix: os
# conditional_groups:
# cloud_azure: true
# - name: Azure Inventory
# organization: Default
# source: azure_rm
# inventory: Workshop Inventory
# credential: Azure
# execution_environment: Ansible Engine 2.9 execution environment
# overwrite: true
# source_vars:
# hostnames:
# - tags.Name
# - default
# keyed_groups:
# - key: os_profile.system
# prefix: os
# conditional_groups:
# cloud_azure: true
controller_groups:
- name: cloud_aws
@@ -90,7 +90,7 @@ controller_templates:
job_type: run
organization: Default
credentials:
- AWS
- AWS
project: Ansible Cloud Content Lab - AWS
playbook: playbook_create_peer_network.yml
inventory: Workshop Inventory
@@ -106,7 +106,7 @@ controller_templates:
job_type: run
organization: Default
credentials:
- AWS
- AWS
project: Ansible Cloud Content Lab - AWS
playbook: playbook_delete_peer_network.yml
inventory: Workshop Inventory
@@ -120,7 +120,7 @@ controller_templates:
job_type: run
organization: Default
credentials:
- AWS
- AWS
project: Ansible Cloud Content Lab - AWS
playbook: playbook_create_transit_network.yml
inventory: Workshop Inventory
@@ -136,7 +136,7 @@ controller_templates:
job_type: run
organization: Default
credentials:
- AWS
- AWS
project: Ansible Cloud Content Lab - AWS
playbook: playbook_delete_transit_network.yml
inventory: Workshop Inventory
@@ -150,8 +150,8 @@ controller_templates:
job_type: run
organization: Default
credentials:
- AWS
#- Azure
- AWS
# - Azure
project: Ansible official demo project
playbook: cloud/create_infra.yml
inventory: Workshop Inventory
@@ -171,7 +171,7 @@ controller_templates:
required: true
choices:
- aws
#- azure
# - azure
- question_name: AWS Public Key (only required for aws provider)
type: textarea
required: false
@@ -180,9 +180,9 @@ controller_templates:
- name: Cloud / AWS / Create VM
job_type: run
organization: Default
credentials:
- AWS
- Workshop Credential
credentials:
- AWS
- Workshop Credential
project: Ansible Cloud Content Lab - AWS
playbook: playbook_create_vm.yml
inventory: Workshop Inventory
@@ -241,9 +241,9 @@ controller_templates:
- name: Cloud / AWS / Delete VM
job_type: run
organization: Default
credentials:
- AWS
- Workshop Credential
credentials:
- AWS
- Workshop Credential
project: Ansible Cloud Content Lab - AWS
playbook: playbook_delete_inventory_vm.yml
inventory: Workshop Inventory
@@ -266,7 +266,7 @@ controller_templates:
job_type: run
organization: Default
credentials:
- AWS
- AWS
project: Ansible Cloud Content Lab - AWS
playbook: playbook_create_reports.yml
inventory: Workshop Inventory
@@ -281,7 +281,7 @@ controller_templates:
job_type: run
organization: Default
credentials:
- AWS
- AWS
project: Ansible Cloud Content Lab - AWS
playbook: playbook_create_reports.yml
inventory: Workshop Inventory
@@ -295,8 +295,8 @@ controller_templates:
- name: Cloud / AWS / Create Keypair
job_type: run
organization: Default
credentials:
- AWS
credentials:
- AWS
project: Ansible official demo project
playbook: cloud/aws_key.yml
inventory: Workshop Inventory