This playbook deploys Artalk with Docker Compose on Debian 10+, Ubuntu LTS, and RHEL 9+ systems.
- name: Deploy Artalk
hosts: artalk
become: true
vars:
artalk_root: /opt/artalk
artalk_port: 8080
tasks:
- name: Install Docker on Debian/Ubuntu
apt:
update_cache: true
name:
- docker.io
- docker-compose-plugin
state: present
when: ansible_os_family == "Debian"
- name: Install Docker on RHEL family
dnf:
name:
- docker
- docker-compose-plugin
state: present
when: ansible_os_family == "RedHat"
- name: Enable and start Docker
service:
name: docker
state: started
enabled: true
- name: Create Artalk directory
file:
path: "{{ artalk_root }}"
state: directory
mode: "0755"
- name: Write Artalk docker-compose file
copy:
dest: "{{ artalk_root }}/docker-compose.yml"
mode: "0644"
content: |
services:
artalk:
image: artalk/artalk-go:latest
restart: unless-stopped
ports:
- "{{ artalk_port }}:23366"
volumes:
- ./data:/data
- name: Start Artalk stack
command: docker compose up -d
args:
chdir: "{{ artalk_root }}"