mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-28 22:06:31 +00:00
Use container wrapper for docker logs across roles
https://chatgpt.com/share/698659d9-62e4-800f-89a1-5d44f309bde4
This commit is contained in:
5 files changed
+12
-10
No files matched your search
@@ -21,8 +21,8 @@
|
||||
|
||||
rescue:
|
||||
|
||||
- name: "POSTGRES | docker logs (last 200 lines)"
|
||||
ansible.builtin.command: "docker logs --tail 200 {{ POSTGRES_CONTAINER }}"
|
||||
- name: "POSTGRES | {{ BIN_CONTAINER }} logs (last 200 lines)"
|
||||
ansible.builtin.command: "{{ BIN_CONTAINER }} logs --tail 200 {{ POSTGRES_CONTAINER }}"
|
||||
register: dbg_docker_logs
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
@@ -147,8 +147,8 @@
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
|
||||
- name: "POSTGRES | docker logs (last 250 lines)"
|
||||
ansible.builtin.command: "docker logs --tail 250 {{ POSTGRES_CONTAINER }}"
|
||||
- name: "POSTGRES | {{ BIN_CONTAINER }} logs (last 250 lines)"
|
||||
ansible.builtin.command: "{{ BIN_CONTAINER }} logs --tail 250 {{ POSTGRES_CONTAINER }}"
|
||||
register: dbg_docker_logs
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
@@ -240,7 +240,7 @@
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
Failed to ALTER ROLE "{{ database_username }}" WITH LOGIN.
|
||||
See debug output above (docker logs, inspect, pg_isready, psql auth test, hba/config).
|
||||
See debug output above ({{ BIN_CONTAINER }} logs, inspect, pg_isready, psql auth test, hba/config).
|
||||
|
||||
# 4) Grant ALL privileges on all tables in the public schema
|
||||
- name: "Grant ALL privileges on tables in public schema to {{ database_username }}"
|
||||
|
||||
@@ -30,7 +30,8 @@
|
||||
failed_when: false
|
||||
ignore_errors: true
|
||||
|
||||
- ansible.builtin.command: docker logs --tail=200 {{ OPENRESTY_CONTAINER }}
|
||||
- ansible.builtin.command: >
|
||||
{{ BIN_CONTAINER }} logs --tail=200 {{ OPENRESTY_CONTAINER }}
|
||||
register: openresty_logs
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
- name: Dump OpenResty container logs on failure
|
||||
command: >
|
||||
docker logs --tail=200 {{ OPENRESTY_CONTAINER }}
|
||||
{{ BIN_CONTAINER }} logs --tail=200 {{ OPENRESTY_CONTAINER }}
|
||||
register: openresty_logs
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
|
||||
@@ -45,7 +45,8 @@
|
||||
failed_when: false
|
||||
|
||||
- name: Show Moodle container logs
|
||||
ansible.builtin.shell: docker logs --tail=200 {{ MOODLE_CONTAINER }}
|
||||
ansible.builtin.shell: >
|
||||
{{ BIN_CONTAINER }} logs --tail=200 {{ MOODLE_CONTAINER }}
|
||||
register: moodle_logs
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
@@ -58,7 +59,7 @@
|
||||
--- {{ BIN_CONTAINER }} inspect ---
|
||||
{{ moodle_inspect.stdout | default('no output') }}
|
||||
|
||||
--- docker logs (last 200 lines) ---
|
||||
--- {{ BIN_CONTAINER }} logs (last 200 lines) ---
|
||||
{{ moodle_logs.stdout | default('no output') }}
|
||||
|
||||
- name: "Include ownership settings tasks for moodle"
|
||||
|
||||
@@ -106,7 +106,7 @@
|
||||
- name: "XWIKI | DEBUG | Tail container logs"
|
||||
ansible.builtin.shell: |
|
||||
set -euo pipefail
|
||||
docker logs --tail 300 "{{ XWIKI_CONTAINER }}" || true
|
||||
{{ BIN_CONTAINER }} logs --tail 300 "{{ XWIKI_CONTAINER }}" || true
|
||||
register: _dbg_logs
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
|
||||
Reference in new issue
Block a user