Merge of RedHatGov/product-demos (#56)

Co-authored-by: MKletz <michael.kletz.27@gmail.com>
Co-authored-by: Ajay Chenampara <ajay.chenampara@gmail.com>
Co-authored-by: dlemons-redhat <69318976+dlemons-redhat@users.noreply.github.com>
Co-authored-by: Nicolas Leiva <nicolasleiva@gmail.com>
Co-authored-by: benblasco <42140583+benblasco@users.noreply.github.com>
Co-authored-by: Benjamin Blasco <bblasco@redhat.com>
Co-authored-by: calvingsmith <4283930+calvingsmith@users.noreply.github.com>
Co-authored-by: Calvin Smith <calvingsmith@users.noreply.github.com>
Co-authored-by: Hicham Mourad <43329991+HichamMourad@users.noreply.github.com>
This commit is contained in:
willtome
2023-03-17 09:07:02 -04:00
committed by GitHub
parent 8acff9c9b1
commit c18a206499
279 changed files with 5191 additions and 4649 deletions

View File

@@ -1,38 +1,46 @@
---
- hosts: "{{ HOSTS }}"
become: yes
- name: Linux server patching
hosts: "{{ _hosts | default(omit) }}"
become: true
vars:
report_server: node1
tasks:
- include_role:
name: demo.patching.patch_linux
# Install yum-utils if it's not there
- name: Install yum-utils
ansible.builtin.yum:
name: yum-utils
state: installed
- block:
- yum:
name: httpd
state: latest
check_mode: no
- name: Include patching role
ansible.builtin.include_role:
name: demo.patching.patch_linux
- file:
path: /var/www/html/reports/
state: directory
check_mode: no
- name: Tell user when Insights Client is not configured
ansible.builtin.debug:
msg: "Insights client does not appear to be configured. Scan will be skipped"
when:
- ansible_local.insights.system_id is not defined
- copy:
dest: /var/www/html/reports/.htaccess
content: Options +Indexes
check_mode: no
- name: Run the Insights Client Scan # noqa: no-changed-when
ansible.builtin.command: insights-client
when:
- not ansible_check_mode
- ansible_local.insights.system_id is defined
- service:
name: httpd
state: started
check_mode: no
- name: Deploy report server
delegate_to: "{{ report_server }}"
run_once: true # noqa: run-once[task]
block:
- name: Build report server
ansible.builtin.include_role:
name: "{{ item }}"
loop:
- demo.patching.report_server
- demo.patching.report_linux
- demo.patching.report_linux_patching
- include_role:
name: demo.patching.report_linux
- include_role:
name: demo.patching.report_linux_patching
delegate_to: "{{ report_server }}"
run_once: yes
- name: Publish landing page
ansible.builtin.include_role:
name: demo.patching.report_server
tasks_from: linux_landing_page