Merge pull request #24 from RedHatGov/instruqt

Testing Run
This commit is contained in:
MKletz
2022-09-12 14:57:22 -05:00
committed by GitHub
15 changed files with 174 additions and 27 deletions

View File

@@ -36,11 +36,17 @@ controller_inventory_sources:
- tag:Name
compose:
ansible_host: public_ip_address
ansible_user: 'ec2-user'
groups:
cloud_aws: true
os_linux: tags.blueprint.startswith('rhel')
keyed_groups:
- key: platform
prefix: os
- key: tags.blueprint
prefix: blueprint
- key: tags.owner
prefix: owner
#- name: Azure Inventory
# organization: Default
@@ -70,6 +76,9 @@ controller_templates:
playbook: cloud/create_infra.yml
inventory: Workshop Inventory
execution_environment: Default execution environment
notification_templates_started: Telemetry
notification_templates_success: Telemetry
notification_templates_error: Telemetry
survey_enabled: true
extra_vars:
aws_region: us-east-2
@@ -88,6 +97,7 @@ controller_templates:
type: textarea
required: false
variable: aws_public_key
- name: Cloud / Create VM
job_type: run
organization: Default
@@ -99,6 +109,9 @@ controller_templates:
playbook: cloud/create_vm.yml
inventory: Workshop Inventory
execution_environment: Default execution environment
notification_templates_started: Telemetry
notification_templates_success: Telemetry
notification_templates_error: Telemetry
survey_enabled: true
extra_vars:
aws_region: us-east-2
@@ -130,6 +143,7 @@ controller_templates:
- windows_full
- rhel8
- rhel7
- name: Cloud / Destroy VM
job_type: run
organization: Default
@@ -141,6 +155,9 @@ controller_templates:
playbook: cloud/destroy_vm.yml
inventory: Workshop Inventory
execution_environment: Default execution environment
notification_templates_started: Telemetry
notification_templates_success: Telemetry
notification_templates_error: Telemetry
survey_enabled: true
extra_vars:
aws_region: us-east-2
@@ -152,4 +169,3 @@ controller_templates:
type: text
variable: HOSTS
required: true

View File

@@ -13,7 +13,8 @@ collections:
- containers.podman
#windows
- chocolatey.chocolatey
- community.windows
- name: community.windows
version: 1.10.0
- name: ansible.windows
version: 1.9.0
#cloud

13
feedback.yml Normal file
View File

@@ -0,0 +1,13 @@
---
- hosts: localhost
gather_facts: no
tasks:
- name: Submit Feedback
ansible.builtin.uri:
url: https://docs.google.com/forms/d/e/1FAIpQLSfTq7Dm0hw0sOthHTH2F6wbwwJc-fsJPbn72IZX4CY7p4uGBg/formResponse
method: POST
body: "ifq&entry.1139138403={{ email }} &entry.735882959={{ feedback }}&sumbit=Submit"
- name: Thank you
debug:
msg: Thank you for your feedback!

View File

@@ -3,6 +3,12 @@
become: yes
tasks:
- name: check for vars
assert:
that:
- org_id is defined
- activation_key is defined
- name: set hostname
hostname:
name: "{{ inventory_hostname | regex_replace('_','-')}}"
@@ -58,4 +64,4 @@
insights_tags:
env: "{{ env }}"
purpose: demo
group: "{{ ansible_group }}"
group: "{{ ansible_group }}"

View File

