Files
wedding-site/ansible/deploy.yml
2026-03-01 19:44:12 +03:00

49 lines
1.3 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
- hosts: servers
become: yes
vars:
env_file: $(pwd)/.env
tasks:
- name: Install wget
apt:
name: wget
state: present
update_cache: yes
- name: Install Docker
shell: curl -fsSL https://get.docker.com | sh
args:
creates: /usr/bin/docker
- name: Ensure /opt/infra exists
file:
path: /opt/infra
state: directory
owner: root
group: root
mode: '0755'
- name: Copy .env to remote
copy:
src: "{{ env_file }}"
dest: /opt/infra/.env
owner: root
group: root
mode: '0600'
- name: Download nginx
shell: wget -O /opt/infra/nginx.yaml "{{ URL for docker-compose nginx }}" #перенести докер в pipeline и выкачать страницы для запуска с созданием loacations в nginx
args:
creates: /opt/infra/nginx.yaml
- name: Download node-docker.yaml
shell: wget -O /opt/infra/node-docker.yaml "{{ gitea_instance_url }}"
args:
creates: /opt/infra/node-docker.yaml
- name: Start node-docker
shell: docker-compose -f /opt/infra/node-docker.yaml up -d
- name: Start nginx
shell: docker-compose -f /opt/infra/nginx.yaml up -d