28 lines
604 B
YAML
28 lines
604 B
YAML
---
|
|
- hosts: teier.eu
|
|
gather_facts: no
|
|
tasks:
|
|
- name: Check dc directory
|
|
stat:
|
|
path: /dc/postgres
|
|
register: postgres_dc_dir_stat
|
|
|
|
- name: Create postgres dc directory
|
|
file:
|
|
path: /dc/postgres
|
|
state: directory
|
|
mode: 0755
|
|
group: root
|
|
owner: root
|
|
when: postgres_dc_dir_stat.islnk is not defined
|
|
|
|
- name: Copy compose file
|
|
copy:
|
|
src: docker-compose.yml
|
|
dest: /dc/postgres
|
|
|
|
- name: Start postgres
|
|
shell: "cd /dc/postgres && docker-compose up -d"
|
|
environment:
|
|
POSTGRES_PASSWORD: "{{ lookup('env', 'POSTGRES_PASSWORD') }}"
|