Update 2 files
- /roles/npm/tasks/main.yml - /roles/heimdall/tasks/main.yml
This commit is contained in:
parent
6e089b3882
commit
fade4e8a2f
@ -14,20 +14,51 @@
|
|||||||
dest: "{{ heimdall_base_dir }}/docker-compose.yml"
|
dest: "{{ heimdall_base_dir }}/docker-compose.yml"
|
||||||
mode: 0644
|
mode: 0644
|
||||||
|
|
||||||
- name: Pull and start Heimdall container
|
- name: Pull Heimdall Docker images
|
||||||
community.docker.docker_compose_v2:
|
shell: |
|
||||||
project_src: "{{ heimdall_base_dir }}"
|
cd {{ heimdall_base_dir }}
|
||||||
state: present
|
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
|
- name: Wait for Heimdall to start
|
||||||
pause:
|
pause:
|
||||||
seconds: 10
|
seconds: 15
|
||||||
|
|
||||||
- name: Check Heimdall container status
|
- name: Check Heimdall container status
|
||||||
community.docker.docker_container_info:
|
shell: |
|
||||||
name: heimdall
|
docker ps --filter name=heimdall --format "json"
|
||||||
register: heimdall_status
|
register: heimdall_status
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
- name: Show Heimdall status
|
- name: Show Heimdall status
|
||||||
debug:
|
debug:
|
||||||
msg: "Heimdall status: {{ heimdall_status.container.Status }}"
|
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 }}"
|
||||||
@ -15,20 +15,51 @@
|
|||||||
dest: "{{ npm_base_dir }}/docker-compose.yml"
|
dest: "{{ npm_base_dir }}/docker-compose.yml"
|
||||||
mode: 0644
|
mode: 0644
|
||||||
|
|
||||||
- name: Pull and start NPM container
|
- name: Pull NPM Docker images
|
||||||
community.docker.docker_compose_v2:
|
shell: |
|
||||||
project_src: "{{ npm_base_dir }}"
|
cd {{ npm_base_dir }}
|
||||||
state: present
|
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
|
- name: Wait for NPM to start
|
||||||
pause:
|
pause:
|
||||||
seconds: 10
|
seconds: 15
|
||||||
|
|
||||||
- name: Check NPM container status
|
- name: Check NPM container status
|
||||||
community.docker.docker_container_info:
|
shell: |
|
||||||
name: npm
|
docker ps --filter name=npm --format "json"
|
||||||
register: npm_status
|
register: npm_status
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
- name: Show NPM status
|
- name: Show NPM status
|
||||||
debug:
|
debug:
|
||||||
msg: "NPM status: {{ npm_status.container.Status }}"
|
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 }}"
|
||||||
Loading…
Reference in New Issue
Block a user