summaryrefslogtreecommitdiff
path: root/deploy/playbook.yml
diff options
from:
to:
context:
space:
mode:
Diffstat (limited to 'deploy/playbook.yml')
-rw-r--r--deploy/playbook.yml27
1 files changed, 22 insertions, 5 deletions
diff --git a/deploy/playbook.yml b/deploy/playbook.yml
index b0202bd..b73146a 100644
--- a/deploy/playbook.yml
+++ b/deploy/playbook.yml
@@ -3,8 +3,26 @@
hosts: all
remote_user: svc_github
+ vars:
+ docker_volumes:
+ - "{{ saya_today_web_name }}-volume:/data:rw"
+
tasks:
- - name: Create a volume
+ - name: Initialize Unix socket volume
+ when: >-
+ saya_today_web_unix_sockets_path is defined and
+ saya_today_web_unix_sockets_path is string and
+ saya_today_web_unix_sockets_path | length > 0
+ block:
+ - name: Ensure Unix socket volume exists
+ community.docker.docker_volume:
+ name: "sayana_sockets"
+ - name: Include Unix socket volume in docker volumes list
+ ansible.builtin.set_fact:
+ docker_volumes: >-
+ {{ docker_volumes + ["sayana_sockets:" ~ saya_today_web_unix_sockets_path ~ ":rw"] }}
+
+ - name: Create a data volume
community.docker.docker_volume:
name: "{{ saya_today_web_name }}-volume"
@@ -14,8 +32,8 @@
hostname: "{{ saya_today_web_hostname }}"
image: "ghcr.io/sayaandy/saya-today-web:{{ saya_today_web_tag }}"
env:
- B2_KEY_ID: "{{ saya_today_web_b2_key_id }}"
- B2_APPLICATION_KEY: "{{ saya_today_web_b2_application_key }}"
+ S3_ACCESS_KEY_ID: "{{ saya_today_web_s3_access_key_id }}"
+ S3_SECRET_ACCESS_KEY: "{{ saya_today_web_s3_secret_access_key }}"
ENVIRONMENT: "{{ saya_today_web_environment }}"
AUTH_SALT: "{{ saya_today_web_auth_salt }}"
MAIL_HOST: "{{ saya_today_web_mail_host }}"
@@ -29,8 +47,7 @@
networks:
- name: caddy
ipv4_address: "{{ saya_today_web_ipv4_address }}"
- volumes:
- - "{{ saya_today_web_name }}-volume:/data:rw"
+ volumes: "{{ docker_volumes }}"
restart_policy: unless-stopped
no_log: true
...