ansible: playbook for postgres and gitea
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
---
|
||||
- name: Create application directory
|
||||
file:
|
||||
path: "/arcodange/{{ partition }}/{{ app_name }}"
|
||||
state: directory
|
||||
owner: "{{ app_owner }}"
|
||||
group: "{{ app_group }}"
|
||||
|
||||
- name: Create data directory
|
||||
file:
|
||||
path: "/arcodange/{{ partition }}/{{ app_name }}/data"
|
||||
state: directory
|
||||
owner: "{{ app_owner }}"
|
||||
group: "{{ app_group }}"
|
||||
mode: '0775'
|
||||
ignore_errors: true # app container might have set its own permissions on previous run
|
||||
|
||||
- name: Create scripts directory
|
||||
file:
|
||||
path: "/arcodange/{{ partition }}/{{ app_name }}/scripts"
|
||||
state: directory
|
||||
owner: "{{ app_owner }}"
|
||||
group: "{{ app_group }}"
|
||||
mode: '0755'
|
||||
|
||||
- name: Write docker-compose.yml
|
||||
copy:
|
||||
content: "{{ dockercompose_content | to_nice_yaml }}"
|
||||
dest: "/arcodange/{{ partition }}/{{ app_name }}/docker-compose.yml"
|
||||
owner: "{{ app_owner }}"
|
||||
group: "{{ app_group }}"
|
||||
mode: '0644'
|
||||
|
||||
- name: Write docker-compose script
|
||||
copy:
|
||||
content: |
|
||||
#!/bin/bash
|
||||
set -ex
|
||||
docker compose -f /arcodange/{{ partition }}/{{ app_name }}/docker-compose.yml "$@"
|
||||
dest: "/arcodange/{{ partition }}/{{ app_name }}/scripts/docker-compose"
|
||||
owner: "{{ app_owner }}"
|
||||
group: "{{ app_group }}"
|
||||
mode: '0755'
|
||||
Reference in New Issue
Block a user