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.
Covert date.* fact gathering to raw tasks. Closes #96.
- Loading branch information
1 parent
373e18c
commit c473b29
Showing
4 changed files
with
63 additions
and
2 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
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 |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
roles: | ||
- collect | ||
- uname | ||
- date | ||
|
||
|
||
- name: write facts first to a variable and then to csv locally | ||
|
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,61 @@ | ||
--- | ||
|
||
- name: gather date.date fact | ||
raw: date | ||
register: date_date | ||
ignore_errors: yes | ||
when: '"Date_date.date" in facts_to_collect' | ||
|
||
- name: add date.date to dictionary | ||
set_fact: | ||
date: "{{ date|default({}) | combine({ item: date_date['stdout_lines'][0] }) }}" | ||
with_items: | ||
- 'date.date' | ||
|
||
- name: gather date.anaconda_log fact | ||
raw: ls --full-time /root/anaconda-ks.cfg | grep -o '[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}' | ||
register: date_anaconda_log | ||
ignore_errors: yes | ||
when: '"Date_date.anaconda_log" in facts_to_collect' | ||
|
||
- name: add date.anaconda_log to dictionary | ||
set_fact: | ||
date: "{{ date|default({}) | combine({ item: date_anaconda_log['stdout_lines'][0] }) }}" | ||
with_items: | ||
- 'date.anaconda_log' | ||
|
||
- name: gather date.machine_id fact | ||
raw: ls --full-time /etc/machine-id | grep -o '[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}' | ||
register: date_machine_id | ||
ignore_errors: yes | ||
when: '"Date_date.machine_id" in facts_to_collect' | ||
|
||
- name: add date.machine_id to dictionary | ||
set_fact: | ||
date: "{{ date|default({}) | combine({ item: date_machine_id['stdout_lines'][0] }) }}" | ||
with_items: | ||
- 'date.machine_id' | ||
|
||
- name: gather date.filesystem_create fact | ||
raw: fs_date=$(tune2fs -l $(mount | egrep '/ type' | grep -o '/dev.* on' | sed -e 's/\on//g') | grep 'Filesystem created' | sed 's/Filesystem created:\s*//g'); if [[ $fs_date ]]; then date +'%F' -d \"$fs_date\"; else echo "" ; fi | ||
register: date_filesystem_create | ||
ignore_errors: yes | ||
when: '"Date_date.filesystem_create" in facts_to_collect' | ||
|
||
- name: add date.filesystem_create to dictionary | ||
set_fact: | ||
date: "{{ date|default({}) | combine({ item: date_filesystem_create['stdout_lines'][0] }) }}" | ||
with_items: | ||
- 'date.filesystem_create' | ||
|
||
- name: gather date.yum_history fact | ||
raw: yum history | tail -n 4 | grep -o '[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}' | ||
register: date_yum_history | ||
ignore_errors: yes | ||
when: '"Date_date.yum_history" in facts_to_collect' | ||
|
||
- name: add date.yum_history to dictionary | ||
set_fact: | ||
date: "{{ date|default({}) | combine({ item: date_yum_history['stdout_lines'][0] }) }}" | ||
with_items: | ||
- 'date.yum_history' |
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