lab-ansible/roles/docker_services/tasks/services/ipfs.yml

46 lines
1.3 KiB
YAML
Raw Normal View History

2023-10-28 23:00:05 +00:00
# vim: ft=yaml.ansible
---
- name: Create IPFS Kubo volume directories
ansible.builtin.file:
name: "{{ dir }}"
owner: root
mode: u=rwx,g=rx,o=rx
state: directory
loop:
- "{{ services.ipfs.volume }}/data"
- "{{ services.ipfs.volume }}/staging"
loop_control:
loop_var: dir
- name: Copy ipfs-config.sh
ansible.builtin.copy:
src: ipfs/ipfs-config.sh
dest: "{{ services.ipfs.volume }}/ipfs-config.sh"
owner: root
mode: u=rwx,g=rx,o=rx
- name: Deploy IPFS Kubo Docker container
community.docker.docker_container:
name: ipfs_kubo
state: "{{ 'absent' if down is defined and down else 'started' }}"
restart: "{{ restart is defined and restart }}"
recreate: "{{ recreate is defined and recreate }}"
image: ipfs/kubo:{{ services.ipfs.version }}
restart_policy: always
default_host_ip: ''
env:
IPFS_DOMAIN: "{{ services.ipfs.gateway_domain }}"
IPFS_PROFILE: server
LOCAL_DOMAIN: "{{ services.ipfs.domain }}"
networks:
- name: services
aliases:
- ipfs_kubo
volumes:
- "{{ services.ipfs.volume }}/ipfs-config.sh:/container-init.d/ipfs-config.sh:ro"
- "{{ services.ipfs.volume }}/data:/data/ipfs:rw"
- "{{ services.ipfs.volume }}/staging:/export:rw"
published_ports:
- 4001:4001/tcp
- 4001:4001/udp