diff --git a/cloud/README.md b/cloud/README.md new file mode 100644 index 0000000..699e28c --- /dev/null +++ b/cloud/README.md @@ -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. \ No newline at end of file diff --git a/collections/ansible_collections/demo/patching/roles/report_linux/tasks/main.yml b/collections/ansible_collections/demo/patching/roles/report_linux/tasks/main.yml index cc3f64c..71d2364 100644 --- a/collections/ansible_collections/demo/patching/roles/report_linux/tasks/main.yml +++ b/collections/ansible_collections/demo/patching/roles/report_linux/tasks/main.yml @@ -2,12 +2,14 @@ ansible.builtin.template: src: report.j2 dest: "{{ file_path }}/linux.html" + check_mode: no - name: copy CSS over ansible.builtin.copy: src: "css" dest: "{{ file_path }}" directory_mode: true + check_mode: no - name: copy logos over ansible.builtin.copy: @@ -18,6 +20,7 @@ - "webpage_logo.png" - "redhat-ansible-logo.svg" - "server.png" + check_mode: no - name: display link to inventory report ansible.builtin.debug: diff --git a/linux/patching.yml b/linux/patching.yml index 3f5f4a0..3c83a8c 100644 --- a/linux/patching.yml +++ b/linux/patching.yml @@ -1,20 +1,38 @@ --- -- name: Apply Non-kernel Updates - hosts: "{{ HOSTS }}" - become: true - +- hosts: "{{ HOSTS }}" + become: yes + vars: + report_server: node1 + tasks: - - name: upgrade all packages except kernel - yum: - name: '*' - state: latest - exclude: kernel* - tags: all + - include_role: + name: demo.patching.patch_linux - - name: upgrade all packages security related except kernel - yum: - name: '*' - state: latest - security: true - exclude: kernel* - tags: security + - block: + - yum: + name: httpd + state: latest + check_mode: no + + - file: + path: /var/www/html/reports/ + state: directory + check_mode: no + + - copy: + dest: /var/www/html/reports/.htaccess + content: Options +Indexes + check_mode: no + + - service: + name: httpd + state: started + check_mode: no + + - include_role: + name: demo.patching.report_linux + + - include_role: + name: demo.patching.report_linux_patching + delegate_to: "{{ report_server }}" + run_once: yes \ No newline at end of file diff --git a/linux/setup.yml b/linux/setup.yml index 22c28f8..6ff275d 100644 --- a/linux/setup.yml +++ b/linux/setup.yml @@ -134,6 +134,8 @@ controller_templates: playbook: "linux/patching.yml" execution_environment: Default execution environment use_fact_cache: true + job_type: check + ask_job_type_on_launch: yes credentials: - "Workshop Credential" survey_enabled: true