---

- block:
    - name: create project directory
      file:
        path: /etc/docker-compose/dkron
        state: directory

    - name: copy docker-compose.yml
      copy:
        src: docker-compose.yml
        dest: /etc/docker-compose/dkron/docker-compose.yml
      notify: bounce dkron

    - name: copy requirements.txt
      copy:
        src: requirements.txt
        dest: /etc/docker-compose/dkron/requirements.txt
      notify: bounce dkron

    - name: copy Dockerfile
      copy:
        src: Dockerfile
        dest: /etc/docker-compose/dkron/Dockerfile
      notify: bounce dkron

    - name: start dkron
      docker_service:
        project_src: /etc/docker-compose/dkron
        state: present

  become: yes
