From fade4e8a2f0f06ebd2875a3fa492c51a50466abf Mon Sep 17 00:00:00 2001 From: Administrator Date: Wed, 15 Oct 2025 10:54:33 +0000 Subject: [PATCH] Update 2 files - /roles/npm/tasks/main.yml - /roles/heimdall/tasks/main.yml --- roles/heimdall/tasks/main.yml | 47 +++++++++++++++++++++++++++++------ roles/npm/tasks/main.yml | 47 +++++++++++++++++++++++++++++------ 2 files changed, 78 insertions(+), 16 deletions(-) diff --git a/roles/heimdall/tasks/main.yml b/roles/heimdall/tasks/main.yml index 890e722..517580b 100644 --- a/roles/heimdall/tasks/main.yml +++ b/roles/heimdall/tasks/main.yml @@ -14,20 +14,51 @@ dest: "{{ heimdall_base_dir }}/docker-compose.yml" mode: 0644 -- name: Pull and start Heimdall container - community.docker.docker_compose_v2: - project_src: "{{ heimdall_base_dir }}" - state: present +- name: Pull Heimdall Docker images + shell: | + cd {{ heimdall_base_dir }} + docker compose pull + args: + executable: /bin/bash + +- name: Start Heimdall container + shell: | + cd {{ heimdall_base_dir }} + docker compose up -d + args: + executable: /bin/bash - name: Wait for Heimdall to start pause: - seconds: 10 + seconds: 15 - name: Check Heimdall container status - community.docker.docker_container_info: - name: heimdall + shell: | + docker ps --filter name=heimdall --format "json" register: heimdall_status + changed_when: false - name: Show Heimdall status debug: - msg: "Heimdall status: {{ heimdall_status.container.Status }}" \ No newline at end of file + msg: "Heimdall container: {{ heimdall_status.stdout }}" + +- name: Verify Heimdall is running + shell: | + docker ps --filter name=heimdall --filter status=running --quiet | wc -l + register: heimdall_running + changed_when: false + +- name: Show Heimdall running status + debug: + msg: "Heimdall is running: {{ heimdall_running.stdout | int > 0 }}" + +- name: Check Heimdall logs + shell: | + cd {{ heimdall_base_dir }} + docker compose logs --tail=5 + register: heimdall_logs + failed_when: false + +- name: Show Heimdall logs + debug: + msg: "Heimdall logs: {{ heimdall_logs.stdout }}" \ No newline at end of file diff --git a/roles/npm/tasks/main.yml b/roles/npm/tasks/main.yml index 7b692b7..3c79655 100644 --- a/roles/npm/tasks/main.yml +++ b/roles/npm/tasks/main.yml @@ -15,20 +15,51 @@ dest: "{{ npm_base_dir }}/docker-compose.yml" mode: 0644 -- name: Pull and start NPM container - community.docker.docker_compose_v2: - project_src: "{{ npm_base_dir }}" - state: present +- name: Pull NPM Docker images + shell: | + cd {{ npm_base_dir }} + docker compose pull + args: + executable: /bin/bash + +- name: Start NPM container + shell: | + cd {{ npm_base_dir }} + docker compose up -d + args: + executable: /bin/bash - name: Wait for NPM to start pause: - seconds: 10 + seconds: 15 - name: Check NPM container status - community.docker.docker_container_info: - name: npm + shell: | + docker ps --filter name=npm --format "json" register: npm_status + changed_when: false - name: Show NPM status debug: - msg: "NPM status: {{ npm_status.container.Status }}" \ No newline at end of file + msg: "NPM container: {{ npm_status.stdout }}" + +- name: Verify NPM is running + shell: | + docker ps --filter name=npm --filter status=running --quiet | wc -l + register: npm_running + changed_when: false + +- name: Show NPM running status + debug: + msg: "NPM is running: {{ npm_running.stdout | int > 0 }}" + +- name: Check NPM logs + shell: | + cd {{ npm_base_dir }} + docker compose logs --tail=5 + register: npm_logs + failed_when: false + +- name: Show NPM logs + debug: + msg: "NPM logs: {{ npm_logs.stdout }}" \ No newline at end of file