+29
-14
@@ -1,32 +1,47 @@
|
||||
---
|
||||
- name: Deploy Frontend
|
||||
hosts: prod
|
||||
vars:
|
||||
deploy_path: /opt/app
|
||||
|
||||
pre_tasks:
|
||||
- name: Install docker
|
||||
ansible.builtin.include_role:
|
||||
name: geerlingguy.docker
|
||||
|
||||
- name: Configure ufw
|
||||
community.general.ufw:
|
||||
rule: allow
|
||||
port: "{{ item }}"
|
||||
loop:
|
||||
- "80"
|
||||
- "443"
|
||||
- "2222"
|
||||
|
||||
- name: Enable ufw
|
||||
community.general.ufw:
|
||||
state: enabled
|
||||
tasks:
|
||||
- name: Ensure deployment directory
|
||||
- name: Ensure directory
|
||||
ansible.builtin.file:
|
||||
path: "{{ deploy_path }}"
|
||||
path: /opt/aegisfront
|
||||
state: directory
|
||||
|
||||
- name: Copy docker-compose
|
||||
- name: Copy compose
|
||||
ansible.builtin.copy:
|
||||
src: "{{ playbook_dir }}/../docker-compose.yml"
|
||||
dest: "{{ deploy_path }}/docker-compose.yml"
|
||||
dest: /opt/aegisfront/docker-compose.yml
|
||||
|
||||
- name: Pull images
|
||||
- name: Pull image
|
||||
ansible.builtin.shell:
|
||||
cmd: docker compose pull
|
||||
chdir: "{{ deploy_path }}"
|
||||
chdir: /opt/aegisfront
|
||||
environment:
|
||||
REGISTRY: "{{ registry }}"
|
||||
TAG: "{{ tag }}"
|
||||
REGISTRY: gitea.d3m0k1d.ru
|
||||
TAG: latest
|
||||
|
||||
- name: Start services
|
||||
- name: Start
|
||||
ansible.builtin.shell:
|
||||
cmd: docker compose up -d --remove-orphans
|
||||
chdir: "{{ deploy_path }}"
|
||||
chdir: /opt/aegisfront
|
||||
environment:
|
||||
REGISTRY: "{{ registry }}"
|
||||
TAG: "{{ tag }}"
|
||||
REGISTRY: gitea.d3m0k1d.ru
|
||||
TAG: latest
|
||||
|
||||
Reference in New Issue
Block a user