homelab/roles/archivebox/tasks/main.yml

40 lines
1.1 KiB
YAML
Raw Normal View History

2024-11-02 19:04:43 +05:00
---
- name: Create archivebox volume
become: true
community.docker.docker_volume:
name: archivebox
- name: Create data dir
become: true
ansible.builtin.file:
path: "{{ archive_dir }}"
2024-11-02 19:04:43 +05:00
state: directory
mode: "1700"
owner: root
- name: Create nested data dir
become: true
ansible.builtin.file:
path: "{{ archive_dir }}/_data"
2024-11-02 19:04:43 +05:00
state: directory
mode: "1700"
owner: "{{ uid | string }}"
2024-11-02 19:04:43 +05:00
- name: Run archivebox
become: true
community.docker.docker_container:
name: archivebox-1
image: archivebox/archivebox:{{ tag }}
2024-11-02 19:04:43 +05:00
env:
PUBLIC_INDEX: "{{ public_index | string }}"
PUBLIC_SNAPSHOTS: "{{ public_snapshots | string }}"
SAVE_ARCHIVE_DOT_ORG: "{{ save_archive_dot_org | string }}"
CSRF_TRUSTED_ORIGINS: "{{ csrf_trusted_origins }}"
ALLOWED_HOSTS: "{{ allowed_hosts }}"
PUID: "{{ uid | string }}"
PGID: "{{ gid | string }}"
2024-11-02 19:04:43 +05:00
networks:
- name: haproxy
volumes:
- "archivebox:/data"
- "{{ archive_dir }}/_data:/data/archive"
- "/etc/timezone:/etc/timezone:ro"
2024-11-02 19:04:43 +05:00
restart_policy: unless-stopped