This repository has been archived by the owner on Jun 29, 2022. It is now read-only.
forked from candlepin/rho
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Ansible variables, not dynamic role files
Move towards using JBoss Scanner's facts inside of Rho by using static Ansible role files with variables. (Previous Rho was dynamically generating the role files at runtime.) This will make it much easier to use a larger number of tasks in the roles, which is important because JBoss Scanner uses many Ansible tasks.
- Loading branch information
Noah Lavine
committed
Jul 7, 2017
1 parent
9121bcf
commit 38bc433
Showing
4 changed files
with
44 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,6 @@ build | |
.build | ||
test/coverage | ||
data | ||
roles | ||
|
||
.vagrant | ||
*.retry |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
|
||
- name: Collect these facts | ||
run_cmds: name=whatever fact_names={{facts_to_collect}} | ||
register: facts_all | ||
|
||
- name: record host returned dictionary | ||
set_fact: | ||
res={{facts_all.meta}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
|
||
- name: store facts from all hosts in a variable | ||
set_fact: host_fact={{hostvars[item]["res"]}} | ||
with_items: "{{groups.alpha}}" | ||
register: host_facts | ||
|
||
- name: parse variable into a list of dictionaries | ||
set_fact: host_facts="{{ host_facts.results | map(attribute="ansible_facts.host_fact") | list }}" | ||
|
||
- name: write the list to a csv | ||
spit_results: name=spit file_path={{report_path}} vals={{host_facts}} |