49 lines
1.3 KiB
YAML
49 lines
1.3 KiB
YAML
- 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
|