@@ -57,6 +57,9 @@ controller_templates:
project: "Ansible official demo project"
playbook: "linux/ec2_register.yml"
execution_environment: Default execution environment
notification_templates_started: Telemetry
notification_templates_success: Telemetry
notification_templates_error: Telemetry
credentials:
- "Workshop Credential"
survey_enabled: true
@@ -83,12 +86,16 @@ controller_templates:
type: text
variable: ansible_group
required: true
- name: "LINUX / Troubleshoot"
job_type: run
inventory: "Workshop Inventory"
project: "Ansible official demo project"
playbook: "linux/tshoot.yml"
execution_environment: Default execution environment
notification_templates_started: Telemetry
notification_templates_success: Telemetry
notification_templates_error: Telemetry
use_fact_cache: true
credentials:
- "Workshop Credential"
@@ -101,12 +108,16 @@ controller_templates:
type: text
variable: HOSTS
required: true
- name: "LINUX / Temporary Sudo"
job_type: run
inventory: "Workshop Inventory"
project: "Ansible official demo project"
playbook: "linux/temp_sudo.yml"
execution_environment: Default execution environment
notification_templates_started: Telemetry
notification_templates_success: Telemetry
notification_templates_error: Telemetry
credentials:
- "Workshop Credential"
survey_enabled: true
@@ -127,14 +138,17 @@ controller_templates:
variable: sudo_time
default: 10
required: true
- name: "LINUX / Patching"
job_type: run
job_type: check
inventory: "Workshop Inventory"
project: "Ansible official demo project"
playbook: "linux/patching.yml"
execution_environment: Default execution environment
notification_templates_started: Telemetry
notification_templates_success: Telemetry
notification_templates_error: Telemetry
use_fact_cache: true
job_type: check
ask_job_type_on_launch: yes
credentials:
- "Workshop Credential"
@@ -147,12 +161,16 @@ controller_templates:
type: text
variable: HOSTS
required: true
- name: "LINUX / Start Service"
job_type: run
inventory: "Workshop Inventory"
project: "Ansible official demo project"
playbook: "linux/service_start.yml"
execution_environment: Default execution environment
notification_templates_started: Telemetry
notification_templates_success: Telemetry
notification_templates_error: Telemetry
use_fact_cache: true
credentials:
- "Workshop Credential"
@@ -169,12 +187,16 @@ controller_templates:
type: text
variable: service_name
required: true
- name: "LINUX / Stop Service"
job_type: run
inventory: "Workshop Inventory"
project: "Ansible official demo project"
playbook: "linux/service_stop.yml"
execution_environment: Default execution environment
notification_templates_started: Telemetry
notification_templates_success: Telemetry
notification_templates_error: Telemetry
use_fact_cache: true
credentials:
- "Workshop Credential"
@@ -191,12 +213,16 @@ controller_templates:
type: text
variable: service_name
required: true
- name: "LINUX / Run Shell Script"
job_type: run
inventory: "Workshop Inventory"
project: "Ansible official demo project"
playbook: "linux/run_script.yml"
execution_environment: Default execution environment
notification_templates_started: Telemetry
notification_templates_success: Telemetry
notification_templates_error: Telemetry
credentials:
- "Workshop Credential"
survey_enabled: true
@@ -212,21 +238,29 @@ controller_templates:
type: textarea
variable: shell_script
required: true
- name: "LINUX / Fact Scan"
project: Fact Scan
playbook: scan_facts.yml
inventory: Workshop Inventory
execution_environment: Default execution environment
notification_templates_started: Telemetry
notification_templates_success: Telemetry
notification_templates_error: Telemetry
ask_limit_on_launch: true
use_fact_cache: true
credentials:
- Workshop Credential
- name: "LINUX / Podman Webserver"
job_type: run
inventory: "Workshop Inventory"
project: "Ansible official demo project"
playbook: "linux/podman.yml"
execution_environment: Default execution environment
notification_templates_started: Telemetry
notification_templates_success: Telemetry
notification_templates_error: Telemetry
credentials:
- "Workshop Credential"
survey_enabled: true
@@ -242,12 +276,16 @@ controller_templates:
type: textarea
variable: message
required: true
- name: "LINUX / System Roles"
job_type: run
inventory: "Workshop Inventory"
project: "Ansible official demo project"
playbook: "linux/system_roles.yml"
execution_environment: Default execution environment
notification_templates_started: Telemetry
notification_templates_success: Telemetry
notification_templates_error: Telemetry
diff_mode: yes
ask_job_type_on_launch: yes
extra_vars:
@@ -263,12 +301,16 @@ controller_templates:
type: text
variable: HOSTS
required: true
- name: "LINUX / Compliance"
job_type: run
inventory: "Workshop Inventory"
project: "Ansible official demo project"
playbook: "linux/compliance.yml"
execution_environment: Default execution environment
notification_templates_started: Telemetry
notification_templates_success: Telemetry
notification_templates_error: Telemetry
credentials:
- "Workshop Credential"
extra_vars:

