46 lines
1.3 KiB
YAML
46 lines
1.3 KiB
YAML
|
# 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 stop is defined and stop else 'started' }}"
|
||
|
restart: "{{ stop is undefined or not stop }}"
|
||
|
image: ipfs/kubo:{{ services.ipfs.version }}
|
||
|
restart_policy: always
|
||
|
default_host_ip: ''
|
||
|
env:
|
||
|
IPFS_DOMAIN: "{{ services.ipfs.domain }}"
|
||
|
IPFS_PROFILE: server
|
||
|
LAN_IP: "{{ ansible_default_ipv4.address }}"
|
||
|
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
|
||
|
- 5001:5001/tcp
|