- hosts: rhasspy
  name: Install rhasspy
  become: true
  become_user: root
  tasks:
    - name: Install curl,mosquitto ...
      ansible.builtin.apt:
        name:
          - python3-pip
    - name: Install pip modules
      ansible.builtin.pip:
        name: docker
    - name: Pull image
      community.docker.docker_image:
        name: rhasspy/rhasspy
        source: pull
    - name: Create container
      community.docker.docker_container:
        name: rhasspy
        image: rhasspy/rhasspy
        command: --user-profiles /profiles --profile en
        devices:
          - "/dev/snd:/dev/snd"
        restart_policy: unless-stopped
        volumes:
          - "/etc/localtime:/etc/localtime:ro"
          - "/home/jd/.config/rhasspy/profiles:/profiles"
        ports:
          - "12101:12101"
