From c091c76c3d230f8352300a19cdf34c4df15b199f Mon Sep 17 00:00:00 2001 From: ipvsean Date: Mon, 9 Mar 2020 15:53:16 -0400 Subject: [PATCH] clean up product demo readme to generate on flat-files --- README.md | 57 ++++++++------- playbooks/generate_readme.yml | 14 ++-- .../group_vars/all/01_deploy_application.yml | 31 ++++---- playbooks/group_vars/all/02_patching.yml | 17 ++--- playbooks/group_vars/all/03_hardening.yml | 73 +++++++++---------- roles/generate_readme/templates/readme.j2 | 3 +- 6 files changed, 97 insertions(+), 98 deletions(-) diff --git a/README.md b/README.md index 9164ef9..1619cc2 100644 --- a/README.md +++ b/README.md @@ -26,11 +26,20 @@ ansible-playbook playbooks/install_demo.yml -e @choose_demo.yml Video Walkthrough Workshop Types + - Create Developer Report - Sean Cavanaugh -
demo: developer_report
- Create HTML report using Ansible facts + SERVER / Fact Scan + Will Tome +
demo: fact_scan
+ scan facts for Linux and Windows systems + Not available + + + + SERVER / Patching + Will Tome +
demo: patching
+ patching for Linux servers Not available @@ -42,22 +51,6 @@ ansible-playbook playbooks/install_demo.yml -e @choose_demo.yml Not available - - Deploy Application (survey) - Sean Cavanaugh -
demo: deploy_application
- install yum applications on Linux with a survey - Video Link - - - - SERVER / Fact Scan - Will Tome -
demo: fact_scan
- scan facts for Linux and Windows systems - Not available - - SERVER / Hardening Will Tome @@ -66,14 +59,6 @@ ansible-playbook playbooks/install_demo.yml -e @choose_demo.yml Not available - - SERVER / Patching - Will Tome -
demo: patching
- patching for Linux servers - Not available - - Windows IIS Server Colin McNaughton @@ -82,6 +67,22 @@ ansible-playbook playbooks/install_demo.yml -e @choose_demo.yml Not available + + Deploy Application (survey) + Sean Cavanaugh +
demo: deploy_application
+ install yum applications on Linux with a survey + Video Link + + + + Create Developer Report + Sean Cavanaugh +
demo: developer_report
+ Create HTML report using Ansible facts + Not available + + # Contribute diff --git a/playbooks/generate_readme.yml b/playbooks/generate_readme.yml index 06250f5..0a6983c 100644 --- a/playbooks/generate_readme.yml +++ b/playbooks/generate_readme.yml @@ -4,11 +4,11 @@ connection: local tasks: - - name: install demo - debug: - msg: "{{item.key}}" - loop: "{{ hostvars['localhost']|dict2items }}" - when: "item.key[:8] != 'ansible_'" # - name: install demo - # include_role: - # name: "../roles/generate_readme" + # debug: + # msg: "{{item}}" + # loop: "{{dict(hostvars[inventory_hostname]|dictsort|rejectattr('0', 'match', 'ansible_')|selectattr('1.name', 'defined'))|dict2items}}" + + - name: install demo + include_role: + name: "../roles/generate_readme" diff --git a/playbooks/group_vars/all/01_deploy_application.yml b/playbooks/group_vars/all/01_deploy_application.yml index 196f231..4114e5f 100644 --- a/playbooks/group_vars/all/01_deploy_application.yml +++ b/playbooks/group_vars/all/01_deploy_application.yml @@ -8,7 +8,21 @@ deploy_application: playbook: "playbooks/01_deploy_application.yml" credential: "Workshop Credential" survey_enabled: yes - survey_spec: "{{survey_deploy_application}}" + survey_spec: + name: Deploy application survey + description: Which application do you want to install? + spec: + - type: multiplechoice + question_name: Select a command you would like to execute + question_description: select the application + variable: application + required: true + default: httpd + choices: + - httpd + - nginx + - htop + - gdb video: "https://www.youtube.com/watch?v=pU8ZgSBuEJw&list=PLdu06OJoEf2bp-PNtxPP_2n7Avkax8TED" project: name: "Ansible official demo project" @@ -19,18 +33,3 @@ deploy_application: workshop_type: - f5 - rhel -survey_deploy_application: - name: Deploy application survey - description: Which application do you want to install? - spec: - - type: multiplechoice - question_name: Select a command you would like to execute - question_description: select the application - variable: application - required: true - default: httpd - choices: - - httpd - - nginx - - htop - - gdb diff --git a/playbooks/group_vars/all/02_patching.yml b/playbooks/group_vars/all/02_patching.yml index 8a33b48..c2c5a54 100644 --- a/playbooks/group_vars/all/02_patching.yml +++ b/playbooks/group_vars/all/02_patching.yml @@ -8,7 +8,14 @@ patching: playbook: "playbooks/02_patching.yml" credential: "Workshop Credential" survey_enabled: yes - survey_spec: "{{survey_patching}}" + survey_spec: + name: '' + description: '' + spec: + - question_name: 'Enter host to configure' + type: text + variable: HOSTS + required: false project: name: "Ansible official demo project" description: "prescriptive demos from Red Hat Management Buisness Unit" @@ -18,11 +25,3 @@ patching: workshop_type: - f5 - rhel -survey_patching: - name: '' - description: '' - spec: - - question_name: 'Enter host to configure' - type: text - variable: HOSTS - required: false diff --git a/playbooks/group_vars/all/03_hardening.yml b/playbooks/group_vars/all/03_hardening.yml index 5e3bcf0..ac09de9 100644 --- a/playbooks/group_vars/all/03_hardening.yml +++ b/playbooks/group_vars/all/03_hardening.yml @@ -8,7 +8,42 @@ hardening: playbook: "playbooks/03_hardening.yml" credential: "Workshop Credential" survey_enabled: yes - survey_spec: "{{survey_hardening}}" + survey_spec: + name: '' + description: '' + spec: + - question_name: 'Enter host to configure' + type: text + variable: HOSTS + required: false + - question_name: Configure Firewall? + type: multiplechoice + variable: harden_firewall + required: false + choices: + - 'Yes' + - 'No' + - question_name: Configure Time? + type: multiplechoice + variable: harden_time + required: false + choices: + - 'Yes' + - 'No' + - question_name: Harden SSH? + type: multiplechoice + variable: harden_ssh + required: false + choices: + - 'Yes' + - 'No' + - question_name: PCI Baseline? + type: multiplechoice + variable: harden_pci + required: false + choices: + - 'Yes' + - 'No' project: name: "Ansible official demo project" description: "prescriptive demos from Red Hat Management Buisness Unit" @@ -18,39 +53,3 @@ hardening: workshop_type: - f5 - rhel -survey_hardening: - name: '' - description: '' - spec: - - question_name: 'Enter host to configure' - type: text - variable: HOSTS - required: false - - question_name: Configure Firewall? - type: multiplechoice - variable: harden_firewall - required: false - choices: - - 'Yes' - - 'No' - - question_name: Configure Time? - type: multiplechoice - variable: harden_time - required: false - choices: - - 'Yes' - - 'No' - - question_name: Harden SSH? - type: multiplechoice - variable: harden_ssh - required: false - choices: - - 'Yes' - - 'No' - - question_name: PCI Baseline? - type: multiplechoice - variable: harden_pci - required: false - choices: - - 'Yes' - - 'No' diff --git a/roles/generate_readme/templates/readme.j2 b/roles/generate_readme/templates/readme.j2 index a0260cb..efc0d66 100644 --- a/roles/generate_readme/templates/readme.j2 +++ b/roles/generate_readme/templates/readme.j2 @@ -26,7 +26,8 @@ ansible-playbook playbooks/install_demo.yml -e @choose_demo.yml Video Walkthrough Workshop Types -{% for key, value in demos.items()|sort(attribute='1.name') %} + +{% for key, value in hostvars[inventory_hostname].items()|rejectattr('0', 'match', 'ansible_')|selectattr('1.name', 'defined') %} {{value.name}} {{value.author}}