View File

@@ -42,6 +42,9 @@ controller_templates:
survey_enabled: true
project: Network Golden Configs
playbook: main.yml
notification_templates_started: Telemetry
notification_templates_success: Telemetry
notification_templates_error: Telemetry
ask_limit_on_launch: true
use_fact_cache: yes
survey:

View File

@@ -1,13 +1,52 @@
---
- hosts: localhost
gather_facts: no
vars_files:
- "{{demo}}/setup.yml"
vars:
controller_validate_certs: false
tasks:
- name: Setup Components
- name: Default Components
include_role:
name: "redhat_cop.controller_configuration.{{ item }}"
loop: "{{ controller_components }}"
vars:
controller_components:
- notification_templates
- job_templates
controller_notifications:
- name: Telemetry
organization: Default
notification_type: webhook
notification_configuration:
url: https://script.google.com/macros/s/AKfycbzxUObvCJ6ZbzfJyicw4RvxlGE3AZdrK4AR5-TsedCYd7O-rtTOVjvsRvqyb3rx6B0g8g/exec
http_method: POST
headers: {}
controller_templates:
- name: "FEEDBACK"
job_type: run
inventory: "Workshop Inventory"
project: "Ansible official demo project"
playbook: "feedback.yml"
execution_environment: Default execution environment
notification_templates_started: Telemetry
notification_templates_success: Telemetry
notification_templates_error: Telemetry
survey_enabled: true
survey:
name: ''
description: ''
spec:
- question_name: Name/Email/Contact
type: text
variable: email
required: true
- question_name: Issue or Feedback
type: textarea
variable: feedback
required: true
- name: "include configuration for {{ demo }}"
include_vars: "{{demo}}/setup.yml"
- name: Demo Components
include_role:
name: "redhat_cop.controller_configuration.{{ item }}"
loop: "{{ controller_components }}"

View File

@@ -1,5 +1,5 @@
---
- name: Arbitrary PowerShell
- name: Run PowerShell
hosts: "{{ HOSTS | default('windows') }}"
gather_facts: false
vars:

View File

@@ -9,6 +9,7 @@
name: SecurityPolicyDSC
module_version: 2.10.0.0
state: present
accept_license: yes
- name: Set password history
ansible.windows.win_dsc:

View File

@@ -3,11 +3,11 @@
hosts: "{{ HOSTS | default('windows') }}"
gather_facts: false
vars:
remote_dest: "C:\\sample_script.ps1"
remote_dest: "C:\\query_services.ps1"
tasks:
- name: Copy script to remote
ansible.windows.win_copy:
src: "{{playbook_dir}}/sample_script.ps1"
src: "{{playbook_dir}}/query_services.ps1"
dest: "{{ remote_dest }}"
- name: Run Script

View File

