-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 556de4f
Showing
1 changed file
with
78 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,78 @@ | ||
sosreport | ||
========= | ||
|
||
This role creates sosreport files on remote hosts and collects them into a | ||
directory of choice on the controller. It can apply environment variables to | ||
the `sosreport` command if specified, e.g. for collecting report on OpenStack | ||
nodes. | ||
|
||
Requirements | ||
------------ | ||
|
||
* `sosreport` utility present on the remote host, installed if missing. | ||
* `rsync` utility present on the controller, **not installed** if missing. | ||
|
||
Role Variables | ||
-------------- | ||
|
||
The default variables are: | ||
|
||
* A local directory to collect sosreport files to on the controller. | ||
|
||
sosreport_local_dir: ~/sosreport | ||
|
||
* A remote directory to output sosreport to on the remote host. | ||
|
||
sosreport_remote_dir: /tmp/sosreport | ||
|
||
* Arguments to the sosreport command. | ||
|
||
sosreport_args: | ||
- --all-logs | ||
- --quiet | ||
- --batch | ||
- --verify | ||
|
||
There are additional variables, which are optional and don't have defaults: | ||
|
||
* A Red Hat Support case number. The case number will be amended to the | ||
`sosreport` command and appear in the resulting file name. | ||
|
||
sosreport_case: | ||
|
||
* The name of a hash containing environment variables. If provided, the hash | ||
will be passed to the `sosreport` command. This is useful when providing | ||
sosreport for OpenStack nodes. | ||
|
||
sosreport_env: | ||
|
||
Example Playbook | ||
---------------- | ||
|
||
An example of a playbook for collecting sosreports would be as follows: | ||
|
||
```yaml | ||
- hosts: "{{ servers }}" | ||
become: true | ||
gather_facts: no | ||
|
||
vars: | ||
sosreport_env: "{{ my_rc }}" | ||
|
||
tasks: | ||
- name: Collect sosreport | ||
import_role: | ||
name: gadamiak.sosreport | ||
``` | ||
The command to run the playbook against 'my_servers' and related to a case | ||
'02090101' would be: | ||
```bash | ||
$ ansible-playbook sosreport -e servers=my_servers -e sosreport_case=02090101 | ||
``` | ||
|
||
License | ||
------- | ||
|
||
GPLv3 |