Обновить ansible/npm-setup.yml
This commit is contained in:
+20
-17
@@ -1,16 +1,25 @@
|
||||
---
|
||||
# 1. Динамическое добавление машины в инвентарь
|
||||
- name: Add dynamically provisioned host
|
||||
hosts: localhost
|
||||
gather_facts: no
|
||||
tasks:
|
||||
- name: Add new VM IP to inventory
|
||||
add_host:
|
||||
name: "{{ vm_ip }}"
|
||||
groups: npm_servers
|
||||
ansible_user: debian # Замените на логин вашего шаблона
|
||||
ansible_ssh_common_args: '-o StrictHostKeyChecking=no'
|
||||
|
||||
# 2. Основная настройка NPM
|
||||
- name: Setup Minimal Linux with Docker and Nginx Proxy Manager
|
||||
hosts: all
|
||||
hosts: npm_servers
|
||||
become: yes
|
||||
gather_facts: yes
|
||||
tasks:
|
||||
- name: Update apt cache and install prerequisites
|
||||
apt:
|
||||
name:
|
||||
- apt-transport-https
|
||||
- ca-certificates
|
||||
- curl
|
||||
- gnupg
|
||||
- lsb-release
|
||||
name: ['apt-transport-https', 'ca-certificates', 'curl', 'gnupg', 'lsb-release']
|
||||
state: present
|
||||
update_cache: yes
|
||||
|
||||
@@ -26,11 +35,7 @@
|
||||
|
||||
- name: Install Docker and Docker Compose Plugin
|
||||
apt:
|
||||
name:
|
||||
- docker-ce
|
||||
- docker-ce-cli
|
||||
- containerd.io
|
||||
- docker-compose-plugin
|
||||
name: ['docker-ce', 'docker-ce-cli', 'containerd.io', 'docker-compose-plugin']
|
||||
state: present
|
||||
update_cache: yes
|
||||
|
||||
@@ -44,8 +49,6 @@
|
||||
file:
|
||||
path: /opt/npm
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0755'
|
||||
|
||||
- name: Create docker-compose.yml for NPM
|
||||
@@ -58,9 +61,9 @@
|
||||
image: 'jc21/nginx-proxy-manager:latest'
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- '80:80' # Public HTTP Port
|
||||
- '81:81' # Admin Web Port
|
||||
- '443:443' # Public HTTPS Port
|
||||
- '80:80'
|
||||
- '81:81'
|
||||
- '443:443'
|
||||
volumes:
|
||||
- ./data:/data
|
||||
- ./letsencrypt:/etc/letsencrypt
|
||||
|
||||
Reference in New Issue
Block a user