---
- name: Install additional packages
  apt:
    name:
      - mosquitto
      - mosquitto-clients
  tags: [mosquitto, package]

- name: Copy pwfile
  template:
    src: pwfile.j2
    dest: /etc/mosquitto/pwfile
  tags: [mosquitto]

- name: Convert pwfile
  command: mosquitto_passwd -U pwfile
  tags: [mosquitto]

- name: Copy password.conf
  copy:
    src: password.conf
    dest: /etc/mosquitto/conf.d
  notify: Restart mosquitto
  tags: [mosquitto]

---
- name: Install additional packages
  apt:
    name:
      - mosquitto
      - mosquitto-clients
  tags: [mosquitto, package]

- name: Copy pwfile
  template:
    src: pwfile.j2
    dest: /etc/mosquitto/pwfile
  tags: [mosquitto]

- name: Convert pwfile
  command: mosquitto_passwd -U /etc/mosquitto/pwfile
  tags: [mosquitto]

- name: Copy password.conf
  copy:
    src: password.conf
    dest: /etc/mosquitto/conf.d
  notify: Restart mosquitto
  tags: [mosquitto]

Fix path in mosquitto for HA
Fix path in mosquitto for HA
