---
- name: Create komodo directory
  file:
    path: /opt/komodo
    state: directory
    mode: "0755"

- name: Create komodo data directory
  file:
    path: /data/komodo
    state: directory
    mode: "0755"

- name: Create komodo periphery root directory
  file:
    path: /etc/komodo
    state: directory
    mode: "0755"

- name: Create docker-compose file for komodo
  template:
    src: docker-compose.yml.j2
    dest: /opt/komodo/docker-compose.yml
    mode: "0644"

- name: Start komodo
  shell: cd /opt/komodo && docker compose down && docker compose up -d
  args:
    chdir: /opt/komodo
