768a04040d3964282efdb3ac9e09a23e3461e0c0
[noc.git] / ansible / host_vars / torwaechter / main.yml
1 ---
2 ssh_users_tuergit: "{{ user_groups.noc | union(['fgenesis']) }}"
3
4 openwrt_variant: openwrt
5 openwrt_release: 18.06.4
6 openwrt_arch: x86
7 openwrt_target: geode
8 openwrt_output_image_suffixes:
9   - combined-ext4.img.gz
10   - combined-squashfs.img.gz
11
12 openwrt_packages_extra:
13   - "-dropbear"
14   - hwclock
15   - flashrom
16   - git
17   - kmod-usb-acm
18   - openssh-server
19   - openssh-sftp-server
20   - screen
21   - sudo
22   - usbutils
23   - rsync
24   - lsblk
25
26 openwrt_mixin:
27   /etc/default:
28     dirname:
29   /etc/hotplug.d/tty/:
30     dirname:
31   /etc/hotplug.d/usb/:
32     dirname:
33   /home:
34     dirname:
35   /run:
36     dirname:
37
38   # Go binaries
39   /usr/local/bin/door_client:
40     mode: '0755'
41     file: "{{ global_cache_dir }}/{{ inventory_hostname }}/door_and_sensors/door_client/door_client"
42   /usr/local/bin/door_daemon:
43     mode: '0755'
44     file: "{{ global_cache_dir }}/{{ inventory_hostname }}/door_and_sensors/door_daemon/door_daemon"
45   /usr/local/bin/update-keys:
46     mode: '0755'
47     file: "{{ global_cache_dir }}/{{ inventory_hostname }}/door_and_sensors/update-keys/update-keys"
48
49   # door daemon init scripts and configs
50   /etc/init.d/tuer_core:
51     mode: '0755'
52     file: "{{ global_cache_dir }}/{{ inventory_hostname }}/door_and_sensors/initscripts/tuer_core.openwrt"
53   /etc/default/tuer:
54     mode: '0755'
55     file: "{{ global_cache_dir }}/{{ inventory_hostname }}/door_and_sensors/initscripts/tuer.default"
56   /etc/rc.d/S50tuer_core:
57     link: "../init.d/tuer_core"
58
59   # hotplug files
60   /etc/hotplug.d/tty/door.tty:
61     mode: '0755'
62     file: "{{ global_cache_dir }}/{{ inventory_hostname }}/door_and_sensors/scripts/door.tty"
63   /etc/hotplug.d/tty/door.usb:
64     mode: '0755'
65     file: "{{ global_cache_dir }}/{{ inventory_hostname }}/door_and_sensors/scripts/door.usb"
66
67   /usr/local/bin/authorized_keys.sh:
68     mode: '0755'
69     file: "{{ global_files_dir }}/{{ inventory_hostname }}/authorized_keys.sh"
70
71   /usr/local/bin/update-keys-from-stdin.sh:
72     mode: '0755'
73     file: "{{ global_files_dir }}/{{ inventory_hostname }}/update-keys-from-stdin.sh"
74
75   /etc/ssh/sshd_config:
76     content: |
77       Port 22000
78
79       AllowUsers root tuerctl tuergit
80       AuthenticationMethods publickey
81       AuthorizedKeysFile /etc/ssh/authorized_keys.d/%u
82
83       AllowAgentForwarding no
84       AllowTcpForwarding no
85       X11Forwarding no
86       UsePrivilegeSeparation sandbox
87
88       Subsystem sftp /usr/libexec/sftp-server
89
90       Match User tuerctl
91         AuthorizedKeysFile /dev/null
92         AuthorizedKeysCommand /usr/local/bin/authorized_keys.sh
93         AuthorizedKeysCommandUser tuergit
94
95   /etc/ssh/authorized_keys.d/root:
96     content: "{{ ssh_users_root | user_ssh_keys(users) | join('\n') }}\n"
97
98   /etc/ssh/authorized_keys.d/tuergit:
99     content: "{{ ssh_users_tuergit | user_ssh_keys(users) | join('\n') }}\n"
100
101 openwrt_uci:
102   system:
103     - name: system
104       options:
105         hostname: '{{ inventory_hostname }}'
106         timezone: 'CET-1CEST,M3.5.0,M10.5.0/3'
107         ttylogin: '0'
108         log_size: '64'
109         urandom_seed: '0'
110
111     - name: timeserver 'ntp'
112       options:
113         enabled: '1'
114         enable_server: '0'
115         server:
116           - '0.lede.pool.ntp.org'
117           - '1.lede.pool.ntp.org'
118           - '2.lede.pool.ntp.org'
119           - '3.lede.pool.ntp.org'
120
121   network:
122     - name: globals 'globals'
123       options:
124         ula_prefix: fdc9:e01f:83db::/48
125
126     - name: interface 'loopback'
127       options:
128         ifname: lo
129         proto: static
130         ipaddr: 127.0.0.1
131         netmask: 255.0.0.0
132
133     - name: interface 'mgmt'
134       options:
135         ifname: eth0
136         accept_ra: 0
137         proto: static
138         ipaddr: "{{ net.mgmt.prefix | ipaddr(100) | ipaddr('address') }}"
139         netmask: "{{ net.mgmt.prefix | ipaddr('netmask') }}"
140         gateway: "{{ net.mgmt.gw }}"
141         dns: "{{ net.mgmt.dns | join(' ') }}"
142         dns_search: realraum.at
143
144
145 openwrt_mounts:
146   - path: /run
147     src: none
148     fstype: tmpfs
149     opts: nosuid,nodev,noexec,noatime
150
151 openwrt_users:
152   tuerd: {}
153   tuergit:
154     home:  /home/tuergit
155     shell: /usr/bin/git-shell
156   tuerctl:
157     shell: /bin/false # TODO fixme