Add cloud and patching demos (#9)

Add demos for cloud provisioning and patching
This commit is contained in:
willtome
2022-03-29 14:01:28 -05:00
committed by GitHub
parent d162dcdb50
commit 8e56c5bbf6
88 changed files with 3273 additions and 18 deletions

34
cloud/README.md Normal file
View File

@@ -0,0 +1,34 @@
# Ansible Cloud Demos
## Setup
> These steps may differ if you in your environment
### Add AWS Credentials
1) Add AWS Access and Secret key to the AWS Credential created by the setup job
### Add Workshop Credential Password
1) Add the password used to login to Controller. This allows you to connect to Windows Servers provisioned with Create VM job. Required until [RFE](https://github.com/ansible/workshops/issues/1597]) is complete
### Remove Inventory Variables
1) Remove Workshop Inventory variables on the Details page of the inventory. Required until [RFE](https://github.com/ansible/workshops/issues/1597]) is complete
### Getting your Puiblic Key for Create Infra Job
1) Connect to the command line of your Controller server. This is easiest to do by opening the VS Code Web Editor from the landing page where you found the Controller login details.
2) Open a Terminal Window in the VS Code Web Editor.
3) SSH to one of your linux nodes (eg. `ssh node1`). This should log you into the node as `ec2-user`
4) `cat .ssh/authorized_keys` and copy the key listed including the `ssh-rsa` prefix
## Demos
### Cloud / Create Infra
The Create Infra job builds cloud infrastructure based on the provider definition in the included `demo.cloud` collection.
### Cloud / Create VM
The Create VM job builds a VM in the given provider based on the included `demo.cloud` collection. VM blueprints define variables for each provider that override the collection roles.

View File

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

15
cloud/destroy_vm.yml Normal file
View File

@@ -0,0 +1,15 @@
---
- hosts: "{{ HOSTS }}"
gather_facts: no
tasks:
- name: list systems to be destroyed
pause:
seconds: 30
prompt: "{{ inventory_hostname }} will be DESTROYED in 30 seconds. Cancel the job to Abort."
- name: destroy vm
include_role:
name: "demo.cloud.aws"
tasks_from: destroy_vm
when: "'cloud_aws' in group_names"