Update file main.yml
This commit is contained in:
parent
215ff3b471
commit
28aa2f99f7
@ -79,27 +79,6 @@
|
||||
var: cadvisor_logs.stdout
|
||||
when: cadvisor_logs is defined
|
||||
|
||||
- name: Verify cAdvisor is responding
|
||||
uri:
|
||||
url: "http://localhost:{{ cadvisor_port }}/metrics"
|
||||
status_code: 200
|
||||
timeout: 10
|
||||
register: cadvisor_check
|
||||
become: no
|
||||
ignore_errors: yes
|
||||
|
||||
- name: Show cAdvisor status
|
||||
debug:
|
||||
msg: "cAdvisor is running and responding on port {{ cadvisor_port }}"
|
||||
when: cadvisor_check.status == 200
|
||||
|
||||
- name: Fail if cAdvisor not responding
|
||||
fail:
|
||||
msg: |
|
||||
cAdvisor failed to start on {{ inventory_hostname }}.
|
||||
Container status: {{ container_info.stdout }}
|
||||
Logs: {{ cadvisor_logs.stdout if cadvisor_logs is defined else 'No logs available' }}
|
||||
when: cadvisor_check.status != 200
|
||||
|
||||
when:
|
||||
- docker_check.rc == 0
|
||||
|
||||
Loading…
Reference in New Issue
Block a user