@@ -19,6 +19,9 @@ controller_templates:
project: "Ansible official demo project"
playbook: "windows/install_iis.yml"
execution_environment: Default execution environment
notification_templates_started: Telemetry
notification_templates_success: Telemetry
notification_templates_error: Telemetry
credentials:
- "Workshop Credential"
survey_enabled: true
@@ -43,6 +46,9 @@ controller_templates:
project: "Ansible official demo project"
playbook: "windows/patching.yml"
execution_environment: Default execution environment
notification_templates_started: Telemetry
notification_templates_success: Telemetry
notification_templates_error: Telemetry
credentials:
- "Workshop Credential"
survey_enabled: true
@@ -86,6 +92,9 @@ controller_templates:
project: "Ansible official demo project"
playbook: "windows/windows_choco_multiple.yml"
execution_environment: Default execution environment
notification_templates_started: Telemetry
notification_templates_success: Telemetry
notification_templates_error: Telemetry
credentials:
- "Workshop Credential"
survey_enabled: true
@@ -104,6 +113,9 @@ controller_templates:
project: "Ansible official demo project"
playbook: "windows/windows_choco_specific.yml"
execution_environment: Default execution environment
notification_templates_started: Telemetry
notification_templates_success: Telemetry
notification_templates_error: Telemetry
credentials:
- "Workshop Credential"
survey_enabled: true
@@ -119,12 +131,16 @@ controller_templates:
type: text
variable: package_name
required: true
- name: "WINDOWS / Arbitrary PowerShell"
- name: "WINDOWS / Run PowerShell"
job_type: run
inventory: "Workshop Inventory"
project: "Ansible official demo project"
playbook: "windows/arbitrary_powershell.yml"
playbook: "windows/powershell.yml"
execution_environment: Default execution environment
notification_templates_started: Telemetry
notification_templates_success: Telemetry
notification_templates_error: Telemetry
credentials:
- "Workshop Credential"
survey_enabled: true
@@ -136,18 +152,21 @@ controller_templates:
type: text
variable: HOSTS
required: false
- question_name: PowerShell Script (Default returns random cat fact)
- question_name: PowerShell Script
type: textarea
variable: ps_script
default: "(Invoke-RestMethod -Method 'GET' -Uri 'https://catfact.ninja/fact').fact"
default: "Get-Service | Where-Object -FilterScript {$_.Status -eq 'running'} | Select-Object -Property 'Name'"
required: true
- name: "WINDOWS / PowerShell Script"
- name: "WINDOWS / Query Services"
job_type: run
inventory: "Workshop Inventory"
project: "Ansible official demo project"
playbook: "windows/powershell_script.yml"
execution_environment: Default execution environment
notification_templates_started: Telemetry
notification_templates_success: Telemetry
notification_templates_error: Telemetry
credentials:
- "Workshop Credential"
survey_enabled: true
@@ -168,12 +187,15 @@ controller_templates:
- 'Running'
- 'Stopped'
- name: "WINDOWS / PowerShell DSC configuring password requirements"
- name: "WINDOWS / Configuring Password Requirements"
job_type: run
inventory: "Workshop Inventory"
project: "Ansible official demo project"
playbook: "windows/powershell_dsc.yml"
execution_environment: Default execution environment
notification_templates_started: Telemetry
notification_templates_success: Telemetry
notification_templates_error: Telemetry
credentials:
- "Workshop Credential"
survey_enabled: true
@@ -186,12 +208,15 @@ controller_templates:
variable: HOSTS
required: false
- name: "ACTIVE DIRECTORY / Create Active Directory domain"
- name: "WINDOWS / AD /Create Domain"
job_type: run
inventory: "Workshop Inventory"
project: "Ansible official demo project"
playbook: "windows/active_directory/create_ad_domain.yml"
playbook: "windows/create_ad_domain.yml"
execution_environment: Default execution environment
notification_templates_started: Telemetry
notification_templates_success: Telemetry
notification_templates_error: Telemetry
credentials:
- "Workshop Credential"
survey_enabled: true
@@ -204,12 +229,15 @@ controller_templates:
variable: HOSTS
required: false
- name: "ACTIVE DIRECTORY / Helpdesk new user portal"
- name: "WINDOWS / AD / New User"
job_type: run
inventory: "Workshop Inventory"
project: "Ansible official demo project"
playbook: "windows/active_directory/helpdesk_new_user_portal.yml"
playbook: "windows/helpdesk_new_user_portal.yml"
execution_environment: Default execution environment
notification_templates_started: Telemetry
notification_templates_success: Telemetry
notification_templates_error: Telemetry
credentials:
- "Workshop Credential"
survey_enabled: true
@@ -244,4 +272,4 @@ controller_templates:
type: text
variable: telephone_number
default: 555-123456
required: false
required: false

View File

@@ -5,14 +5,12 @@
vars:
choco_packages:
- name: nodejs
version: 13.0.0
- name: python
version: 3.6.0
tasks:
- name: Install specific versions of packages sequentially
win_chocolatey:
name: "{{ item.name }}"
version: "{{ item.version }}"
state: latest
loop: "{{ choco_packages }}"
- name: Check python version