Integration of Content Lab for AWS (#67)
* add jobs * role name * scm * naming * add new jobs * update URL * add playbook * add keypair * fix spaces * update setup * add rhel9 * change to main branch
This commit is contained in:
6
.github/linters/.markdown-lint.yml
vendored
6
.github/linters/.markdown-lint.yml
vendored
@@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"default": true,
|
|
||||||
"MD003": false,
|
|
||||||
"MD013": false,
|
|
||||||
"MD033": false
|
|
||||||
}
|
|
||||||
52
.github/linters/ansible-lint.yml
vendored
52
.github/linters/ansible-lint.yml
vendored
@@ -1,52 +0,0 @@
|
|||||||
---
|
|
||||||
##########################
|
|
||||||
##########################
|
|
||||||
## Ansible Linter rules ##
|
|
||||||
##########################
|
|
||||||
##########################
|
|
||||||
|
|
||||||
#############################
|
|
||||||
# Exclude paths from linter #
|
|
||||||
#############################
|
|
||||||
#exclude_paths:
|
|
||||||
|
|
||||||
########################
|
|
||||||
# Make output parsable #
|
|
||||||
########################
|
|
||||||
parseable: true
|
|
||||||
|
|
||||||
#######################
|
|
||||||
# Set output to quiet #
|
|
||||||
#######################
|
|
||||||
quiet: true
|
|
||||||
|
|
||||||
#####################
|
|
||||||
# Path to rules dir #
|
|
||||||
#####################
|
|
||||||
#rulesdir:
|
|
||||||
|
|
||||||
################
|
|
||||||
# Tags to skip #
|
|
||||||
################
|
|
||||||
skip_list:
|
|
||||||
- 'empty-string-compare' # Allow compare to empty string
|
|
||||||
- '204' # Allow string length greater than 160 chars
|
|
||||||
- 'no-changed-when' # False positives for running command shells
|
|
||||||
- 'command-instead-of-module' # Allow git commands for push, add, etc...
|
|
||||||
- 'command-instead-of-shell' # Allow use of shell when you want
|
|
||||||
- 'no-handler' # Allow step to run like handler
|
|
||||||
|
|
||||||
##################
|
|
||||||
# Tags to follow #
|
|
||||||
##################
|
|
||||||
#tags:
|
|
||||||
|
|
||||||
#############
|
|
||||||
# Use rules #
|
|
||||||
#############
|
|
||||||
use_default_rules: true
|
|
||||||
|
|
||||||
#################
|
|
||||||
# Set verbosity #
|
|
||||||
#################
|
|
||||||
verbosity: 1
|
|
||||||
35
.github/linters/markdown-lint.yml
vendored
35
.github/linters/markdown-lint.yml
vendored
@@ -1,35 +0,0 @@
|
|||||||
---
|
|
||||||
###########################
|
|
||||||
###########################
|
|
||||||
## Markdown Linter rules ##
|
|
||||||
###########################
|
|
||||||
###########################
|
|
||||||
|
|
||||||
# Linter rules doc:
|
|
||||||
# - https://github.com/DavidAnson/markdownlint
|
|
||||||
#
|
|
||||||
# Note:
|
|
||||||
# To comment out a single error:
|
|
||||||
# <!-- markdownlint-disable -->
|
|
||||||
# any violations you want
|
|
||||||
# <!-- markdownlint-restore -->
|
|
||||||
#
|
|
||||||
|
|
||||||
###############
|
|
||||||
# Rules by id #
|
|
||||||
###############
|
|
||||||
MD004: false # Unordered list style
|
|
||||||
MD007:
|
|
||||||
indent: 2 # Unordered list indentation
|
|
||||||
MD013:
|
|
||||||
line_length: 400 # Line length 80 is far to short
|
|
||||||
MD026:
|
|
||||||
punctuation: ".,;:!。,;:" # List of not allowed
|
|
||||||
MD029: false # Ordered list item prefix
|
|
||||||
MD033: false # Allow inline HTML
|
|
||||||
MD036: false # Emphasis used instead of a heading
|
|
||||||
|
|
||||||
#################
|
|
||||||
# Rules by tags #
|
|
||||||
#################
|
|
||||||
blank_lines: false # Error on blank lines
|
|
||||||
50
.github/workflows/linter.yml
vendored
50
.github/workflows/linter.yml
vendored
@@ -1,50 +0,0 @@
|
|||||||
---
|
|
||||||
###########################
|
|
||||||
###########################
|
|
||||||
## Linter GitHub Actions ##
|
|
||||||
###########################
|
|
||||||
###########################
|
|
||||||
name: Lint Code Base
|
|
||||||
|
|
||||||
#
|
|
||||||
# Documentation:
|
|
||||||
# https://help.github.com/en/articles/workflow-syntax-for-github-actions
|
|
||||||
#
|
|
||||||
|
|
||||||
#############################
|
|
||||||
# Start the job on all push #
|
|
||||||
#############################
|
|
||||||
on: [push, pull_request]
|
|
||||||
|
|
||||||
###############
|
|
||||||
# Set the Job #
|
|
||||||
###############
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
# Name the Job
|
|
||||||
name: Lint Code Base
|
|
||||||
# Set the agent to run on
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
##################
|
|
||||||
# Load all steps #
|
|
||||||
##################
|
|
||||||
steps:
|
|
||||||
##########################
|
|
||||||
# Checkout the code base #
|
|
||||||
##########################
|
|
||||||
- name: Checkout Code
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
# Full git history is needed to get a proper list of changed files within `super-linter`
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
################################
|
|
||||||
# Run Linter against code base #
|
|
||||||
################################
|
|
||||||
- name: Lint Code Base
|
|
||||||
uses: github/super-linter@v3
|
|
||||||
env:
|
|
||||||
VALIDATE_ALL_CODEBASE: false
|
|
||||||
DEFAULT_BRANCH: main
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
25
cloud/aws_key.yml
Normal file
25
cloud/aws_key.yml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
---
|
||||||
|
- name: Create AWS keypair
|
||||||
|
hosts: localhost
|
||||||
|
vars:
|
||||||
|
aws_key_name: aws-test-key
|
||||||
|
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: 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 }}"
|
||||||
185
cloud/setup.yml
185
cloud/setup.yml
@@ -1,14 +1,27 @@
|
|||||||
---
|
---
|
||||||
user_message:
|
user_message:
|
||||||
- Update AWS credential with Access and Secret key
|
|
||||||
- Update Workshop Credential with password used to login to Controller
|
|
||||||
|
|
||||||
controller_components:
|
controller_components:
|
||||||
|
- execution_environments
|
||||||
|
- projects
|
||||||
- credentials
|
- credentials
|
||||||
- inventory_sources
|
- inventory_sources
|
||||||
- groups
|
- groups
|
||||||
- job_templates
|
- job_templates
|
||||||
|
|
||||||
|
controller_execution_environments:
|
||||||
|
- name: Cloud Services Execution Environment
|
||||||
|
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
|
||||||
|
|
||||||
controller_credentials:
|
controller_credentials:
|
||||||
- name: AWS
|
- name: AWS
|
||||||
credential_type: Amazon Web Services
|
credential_type: Amazon Web Services
|
||||||
@@ -73,6 +86,66 @@ controller_groups:
|
|||||||
ansible_user: ec2-user
|
ansible_user: ec2-user
|
||||||
|
|
||||||
controller_templates:
|
controller_templates:
|
||||||
|
- name: Cloud / AWS / Create Peer Infrastructure
|
||||||
|
job_type: run
|
||||||
|
organization: Default
|
||||||
|
credentials:
|
||||||
|
- AWS
|
||||||
|
project: Ansible Cloud Content Lab - AWS
|
||||||
|
playbook: playbook_create_peer_network.yml
|
||||||
|
inventory: Workshop Inventory
|
||||||
|
notification_templates_started: Telemetry
|
||||||
|
notification_templates_success: Telemetry
|
||||||
|
notification_templates_error: Telemetry
|
||||||
|
extra_vars:
|
||||||
|
aws_region: us-east-1
|
||||||
|
dmz_ssh_key_name: aws-test-key
|
||||||
|
priv_network_ssh_key_name: aws-test-key
|
||||||
|
|
||||||
|
- name: Cloud / AWS / Delete Peer Infrastructure
|
||||||
|
job_type: run
|
||||||
|
organization: Default
|
||||||
|
credentials:
|
||||||
|
- AWS
|
||||||
|
project: Ansible Cloud Content Lab - AWS
|
||||||
|
playbook: playbook_delete_peer_network.yml
|
||||||
|
inventory: Workshop Inventory
|
||||||
|
notification_templates_started: Telemetry
|
||||||
|
notification_templates_success: Telemetry
|
||||||
|
notification_templates_error: Telemetry
|
||||||
|
extra_vars:
|
||||||
|
aws_region: us-east-1
|
||||||
|
|
||||||
|
- name: Cloud / AWS / Create Transit Infrastructure
|
||||||
|
job_type: run
|
||||||
|
organization: Default
|
||||||
|
credentials:
|
||||||
|
- AWS
|
||||||
|
project: Ansible Cloud Content Lab - AWS
|
||||||
|
playbook: playbook_create_transit_network.yml
|
||||||
|
inventory: Workshop Inventory
|
||||||
|
notification_templates_started: Telemetry
|
||||||
|
notification_templates_success: Telemetry
|
||||||
|
notification_templates_error: Telemetry
|
||||||
|
extra_vars:
|
||||||
|
aws_region: us-east-1
|
||||||
|
dmz_ssh_key_name: aws-test-key
|
||||||
|
priv_network_ssh_key_name: aws-test-key
|
||||||
|
|
||||||
|
- name: Cloud / AWS / Delete Transit Infrastructure
|
||||||
|
job_type: run
|
||||||
|
organization: Default
|
||||||
|
credentials:
|
||||||
|
- AWS
|
||||||
|
project: Ansible Cloud Content Lab - AWS
|
||||||
|
playbook: playbook_delete_transit_network.yml
|
||||||
|
inventory: Workshop Inventory
|
||||||
|
notification_templates_started: Telemetry
|
||||||
|
notification_templates_success: Telemetry
|
||||||
|
notification_templates_error: Telemetry
|
||||||
|
extra_vars:
|
||||||
|
aws_region: us-east-1
|
||||||
|
|
||||||
- name: Cloud / Create Infra
|
- name: Cloud / Create Infra
|
||||||
job_type: run
|
job_type: run
|
||||||
organization: Default
|
organization: Default
|
||||||
@@ -104,22 +177,22 @@ controller_templates:
|
|||||||
required: false
|
required: false
|
||||||
variable: aws_public_key
|
variable: aws_public_key
|
||||||
|
|
||||||
- name: Cloud / Create VM
|
- name: Cloud / AWS / Create VM
|
||||||
job_type: run
|
job_type: run
|
||||||
organization: Default
|
organization: Default
|
||||||
credentials:
|
credentials:
|
||||||
- AWS
|
- AWS
|
||||||
#- Azure
|
|
||||||
- Workshop Credential
|
- Workshop Credential
|
||||||
project: Ansible official demo project
|
project: Ansible Cloud Content Lab - AWS
|
||||||
playbook: cloud/create_vm.yml
|
playbook: playbook_create_vm.yml
|
||||||
inventory: Workshop Inventory
|
inventory: Workshop Inventory
|
||||||
notification_templates_started: Telemetry
|
notification_templates_started: Telemetry
|
||||||
notification_templates_success: Telemetry
|
notification_templates_success: Telemetry
|
||||||
notification_templates_error: Telemetry
|
notification_templates_error: Telemetry
|
||||||
survey_enabled: true
|
survey_enabled: true
|
||||||
extra_vars:
|
extra_vars:
|
||||||
aws_region: us-east-2
|
aws_region: us-east-1
|
||||||
|
aws_keypair_name: aws-test-key
|
||||||
survey:
|
survey:
|
||||||
name: ''
|
name: ''
|
||||||
description: ''
|
description: ''
|
||||||
@@ -132,45 +205,121 @@ controller_templates:
|
|||||||
type: text
|
type: text
|
||||||
variable: vm_owner
|
variable: vm_owner
|
||||||
required: true
|
required: true
|
||||||
- question_name: Provider
|
- question_name: Deployment
|
||||||
|
type: text
|
||||||
|
variable: vm_deployment
|
||||||
|
required: true
|
||||||
|
- question_name: Environment
|
||||||
type: multiplechoice
|
type: multiplechoice
|
||||||
variable: vm_provider
|
variable: vm_environment
|
||||||
required: true
|
required: true
|
||||||
choices:
|
choices:
|
||||||
- aws
|
- Dev
|
||||||
#- azure
|
- QA
|
||||||
|
- Prod
|
||||||
- question_name: Blueprint
|
- question_name: Blueprint
|
||||||
type: multiplechoice
|
type: multiplechoice
|
||||||
variable: vm_blueprint
|
variable: vm_blueprint
|
||||||
required: true
|
required: true
|
||||||
choices: #"{{ lookup('fileglob', 'blueprints/*.yml') | regex_replace(',','\n') | regex_findall('.*/(.*)(?=.yml)') | list }}"
|
choices:
|
||||||
- windows_core
|
- windows_core
|
||||||
- windows_full
|
- windows_full
|
||||||
- rhel9
|
- rhel9
|
||||||
- rhel8
|
- rhel8
|
||||||
- rhel7
|
- rhel7
|
||||||
|
- question_name: Subnet
|
||||||
|
type: text
|
||||||
|
variable: aws_vpc_subnet_name
|
||||||
|
required: true
|
||||||
|
default: dmz-subnet
|
||||||
|
- question_name: Security Group
|
||||||
|
type: text
|
||||||
|
variable: aws_securitygroup_name
|
||||||
|
required: true
|
||||||
|
default: dmz-sg
|
||||||
|
|
||||||
- name: Cloud / Destroy VM
|
- name: Cloud / AWS / Delete VM
|
||||||
job_type: run
|
job_type: run
|
||||||
organization: Default
|
organization: Default
|
||||||
credentials:
|
credentials:
|
||||||
- AWS
|
- AWS
|
||||||
#- Azure
|
|
||||||
- Workshop Credential
|
- Workshop Credential
|
||||||
project: Ansible official demo project
|
project: Ansible Cloud Content Lab - AWS
|
||||||
playbook: cloud/destroy_vm.yml
|
playbook: playbook_delete_inventory_vm.yml
|
||||||
inventory: Workshop Inventory
|
inventory: Workshop Inventory
|
||||||
notification_templates_started: Telemetry
|
notification_templates_started: Telemetry
|
||||||
notification_templates_success: Telemetry
|
notification_templates_success: Telemetry
|
||||||
notification_templates_error: Telemetry
|
notification_templates_error: Telemetry
|
||||||
survey_enabled: true
|
survey_enabled: true
|
||||||
extra_vars:
|
extra_vars:
|
||||||
aws_region: us-east-2
|
aws_region: us-east-1
|
||||||
survey:
|
survey:
|
||||||
name: ''
|
name: ''
|
||||||
description: ''
|
description: ''
|
||||||
spec:
|
spec:
|
||||||
- question_name: Name or Pattern
|
- question_name: Name or Pattern
|
||||||
type: text
|
type: text
|
||||||
variable: HOSTS
|
variable: _hosts
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- name: Cloud / AWS / VPC Report
|
||||||
|
job_type: run
|
||||||
|
organization: Default
|
||||||
|
credentials:
|
||||||
|
- AWS
|
||||||
|
project: Ansible Cloud Content Lab - AWS
|
||||||
|
playbook: playbook_create_reports.yml
|
||||||
|
inventory: Workshop Inventory
|
||||||
|
notification_templates_started: Telemetry
|
||||||
|
notification_templates_success: Telemetry
|
||||||
|
notification_templates_error: Telemetry
|
||||||
|
extra_vars:
|
||||||
|
aws_region: us-east-1
|
||||||
|
aws_report: vpc
|
||||||
|
|
||||||
|
- name: Cloud / AWS / Tags Report
|
||||||
|
job_type: run
|
||||||
|
organization: Default
|
||||||
|
credentials:
|
||||||
|
- AWS
|
||||||
|
project: Ansible Cloud Content Lab - AWS
|
||||||
|
playbook: playbook_create_reports.yml
|
||||||
|
inventory: Workshop Inventory
|
||||||
|
notification_templates_started: Telemetry
|
||||||
|
notification_templates_success: Telemetry
|
||||||
|
notification_templates_error: Telemetry
|
||||||
|
extra_vars:
|
||||||
|
aws_region: us-east-1
|
||||||
|
aws_report: tags
|
||||||
|
|
||||||
|
- name: Cloud / AWS / Create Keypair
|
||||||
|
job_type: run
|
||||||
|
organization: Default
|
||||||
|
credentials:
|
||||||
|
- AWS
|
||||||
|
project: Ansible official demo project
|
||||||
|
playbook: cloud/aws_key.yml
|
||||||
|
inventory: Workshop Inventory
|
||||||
|
notification_templates_started: Telemetry
|
||||||
|
notification_templates_success: Telemetry
|
||||||
|
notification_templates_error: Telemetry
|
||||||
|
survey_enabled: true
|
||||||
|
extra_vars:
|
||||||
|
aws_region: us-east-1
|
||||||
|
survey:
|
||||||
|
name: ''
|
||||||
|
description: ''
|
||||||
|
spec:
|
||||||
|
- question_name: Keypair Name
|
||||||
|
type: text
|
||||||
|
variable: aws_key_name
|
||||||
|
required: true
|
||||||
|
default: aws-test-key
|
||||||
|
- question_name: Keypair Public Key
|
||||||
|
type: textarea
|
||||||
|
variable: aws_public_key
|
||||||
|
required: true
|
||||||
|
- question_name: Owner
|
||||||
|
type: text
|
||||||
|
variable: aws_keypair_owner
|
||||||
required: true
|
required: true
|
||||||
|
|||||||
Reference in New Issue
Block a user