mKeRix/ansible-playbooks

MQTT Username and Password switched.

frdbonif opened this issue · 2 comments

Hello,

I installed Room Assistant using the playbooks. When provisioning a Pi, the position of the mqtt password was switched with the position of the username:

Eg.:

mqttOptions:
  password: password
  username: username

This prevents the connection to the MQTT server succeeding and prevents any connection to HomeAssistant. There may well be other options that get switched that cause minor errors that I haven't noticed.

For completeness here is the relevant part of my hosts.yaml file:

      homeAssistant:
        mqttUrl: mqtt://mqtt.fjla.uk:1883
        mqttOptions:
          username: room-assistant
          password: password

I've noticed that some of the other parts that move have no effect on function but make the resulting file less readable - arguably not important as it is being managed with Ansible.

The order of the username and password shouldn't matter or the resulting YAML files placed on the host should not be reordered from how they are written in the playbook.

I'm confused as to why this made a difference for you at all - I use exactly the same config options in ansible and don't run into this issue. Not only that, but this part of the YAML is read and passed as a complete object, so it doesn't even have a real order.

But I can look at the options of rendering YAML from ansible, the current mode isn't entirely up to my taste anyway.

I was quite surprised myself when I switched the two and it suddenly started working but it is the only thing that I changed.