Files
playbooks/iot/roles/nodered/tasks/main.yaml
T
tanshu 4ddeba5402 Make the existing playbooks pass the new checks
Strip trailing whitespace and blank lines, name the getent tasks, and fix Jinja spacing.
2026-10-18 21:35:49 +05:30

36 lines
856 B
YAML

---
- name: Look up the Node-RED user
getent:
database: passwd
key: "{{ nodered_user }}"
split: ":"
# Tasks for Node-RED role
- name: Pull Node Red image
docker_image:
name: "{{ nodered_image }}"
source: pull
force_source: yes
- name: Ensure Node Red Directory exists
file:
path: "{{ nodered_directory }}"
state: directory
group: "{{ nodered_user }}"
owner: "{{ nodered_user }}"
mode: 0755
- name: Create Node Red container
docker_container:
name: "{{ nodered_container }}"
image: "{{ nodered_image }}"
state: started
restart_policy: "unless-stopped"
user: "{{ getent_passwd[nodered_user][1] }}:{{ getent_passwd[nodered_user][2] }}"
env:
TZ: "Asia/Kolkata"
networks:
- name: "{{ docker_network }}"
volumes:
- "{{ nodered_directory }}:/data"