syncing more examples
This commit is contained in:
16
README.md
16
README.md
@@ -4,18 +4,15 @@ this is currently under construction and working on a minimal viable demo for te
|
||||
|
||||
# How to use
|
||||
|
||||
## 1. Provide login information for Ansible Tower
|
||||
## 1. Provide login information and choose demo
|
||||
|
||||
Modify the `tower_login_info.yml` that is included in this repo with the username, password and IP address (or DNS name) of your Ansible Tower
|
||||
- Modify the `choose_demo.yml` file that is included in this repo with the username, password and IP address (or DNS name) of your Ansible Tower
|
||||
- Choose the demo name you want from the table below (or choose `all`)
|
||||
|
||||
## 2. Choose your demo
|
||||
|
||||
Modify the `choose_demo.yml` that is included in this repo with demo name you want.
|
||||
|
||||
## 3. Run Ansible Playbook
|
||||
## 2. Run Ansible Playbook
|
||||
|
||||
```
|
||||
ansible-playbook playbooks/install_demo.yml -e @choose_demo.yml -e @tower_login_info.yml
|
||||
ansible-playbook playbooks/install_demo.yml -e @choose_demo.yml
|
||||
```
|
||||
|
||||
# Demo Repository
|
||||
@@ -24,11 +21,13 @@ ansible-playbook playbooks/install_demo.yml -e @choose_demo.yml -e @tower_login_
|
||||
<tr>
|
||||
<th>Demo Name</th>
|
||||
<th>Description</th>
|
||||
<th>Video Walkthrough</th>
|
||||
<th>Workshop Types</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Deploy Application</td>
|
||||
<td>simple survey to install yum applications on Linux</td>
|
||||
<td><a href="https://www.youtube.com/watch?v=pU8ZgSBuEJw&list=PLdu06OJoEf2bp-PNtxPP_2n7Avkax8TED&index=1">Youtube Video</a></td>
|
||||
<td>
|
||||
<ul>
|
||||
<li>f5</li>
|
||||
@@ -39,6 +38,7 @@ ansible-playbook playbooks/install_demo.yml -e @choose_demo.yml -e @tower_login_
|
||||
<tr>
|
||||
<td>Openscap</td>
|
||||
<td>Create HTML report using SCAP Security Guide (SSG)</td>
|
||||
<td>Not Available</td>
|
||||
<td>
|
||||
<ul>
|
||||
<li>f5</li>
|
||||
|
||||
@@ -3,7 +3,12 @@
|
||||
## chose specific demo or choose all
|
||||
|
||||
#SPECIFIC - example that installs just the deploy_application job template
|
||||
demo: deploy_application
|
||||
demo: developer_report
|
||||
|
||||
#ALL - example that installs all demos
|
||||
# demo: all
|
||||
|
||||
## Ansible Tower login infomation
|
||||
my_tower_username: colin
|
||||
my_tower_password: mahalo
|
||||
my_tower_host: test.rhdemo.io
|
||||
|
||||
16
playbooks/11_developer_report.yml
Normal file
16
playbooks/11_developer_report.yml
Normal file
@@ -0,0 +1,16 @@
|
||||
---
|
||||
- name: grab linux facts
|
||||
hosts: all
|
||||
gather_facts: true
|
||||
|
||||
- name: build developer report
|
||||
hosts: node1
|
||||
gather_facts: false
|
||||
|
||||
vars:
|
||||
file_path: /var/www/html/report/index.html
|
||||
|
||||
tasks:
|
||||
- name: use developer report
|
||||
include_role:
|
||||
name: developer_report
|
||||
@@ -22,3 +22,14 @@ demos:
|
||||
workshop_type:
|
||||
- f5
|
||||
- rhel
|
||||
developer_report:
|
||||
name: "Create Developer Report"
|
||||
job_type: "run"
|
||||
inventory: "Workshop Inventory"
|
||||
project: "Ansible official demo project"
|
||||
playbook: "playbooks/11_developer_report.yml"
|
||||
credential: "Workshop Credential"
|
||||
survey_enabled: no
|
||||
workshop_type:
|
||||
- f5
|
||||
- rhel
|
||||
|
||||
9
roles/developer_report/tasks/main.yml
Normal file
9
roles/developer_report/tasks/main.yml
Normal file
@@ -0,0 +1,9 @@
|
||||
- name: create HTML report
|
||||
become: yes
|
||||
template:
|
||||
src: report.j2
|
||||
dest: "{{ file_path }}"
|
||||
|
||||
- name: DISPLAY LINK TO INVENTORY REPORT
|
||||
debug:
|
||||
msg: "Please go to http://{{ansible_host}}/report"
|
||||
37
roles/developer_report/templates/report.j2
Normal file
37
roles/developer_report/templates/report.j2
Normal file
@@ -0,0 +1,37 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="css/main.css">
|
||||
</head>
|
||||
<h1>Developer Report</h1>
|
||||
<body>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Hostname</th>
|
||||
<th>Operating System</th>
|
||||
<th>PATH</th>
|
||||
<th>Kernel</th>
|
||||
<th>Python Version</th>
|
||||
<th>Package Manager</th>
|
||||
<th>System Date Time</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<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>
|
||||
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,3 +0,0 @@
|
||||
my_tower_username: colin
|
||||
my_tower_password: mahalo
|
||||
my_tower_host: test.rhdemo.io
|
||||
Reference in New Issue
Block a user