This commit is contained in:
apavlov
2024-06-23 01:05:03 +03:00
commit 9379899326
7 changed files with 164 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
---
- name: Get domain
ansible.builtin.shell:
cmd: hostname -d
register: domain
- name: Install dependencies
ansible.builtin.apt:
name:
- docker.io
- docker-compose
update_cache: yes
- name: Remove rproxy dir
ansible.builtin.file:
path: {{ rproxy_dir }}
state: absent
- name: Create rproxy dir
ansible.builtin.file:
path: {{ rproxy_dir }}
state: directory
- name: Create sites dir
ansible.builtin.file:
path: "{{ rproxy_dir }}/sites"
state: directory
- name: Copy docker-compose
ansible.builtin.template:
src: templates/docker-compose.yml.j2
dest: "{{ rproxy_dir }}/docker-compose.yml"
- name: Copy nginx.conf
ansible.builtin.copy:
src: files/nginx.conf
dest: "{{ rproxy_dir }}/nginx.conf"
- name: Copy server.conf
ansible.builtin.template:
src: templates/server.conf.j2
dest: "{{ rproxy_dir }}/sites/server.conf"
- name: Start rproxy
community.docker.docker_compose:
project_src: "{{ rproxy_dir }}"