- name: Ensure Linux group 'nodered' exists (if not rpi)
  group:
    name: nodered
    state: present

- name: Ensure Linux user 'nodered' exists and is added to group 'nodered' (if not rpi)
  user:
    name: nodered
    group: nodered

- name: Ensure directory /home/nodered/.node-red/ exists (if not rpi)
  file:
    path: /home/nodered/.node-red
    state: directory
    owner: nodered
    group: nodered
    mode: 0775

- name: Install /home/nodered/.node-red/settings.js from template, with authentication (if not rpi)
  template:
    backup: yes
    src: settings.js.j2
    dest: /home/nodered/.node-red/settings.js
    owner: nodered
    group: nodered
    mode: 0755
