cleaning up syntax to get better score

This commit is contained in:
ipvsean
2020-04-22 00:18:34 -04:00
parent 3239f2ee6a
commit e765954726
14 changed files with 741 additions and 55 deletions

View File

@@ -4,9 +4,13 @@ galaxy_info:
author: Sean Cavanaugh
description: This role create an HTML report using Ansible Facts
company: Red Hat
platforms:
- name: EL
versions:
- 8
- 7
license: license (GPLv2, CC-BY, etc)
license: GPL-3.0-or-later
min_ansible_version: 2.9

View File

@@ -20,13 +20,13 @@
<tbody>
{% for linux_node in groups['all'] %}
<tr>
<td>{{hostvars[linux_node]['ansible_hostname']}}</td>
<td>{{hostvars[linux_node]['ansible_distribution']}} {{hostvars[linux_node]['ansible_distribution_version']}}</td>
<td>{{hostvars[linux_node]['ansible_env']['PATH']}}</td>
<td>{{hostvars[linux_node]['ansible_kernel']}}</td>
<td>{{hostvars[linux_node]['ansible_python_version']}}</td>
<td>{{hostvars[linux_node]['ansible_pkg_mgr']}}</td>
<td>{{hostvars[linux_node]['ansible_date_time']['date']}}</td>
<td>{{ hostvars[linux_node]['ansible_hostname'] }}</td>
<td>{{ hostvars[linux_node]['ansible_distribution'] }} {{hostvars[linux_node]['ansible_distribution_version']}}</td>
<td>{{ hostvars[linux_node]['ansible_env']['PATH'] }}</td>
<td>{{ hostvars[linux_node]['ansible_kernel'] }}</td>
<td>{{ hostvars[linux_node]['ansible_python_version'] }}</td>
<td>{{ hostvars[linux_node]['ansible_pkg_mgr'] }}</td>
<td>{{ hostvars[linux_node]['ansible_date_time']['date'] }}</td>
</tr>
{% endfor %}

View File

@@ -4,9 +4,13 @@ galaxy_info:
author: Sean Cavanaugh
description: This role generates a readme for the github/ansible/product-demos
company: Red Hat
platforms:
- name: EL
versions:
- 8
- 7
license: license (GPLv2, CC-BY, etc)
license: GPL-3.0-or-later
min_ansible_version: 2.9

View File

