fixup! roles/openwrt-image: Support creating users/groups
[noc.git] / ansible / roles / openwrt-image / passwd.j2
index 5a24840..9beaeb6 100644 (file)
@@ -3,7 +3,7 @@ root:x:0:0:root:/root:/bin/ash
 daemon:*:1:1:daemon:/var:/bin/false
 ftp:*:55:55:ftp:/home/ftp:/bin/false
 network:*:101:101:network:/var:/bin/false
-{% for user in openwrt_users %}
-{{ user.name }}:*:{{ user.id | default(loop.index + 110) }}:{{ user.gid | default(loop.index + 110) }}:{{ user.name }}:{{ user.home | default('/nonexistent') }}:{{ user.shell | default('/bin/false') }}
+{% for name, opt in openwrt_users.items() %}
+{{ name }}:*:{{ opt.id | default(loop.index + 110) }}:{{ opt.gid | default(loop.index + 110) }}:{{ name }}:{{ opt.home | default('/nonexistent') }}:{{ opt.shell | default('/bin/false') }}
 {% endfor %}
 nobody:*:65534:65534:nobody:/var:/bin/false