Skip to content

Commit

Permalink
Copy over rho uname role to quipucords
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilya White committed Jan 8, 2018
1 parent a57dfb6 commit f5f4b5d
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 3 deletions.
6 changes: 3 additions & 3 deletions quipucords/scanner/network/inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ def inspect_scan(self):
:returns: An array of dictionaries of facts
"""
roles = ['check_dependencies', 'connection', 'cpu',
'date', 'dmi', 'etc_release', 'file_contents',
'jboss_eap', 'virt', 'virt_what', 'host_done']
roles = ['check_dependencies', 'connection', 'cpu', 'date',
'dmi', 'etc_release', 'file_contents', 'jboss_eap',
'uname', 'virt', 'virt_what', 'host_done']
playbook = {'name': 'scan systems for product fingerprint facts',
'hosts': 'all',
'gather_facts': False,
Expand Down
71 changes: 71 additions & 0 deletions roles/uname/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---

- name: gather uname.os fact
raw: uname -s
register: uname_os
ignore_errors: yes

- name: add uname.os to dictionary
set_fact:
uname: "{{ uname|default({}) | combine({ item: uname_os['stdout_lines'][0] | default('error') }) }}"
with_items:
- 'uname.os'

- name: gather uname.hostname fact
raw: uname -n
register: uname_hostname
ignore_errors: yes

- name: add uname.hostname to dictionary
set_fact:
uname: "{{ uname|default({}) | combine({ item: uname_hostname['stdout_lines'][0] | default('error') }) }}"
with_items:
- 'uname.hostname'

- name: gather uname.processor fact
raw: uname -p
register: uname_processor
ignore_errors: yes

- name: add uname.processor to dictionary
set_fact:
uname: "{{ uname|default({}) | combine({ item: uname_processor['stdout_lines'][0] | default('error') }) }}"
with_items:
- 'uname.processor'

- name: gather uname.kernel fact
raw: uname -r
register: uname_kernel
ignore_errors: yes

- name: add uname.kernel to dictionary
set_fact:
uname: "{{ uname|default({}) | combine({ item: uname_kernel['stdout_lines'][0] | default('error') }) }}"
with_items:
- 'uname.kernel'

- name: gather uname.all fact
raw: uname -a
register: uname_all
ignore_errors: yes

- name: add uname.all to dictionary
set_fact:
uname: "{{ uname|default({}) | combine({ item: uname_all['stdout_lines'][0] | default('error') }) }}"
with_items:
- 'uname.all'

- name: gather uname.hardware_platform fact
raw: uname -i
register: uname_hardware_platform
ignore_errors: yes

- name: add uname.hardware_platform to dictionary
set_fact:
uname: "{{ uname|default({}) | combine({ item: uname_hardware_platform['stdout_lines'][0] | default('error') }) }}"
with_items:
- 'uname.hardware_platform'

- name: add uname dict to the facts dict
set_fact:
uname: "{{ uname|default({}) }}"

0 comments on commit f5f4b5d

Please sign in to comment.