@@ -66,12 +66,12 @@ This repository currently holds {{hostvars[inventory_hostname].items()|rejectatt
<th>Workshop Types</th>
</tr>
{% for key, value in hostvars[inventory_hostname].items()|rejectattr('0', 'match', 'ansible_')|selectattr('1.name', 'defined')|selectattr('1.category', 'match', 'network$')|sort(attribute='1.name') %} <tr>
<td>{{value.name}}</td>
<td>{{value.author}}</td>
<td><pre>demo: {{key}}</pre></td>
<td>{{value.description}}</td>
<td>{% if value.video is defined%}<a href="{{ value.video}}">Video Link</a>{% else %}Not available {% endif %}</td>
<td><ul>{% for workshop in value.workshop_type %}<li>{{workshop}}</li>{% endfor %}</ul></td>
<td>{{ value.name }}</td>
<td>{{ value.author }}</td>
<td><pre>demo: {{key }}</pre></td>
<td>{{ value.description }}</td>
<td>{% if value.video is defined %}<a href="{{ value.video }}">Video Link</a>{% else %}Not available {% endif %}</td>
<td><ul>{% for workshop in value.workshop_type %}<li>{{ workshop }}</li>{% endfor %}</ul></td>
</tr>
{% endfor %}
</table>
@@ -88,12 +88,12 @@ This repository currently holds {{hostvars[inventory_hostname].items()|rejectatt
<th>Workshop Types</th>
</tr>
{% for key, value in hostvars[inventory_hostname].items()|rejectattr('0', 'match', 'ansible_')|selectattr('1.name', 'defined')|selectattr('1.category', 'match', 'security$')|sort(attribute='1.name') %} <tr>
<td>{{value.name}}</td>
<td>{{value.author}}</td>
<td><pre>demo: {{key}}</pre></td>
<td>{{value.description}}</td>
<td>{% if value.video is defined%}<a href="{{ value.video}}">Video Link</a>{% else %}Not available {% endif %}</td>
<td><ul>{% for workshop in value.workshop_type %}<li>{{workshop}}</li>{% endfor %}</ul></td>
<td>{{ value.name }}</td>
<td>{{ value.author }}</td>
<td><pre>demo: {{ key }}</pre></td>
<td>{{ value.description }}</td>
<td>{% if value.video is defined %}<a href="{{ value.video }}">Video Link</a>{% else %}Not available {% endif %}</td>
<td><ul>{% for workshop in value.workshop_type %}<li>{{ workshop }}</li>{% endfor %}</ul></td>
</tr>
{% endfor %}
</table>
@@ -110,12 +110,12 @@ This repository currently holds {{hostvars[inventory_hostname].items()|rejectatt
<th>Workshop Types</th>
</tr>
{% for key, value in hostvars[inventory_hostname].items()|rejectattr('0', 'match', 'ansible_')|selectattr('1.name', 'defined')|selectattr('1.category', 'match', 'developer$')|sort(attribute='1.name') %} <tr>
<td>{{value.name}}</td>
<td>{{value.author}}</td>
<td><pre>demo: {{key}}</pre></td>
<td>{{value.description}}</td>
<td>{% if value.video is defined%}<a href="{{ value.video}}">Video Link</a>{% else %}Not available {% endif %}</td>
<td><ul>{% for workshop in value.workshop_type %}<li>{{workshop}}</li>{% endfor %}</ul></td>
<td>{{ value.name }}</td>
<td>{{ value.author }}</td>
<td><pre>demo: {{ key }}</pre></td>
<td>{{ value.description }}</td>
<td>{% if value.video is defined %}<a href="{{ value.video }}">Video Link</a>{% else %}Not available {% endif %}</td>
<td><ul>{% for workshop in value.workshop_type %}<li>{{ workshop }}</li>{% endfor %}</ul></td>
</tr>
{% endfor %}
</table>
@@ -127,7 +127,7 @@ please refer to the [contribute.md](docs/contribute.md) documentation included i
# Notes
This README.md was auto-generated by Ansible user **{{ansible_user_id}}** on **{{ansible_date_time.date}}** with Ansible version **{{ansible_version.full}}**
This README.md was auto-generated by Ansible user **{{ ansible_user_id }}** on **{{ ansible_date_time.date }}** with Ansible version **{{ ansible_version.full }}**
To generate a README.md, execute the following command

View File

@@ -5,9 +5,13 @@ galaxy_info:
description: |
This role will install demos into your specified Ansible Tower environment.
company: Red Hat
platforms:
- name: EL
versions:
- 8
- 7
license: license (GPLv2, CC-BY, etc)
license: GPL-3.0-or-later
min_ansible_version: 2.9

View File

@@ -16,7 +16,7 @@
name: "{{ vars[demo].name }}"
description: "{{ vars[demo].description }}"
job_type: "{{ vars[demo].job_type }}"
inventory: "{{ vars[demo].inventory}}"
inventory: "{{ vars[demo].inventory }}"
project: "{{ vars[demo].project.name }}"
playbook: "{{ vars[demo].playbook }}"
fact_caching_enabled: "{{ vars[demo].fact_caching_enabled | default('false') }}"
@@ -38,13 +38,13 @@
name: "{{ vars[demo].name }}"
description: "{{ vars[demo].description }}"
job_type: "{{ vars[demo].job_type }}"
inventory: "{{ vars[demo].inventory}}"
inventory: "{{ vars[demo].inventory }}"
project: "{{ vars[demo].project.name }}"
playbook: "{{ vars[demo].playbook }}"
fact_caching_enabled: "{{ vars[demo].fact_caching_enabled | default('false') }}"
credential: "{{ vars[demo].credential }}"
survey_enabled: "{{ vars[demo].survey_enabled }}"
survey_spec: "{{ vars[demo].survey_spec}}"
survey_spec: "{{ vars[demo].survey_spec }}"
tower_username: "{{ my_tower_username }}"
tower_password: "{{ my_tower_password }}"
tower_host: "{{ my_tower_host }}"

View File

@@ -20,10 +20,10 @@
name: "{{ item.value.name }}"
description: "{{ item.value.description }}"
job_type: "{{ item.value.job_type }}"
inventory: "{{ item.value.inventory}}"
inventory: "{{ item.value.inventory }}"
project: "{{ item.value.project.name }}"
playbook: "{{ item.value.playbook}}"
fact_caching_enabled: "{{ item.value.fact_caching_enabled | default('false')}}"
playbook: "{{ item.value.playbook }}"
fact_caching_enabled: "{{ item.value.fact_caching_enabled | default('false') }}"
credential: "{{ item.value.credential }}"
survey_enabled: "{{ item.value.survey_enabled }}"
tower_username: "{{ my_tower_username }}"
@@ -42,13 +42,13 @@
name: "{{ item.value.name }}"
description: "{{ item.value.description }}"
job_type: "{{ item.value.job_type }}"
inventory: "{{ item.value.inventory}}"
inventory: "{{ item.value.inventory }}"
project: "{{ item.value.project.name }}"
playbook: "{{ item.value.playbook}}"
playbook: "{{ item.value.playbook }}"
fact_caching_enabled: "{{ item.value.fact_caching_enabled | default('false') }}"
credential: "{{ item.value.credential }}"
survey_enabled: "{{ item.value.survey_enabled }}"
survey_spec: "{{ item.value.survey_spec}}"
survey_spec: "{{ item.value.survey_spec }}"
tower_username: "{{ my_tower_username }}"
tower_password: "{{ my_tower_password }}"
tower_host: "{{ my_tower_host }}"

View File

@@ -1,13 +1,13 @@
---
- name: set facts from role vars
set_fact:
demo_list: "{{(dict(vars|dictsort|rejectattr('0', 'match', 'ansible_')|selectattr('1.name', 'defined'))|dict2items)|map(attribute='key')|list}}"
demo_list: "{{ (dict(vars|dictsort|rejectattr('0', 'match', 'ansible_')|selectattr('1.name', 'defined'))|dict2items)|map(attribute='key')|list }}"
- name: provide info to terminal window
debug:
msg:
- "install {{ vars.demo }} on {{ my_tower_host }}"
- "available demos are: {{demo_list}}"
- "available demos are: {{ demo_list }}"
- name: make sure demo is a valid demo
assert:
@@ -15,7 +15,7 @@
- vars.demo is defined
- vars.demo in demo_list or vars.demo == "all"
msg:
- "demo must be defined and be one of: {{demo_list}}"
- "demo must be defined and be one of: {{ demo_list }}"
- "full list can be found on https://github.com/ansible/product-demos"
- name: install all job templates

View File

@@ -1,15 +1,15 @@
---
- name: "INSIDE LOOP - install all job templates in relation to workflow {{ item.value.name }}"
include_tasks: job_template_loop.yml
loop: "{{ item.value.job_templates|dict2items}}"
loop: "{{ item.value.job_templates|dict2items }}"
- name: "INSIDE LOOP - install workflow template {{ item.value.name }}"
tower_workflow_template:
name: "{{ item.value.name }}"
description: "{{ item.value.description }}"
organization: "{{ item.value.organization }}"
schema: "{{ item.value.schema}}"
tower_username: "{{my_tower_username }}"
tower_password: "{{my_tower_password }}"
tower_host: "{{my_tower_host }}"
schema: "{{ item.value.schema }}"
tower_username: "{{ my_tower_username }}"
tower_password: "{{ my_tower_password }}"
tower_host: "{{ my_tower_host }}"
validate_certs: false

View File

@@ -1,6 +1,6 @@
---
- src: dev-sec.ssh-hardening
- src: mindpointgroup.rhel7-cis
- src: redhatofficial.rhel7_pci_dss
- src: mindpointgroup.rhel8-cis
- src: redhatofficial.rhel8_pci_dss
- src: linux-system-roles.firewall
- src: linux-system-roles.timesync