Обновить ansible/npm-setup.yml
This commit is contained in:
+30
-2
@@ -114,11 +114,10 @@
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
- name: Create docker-compose.yml for NPM
|
||||
- name: Create docker-compose.yml for NPM (without version)
|
||||
copy:
|
||||
dest: /opt/npm/docker-compose.yml
|
||||
content: |
|
||||
version: '3.8'
|
||||
services:
|
||||
app:
|
||||
image: 'jc21/nginx-proxy-manager:latest'
|
||||
@@ -135,6 +134,30 @@
|
||||
community.docker.docker_compose_v2:
|
||||
project_src: /opt/npm
|
||||
state: present
|
||||
register: docker_compose_result
|
||||
retries: 3
|
||||
delay: 10
|
||||
until: docker_compose_result is success
|
||||
ignore_errors: yes
|
||||
|
||||
- name: Retry pulling image if failed
|
||||
command: docker pull jc21/nginx-proxy-manager:latest
|
||||
when: docker_compose_result is failed
|
||||
register: docker_pull
|
||||
retries: 5
|
||||
delay: 30
|
||||
until: docker_pull is success
|
||||
|
||||
- name: Run Docker Compose again
|
||||
community.docker.docker_compose_v2:
|
||||
project_src: /opt/npm
|
||||
state: present
|
||||
when: docker_compose_result is failed
|
||||
|
||||
- name: Check if containers are running
|
||||
command: docker ps --filter "name=app" --format "table {{.Names}}\t{{.Status}}"
|
||||
register: container_status
|
||||
changed_when: false
|
||||
|
||||
- name: Display access information
|
||||
debug:
|
||||
@@ -142,6 +165,9 @@
|
||||
========================================
|
||||
✅ Docker and Nginx Proxy Manager installed!
|
||||
|
||||
Container Status:
|
||||
{{ container_status.stdout }}
|
||||
|
||||
Access URLs:
|
||||
- Admin Panel: http://{{ vm_ip }}:81
|
||||
- HTTP Proxy: http://{{ vm_ip }}
|
||||
@@ -150,4 +176,6 @@
|
||||
Default Admin Credentials:
|
||||
- Email: admin@example.com
|
||||
- Password: changeme
|
||||
|
||||
To check logs: docker logs npm_app_1
|
||||
========================================
|
||||
Reference in New Issue
Block a user