diff --git a/.github/linters/.markdown-lint.yml b/.github/linters/.markdown-lint.yml deleted file mode 100644 index a0bc47d..0000000 --- a/.github/linters/.markdown-lint.yml +++ /dev/null @@ -1,6 +0,0 @@ -{ - "default": true, - "MD003": false, - "MD013": false, - "MD033": false -} \ No newline at end of file diff --git a/.github/linters/ansible-lint.yml b/.github/linters/ansible-lint.yml deleted file mode 100644 index 1339519..0000000 --- a/.github/linters/ansible-lint.yml +++ /dev/null @@ -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 diff --git a/.github/linters/markdown-lint.yml b/.github/linters/markdown-lint.yml deleted file mode 100644 index 89963f4..0000000 --- a/.github/linters/markdown-lint.yml +++ /dev/null @@ -1,35 +0,0 @@ ---- -########################### -########################### -## Markdown Linter rules ## -########################### -########################### - -# Linter rules doc: -# - https://github.com/DavidAnson/markdownlint -# -# Note: -# To comment out a single error: -# -# any violations you want -# -# - -############### -# 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 diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml deleted file mode 100644 index 592937a..0000000 --- a/.github/workflows/linter.yml +++ /dev/null @@ -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 }} diff --git a/cloud/aws_key.yml b/cloud/aws_key.yml new file mode 100644 index 0000000..275eec6 --- /dev/null +++ b/cloud/aws_key.yml @@ -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 }}" diff --git a/cloud/setup.yml b/cloud/setup.yml index 84726f8..97984e9 100644 --- a/cloud/setup.yml +++ b/cloud/setup.yml @@ -1,14 +1,27 @@ --- user_message: - - Update AWS credential with Access and Secret key - - Update Workshop Credential with password used to login to Controller controller_components: + - execution_environments + - projects - credentials - inventory_sources - groups - 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: - name: AWS credential_type: Amazon Web Services @@ -73,6 +86,66 @@ controller_groups: ansible_user: ec2-user 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 job_type: run organization: Default @@ -104,22 +177,22 @@ controller_templates: required: false variable: aws_public_key - - name: Cloud / Create VM + - name: Cloud / AWS / Create VM job_type: run organization: Default credentials: - AWS - #- Azure - Workshop Credential - project: Ansible official demo project - playbook: cloud/create_vm.yml + project: Ansible Cloud Content Lab - AWS + playbook: playbook_create_vm.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-2 + aws_region: us-east-1 + aws_keypair_name: aws-test-key survey: name: '' description: '' @@ -132,45 +205,121 @@ controller_templates: type: text variable: vm_owner required: true - - question_name: Provider + - question_name: Deployment + type: text + variable: vm_deployment + required: true + - question_name: Environment type: multiplechoice - variable: vm_provider + variable: vm_environment required: true choices: - - aws - #- azure + - Dev + - QA + - Prod - question_name: Blueprint type: multiplechoice variable: vm_blueprint required: true - choices: #"{{ lookup('fileglob', 'blueprints/*.yml') | regex_replace(',','\n') | regex_findall('.*/(.*)(?=.yml)') | list }}" + choices: - windows_core - windows_full - rhel9 - rhel8 - 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 organization: Default credentials: - AWS - #- Azure - Workshop Credential - project: Ansible official demo project - playbook: cloud/destroy_vm.yml + project: Ansible Cloud Content Lab - AWS + playbook: playbook_delete_inventory_vm.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-2 + aws_region: us-east-1 survey: name: '' description: '' spec: - question_name: Name or Pattern 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