Diffstat (limited to 'deploy')
| -rw-r--r-- | deploy/inventory.yml | 20 | ||||
| -rw-r--r-- | deploy/playbook.yml | 35 |
2 files changed, 13 insertions, 42 deletions
diff --git a/deploy/inventory.yml b/deploy/inventory.yml index 0a63140..dde952e 100644 --- a/deploy/inventory.yml +++ b/deploy/inventory.yml @@ -3,19 +3,15 @@ all: prod: hosts: node_prod: - ansible_host: uz.saya.casa - saya_today_web_name: sayauz-prod - saya_today_web_hostname: sayauz-prod - saya_today_web_ipv4_address: 172.16.0.17 - saya_today_web_listen_address: saya.uz - saya_today_web_unix_sockets_path: '/etc/sayauz' + ansible_host: pl.saya.today + saya_today_web_name: sayana-web + saya_today_web_hostname: sayana-web + saya_today_web_ipv4_address: 172.16.0.18 stage: hosts: node_stage: - ansible_host: uz.saya.casa - saya_today_web_name: sayauz-stage - saya_today_web_hostname: sayauz-stage - saya_today_web_ipv4_address: 172.16.0.18 - saya_today_web_listen_address: stage.saya.uz - saya_today_web_unix_sockets_path: '/etc/sayauz' + ansible_host: pl.saya.today + saya_today_web_name: sayana-demo + saya_today_web_hostname: sayana-demo + saya_today_web_ipv4_address: 172.16.0.17 diff --git a/deploy/playbook.yml b/deploy/playbook.yml index ae3e936..dfceaf7 100644 --- a/deploy/playbook.yml +++ b/deploy/playbook.yml @@ -3,26 +3,8 @@ hosts: all remote_user: svc_github - vars: - docker_volumes: - - "{{ saya_today_web_name }}-volume:/data:rw" - tasks: - - 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 + - name: Create a volume community.docker.docker_volume: name: "{{ saya_today_web_name }}-volume" @@ -32,23 +14,16 @@ hostname: "{{ saya_today_web_hostname }}" image: "ghcr.io/sayaandy/saya-today-web:{{ saya_today_web_tag }}" env: - S3_ACCESS_KEY_ID: "{{ saya_today_web_s3_access_key_id }}" - S3_SECRET_ACCESS_KEY: "{{ saya_today_web_s3_secret_access_key }}" + B2_KEY_ID: "{{ saya_today_web_b2_key_id }}" + B2_APPLICATION_KEY: "{{ saya_today_web_b2_application_key }}" ENVIRONMENT: "{{ saya_today_web_environment }}" AUTH_SALT: "{{ saya_today_web_auth_salt }}" - MAIL_HOST: "{{ saya_today_web_mail_host }}" - MAIL_ADDRESS: "{{ saya_today_web_mail_address }}" - MAIL_USERNAME: "{{ saya_today_web_mail_username }}" - MAIL_PASSWORD: "{{ saya_today_web_mail_password }}" - MAIL_SALT: "{{ saya_today_web_mail_salt }}" - FQDN: "{{ saya_today_web_listen_address }}" - GOOGLE_SITE_VERIFICATION: "{{ saya_today_google_site_verification | default('') }}" - YANDEX_VERIFICATION: "{{ saya_today_yandex_verification | default('') }}" network_mode: caddy networks: - name: caddy ipv4_address: "{{ saya_today_web_ipv4_address }}" - volumes: "{{ docker_volumes }}" + volumes: + - "{{ saya_today_web_name }}-volume:/data:rw" restart_policy: unless-stopped no_log: true ... |