Allow collect-logs.yaml to operate without inventory vars
This commit is contained in:
parent
ab12b23e6f
commit
a9a016d7b1
1 changed files with 8 additions and 2 deletions
|
@ -4,6 +4,10 @@
|
||||||
gather_facts: no
|
gather_facts: no
|
||||||
|
|
||||||
vars:
|
vars:
|
||||||
|
docker_bin_dir: /usr/bin
|
||||||
|
bin_dir: /usr/local/bin
|
||||||
|
system_namespace: kube-system
|
||||||
|
ansible_ssh_pipelining: true
|
||||||
commands:
|
commands:
|
||||||
- name: timedate_info
|
- name: timedate_info
|
||||||
cmd: timedatectl status
|
cmd: timedatectl status
|
||||||
|
@ -24,7 +28,7 @@
|
||||||
- name: errors_info
|
- name: errors_info
|
||||||
cmd: journalctl -p err --no-pager
|
cmd: journalctl -p err --no-pager
|
||||||
- name: etcd_info
|
- name: etcd_info
|
||||||
cmd: etcdctl --peers={{ etcd_access_addresses }} cluster-health
|
cmd: etcdctl --peers={{ etcd_access_addresses | default("http://127.0.0.1:2379") }} cluster-health
|
||||||
- name: calico_info
|
- name: calico_info
|
||||||
cmd: "{{bin_dir}}/calicoctl node status"
|
cmd: "{{bin_dir}}/calicoctl node status"
|
||||||
- name: calico_workload_info
|
- name: calico_workload_info
|
||||||
|
@ -87,10 +91,10 @@
|
||||||
{% for item in groups['etcd'] -%}
|
{% for item in groups['etcd'] -%}
|
||||||
https://{{ item }}:2379{% if not loop.last %},{% endif %}
|
https://{{ item }}:2379{% if not loop.last %},{% endif %}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
|
when: "'etcd' in groups"
|
||||||
|
|
||||||
- name: Storing commands output
|
- name: Storing commands output
|
||||||
shell: "{{ item.cmd }} 2>&1 | tee {{ item.name }}"
|
shell: "{{ item.cmd }} 2>&1 | tee {{ item.name }}"
|
||||||
register: output
|
|
||||||
failed_when: false
|
failed_when: false
|
||||||
with_items: "{{commands}}"
|
with_items: "{{commands}}"
|
||||||
no_log: True
|
no_log: True
|
||||||
|
@ -98,6 +102,7 @@
|
||||||
- name: Fetch results
|
- name: Fetch results
|
||||||
fetch: src={{ item.name }} dest=/tmp/collect-info/commands
|
fetch: src={{ item.name }} dest=/tmp/collect-info/commands
|
||||||
with_items: "{{commands}}"
|
with_items: "{{commands}}"
|
||||||
|
failed_when: false
|
||||||
|
|
||||||
- name: Fetch logs
|
- name: Fetch logs
|
||||||
fetch: src={{ item }} dest=/tmp/collect-info/logs
|
fetch: src={{ item }} dest=/tmp/collect-info/logs
|
||||||
|
@ -110,3 +115,4 @@
|
||||||
- name: Clean up collected command outputs
|
- name: Clean up collected command outputs
|
||||||
file: path={{ item.name }} state=absent
|
file: path={{ item.name }} state=absent
|
||||||
with_items: "{{commands}}"
|
with_items: "{{commands}}"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue