diff --git a/cloud/setup.yml b/cloud/setup.yml index dc61b61..ab4dba8 100644 --- a/cloud/setup.yml +++ b/cloud/setup.yml @@ -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 - diff --git a/collections/requirements.yml b/collections/requirements.yml index 0d82843..a97d736 100644 --- a/collections/requirements.yml +++ b/collections/requirements.yml @@ -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 diff --git a/feedback.yml b/feedback.yml new file mode 100644 index 0000000..810ab1e --- /dev/null +++ b/feedback.yml @@ -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! diff --git a/linux/ec2_register.yml b/linux/ec2_register.yml index 258c190..c5df31b 100644 --- a/linux/ec2_register.yml +++ b/linux/ec2_register.yml @@ -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 }}" \ No newline at end of file + group: "{{ ansible_group }}" diff --git a/linux/setup.yml b/linux/setup.yml index 1f4bf2b..eac25be 100644 --- a/linux/setup.yml +++ b/linux/setup.yml @@ -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: diff --git a/network/setup.yml b/network/setup.yml index f2c2cc6..1764620 100644 --- a/network/setup.yml +++ b/network/setup.yml @@ -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: diff --git a/setup_demo.yml b/setup_demo.yml index c74dde2..06447ec 100644 --- a/setup_demo.yml +++ b/setup_demo.yml @@ -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 }}" diff --git a/windows/active_directory/create_ad_domain.yml b/windows/create_ad_domain.yml similarity index 100% rename from windows/active_directory/create_ad_domain.yml rename to windows/create_ad_domain.yml diff --git a/windows/active_directory/helpdesk_new_user_portal.yml b/windows/helpdesk_new_user_portal.yml similarity index 100% rename from windows/active_directory/helpdesk_new_user_portal.yml rename to windows/helpdesk_new_user_portal.yml diff --git a/windows/arbitrary_powershell.yml b/windows/powershell.yml similarity index 90% rename from windows/arbitrary_powershell.yml rename to windows/powershell.yml index 90d608d..ccba36f 100644 --- a/windows/arbitrary_powershell.yml +++ b/windows/powershell.yml @@ -1,5 +1,5 @@ --- -- name: Arbitrary PowerShell +- name: Run PowerShell hosts: "{{ HOSTS | default('windows') }}" gather_facts: false vars: diff --git a/windows/powershell_dsc.yml b/windows/powershell_dsc.yml index 7db3657..f283041 100644 --- a/windows/powershell_dsc.yml +++ b/windows/powershell_dsc.yml @@ -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: diff --git a/windows/powershell_script.yml b/windows/powershell_script.yml index 122e5ff..48ca142 100644 --- a/windows/powershell_script.yml +++ b/windows/powershell_script.yml @@ -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 diff --git a/windows/sample_script.ps1 b/windows/query_services.ps1 similarity index 100% rename from windows/sample_script.ps1 rename to windows/query_services.ps1 diff --git a/windows/setup.yml b/windows/setup.yml index 6b42eda..cddec4c 100644 --- a/windows/setup.yml +++ b/windows/setup.yml @@ -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 \ No newline at end of file + required: false diff --git a/windows/windows_choco_multiple.yml b/windows/windows_choco_multiple.yml index 83ea42b..d9c226d 100644 --- a/windows/windows_choco_multiple.yml +++ b/windows/windows_choco_multiple.yml @@ -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