From: Christian Pointner Date: Mon, 21 May 2018 19:39:36 +0000 (+0200) Subject: openwrt-image: move templates to sub dir X-Git-Url: https://git.realraum.at/?a=commitdiff_plain;h=f80cda10e753af0f4669bd5b2e9d3b33d6657feb;p=noc.git openwrt-image: move templates to sub dir --- diff --git a/ansible/roles/openwrt-image/group.j2 b/ansible/roles/openwrt-image/group.j2 deleted file mode 100644 index cb433b8..0000000 --- a/ansible/roles/openwrt-image/group.j2 +++ /dev/null @@ -1,21 +0,0 @@ -{{ ansible_managed | comment }} -root:x:0: -daemon:x:1: -adm:x:4: -mail:x:8: -audio:x:29: -www-data:x:33: -ftp:x:55: -users:x:100: -network:x:101: -{% for name, opt in openwrt_users.items() %} -{% if 'group_id' not in opt %} -{{ name }}:x:{{ opt.id | default(loop.index + 110) }}: -{% endif %} -{% endfor %} -{% if openwrt_groups is defined %} -{% for name, opt in openwrt_groups.items() %} -{{ name }}:x:{{ opt.id | default(loop.index + 200) }}: -{% endfor %} -{% endif %} -nogroup:x:65534: diff --git a/ansible/roles/openwrt-image/passwd.j2 b/ansible/roles/openwrt-image/passwd.j2 deleted file mode 100644 index 9beaeb6..0000000 --- a/ansible/roles/openwrt-image/passwd.j2 +++ /dev/null @@ -1,9 +0,0 @@ -{{ ansible_managed | comment }} -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 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 diff --git a/ansible/roles/openwrt-image/templates/group.j2 b/ansible/roles/openwrt-image/templates/group.j2 new file mode 100644 index 0000000..cb433b8 --- /dev/null +++ b/ansible/roles/openwrt-image/templates/group.j2 @@ -0,0 +1,21 @@ +{{ ansible_managed | comment }} +root:x:0: +daemon:x:1: +adm:x:4: +mail:x:8: +audio:x:29: +www-data:x:33: +ftp:x:55: +users:x:100: +network:x:101: +{% for name, opt in openwrt_users.items() %} +{% if 'group_id' not in opt %} +{{ name }}:x:{{ opt.id | default(loop.index + 110) }}: +{% endif %} +{% endfor %} +{% if openwrt_groups is defined %} +{% for name, opt in openwrt_groups.items() %} +{{ name }}:x:{{ opt.id | default(loop.index + 200) }}: +{% endfor %} +{% endif %} +nogroup:x:65534: diff --git a/ansible/roles/openwrt-image/templates/passwd.j2 b/ansible/roles/openwrt-image/templates/passwd.j2 new file mode 100644 index 0000000..9beaeb6 --- /dev/null +++ b/ansible/roles/openwrt-image/templates/passwd.j2 @@ -0,0 +1,9 @@ +{{ ansible_managed | comment }} +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 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 diff --git a/ansible/roles/openwrt-image/templates/uci.j2 b/ansible/roles/openwrt-image/templates/uci.j2 new file mode 100644 index 0000000..3cc480b --- /dev/null +++ b/ansible/roles/openwrt-image/templates/uci.j2 @@ -0,0 +1,15 @@ +{{ ansible_managed | comment }} + +{% for section in item.value %} +config {{ section.name }} +{% for option, value in section.options.items() %} +{% if value is iterable and value is not string %} +{% for v in value %} + list {{ option }} '{{ v }}' +{% endfor %} +{% else %} + option {{ option }} '{{ value }}' +{% endif %} +{% endfor %} + +{% endfor %} diff --git a/ansible/roles/openwrt-image/uci.j2 b/ansible/roles/openwrt-image/uci.j2 deleted file mode 100644 index 3cc480b..0000000 --- a/ansible/roles/openwrt-image/uci.j2 +++ /dev/null @@ -1,15 +0,0 @@ -{{ ansible_managed | comment }} - -{% for section in item.value %} -config {{ section.name }} -{% for option, value in section.options.items() %} -{% if value is iterable and value is not string %} -{% for v in value %} - list {{ option }} '{{ v }}' -{% endfor %} -{% else %} - option {{ option }} '{{ value }}' -{% endif %} -{% endfor %} - -{% endfor %}