diff options
Diffstat (limited to 'roles/space_server/templates')
-rw-r--r-- | roles/space_server/templates/cmdline.j2 | 5 | ||||
-rw-r--r-- | roles/space_server/templates/fstab.j2 | 9 | ||||
-rw-r--r-- | roles/space_server/templates/radius/clients.conf.j2 | 13 | ||||
-rw-r--r-- | roles/space_server/templates/radius/getusers.sh.j2 | 10 |
4 files changed, 37 insertions, 0 deletions
diff --git a/roles/space_server/templates/cmdline.j2 b/roles/space_server/templates/cmdline.j2 new file mode 100644 index 0000000..36b1e15 --- /dev/null +++ b/roles/space_server/templates/cmdline.j2 @@ -0,0 +1,5 @@ +{% if ansible_distribution_release == 'Rawhide' %} +console=ttyS0,115200n8 ro root={{ root.device }} rootfstype=btrfs ro rootflags={{ root.options|regex_replace('noatime,','') }},subvol=/rawhide rootwait audit=0 +{% else %} +console=ttyS0,115200n8 ro root={{ root.device }} rootfstype=btrfs ro rootflags={{ root.options|regex_replace('noatime,','') }},subvol=/{{ ansible_distribution.lower() }}{{ ansible_distribution_version }} rootwait audit=0 +{% endif %} diff --git a/roles/space_server/templates/fstab.j2 b/roles/space_server/templates/fstab.j2 new file mode 100644 index 0000000..ba4f69d --- /dev/null +++ b/roles/space_server/templates/fstab.j2 @@ -0,0 +1,9 @@ +{{ boot.device }} /boot vfat defaults,{{ boot.options }} 0 2 + +{% if ansible_distribution_release == 'Rawhide' %} +{{ root.device }} / btrfs defaults,{{ root.options }},subvol=/rawhide 0 1 +{% else %} +{{ root.device }} / btrfs defaults,{{ root.options }},subvol=/{{ ansible_distribution.lower() }}{{ ansible_distribution_version }} 0 1 +{% endif %} +{{ root.device }} /home btrfs defaults,{{ root.options }},subvol=/home 0 2 +{{ root.device }} /mnt btrfs defaults,{{ root.options }},subvol=/ 0 2 diff --git a/roles/space_server/templates/radius/clients.conf.j2 b/roles/space_server/templates/radius/clients.conf.j2 new file mode 100644 index 0000000..0e82666 --- /dev/null +++ b/roles/space_server/templates/radius/clients.conf.j2 @@ -0,0 +1,13 @@ +client ap1 { + ipaddr = 10.42.0.5 + netmask = 32 + secret = {{ radius_passwords.ap1 }} + nas_type = other +} + +client ap2 { + ipaddr = 10.42.0.6 + netmask = 32 + secret = {{ radius_passwords.ap2 }} + nas_type = other +} diff --git a/roles/space_server/templates/radius/getusers.sh.j2 b/roles/space_server/templates/radius/getusers.sh.j2 new file mode 100644 index 0000000..e77758b --- /dev/null +++ b/roles/space_server/templates/radius/getusers.sh.j2 @@ -0,0 +1,10 @@ +#!/bin/sh + +if curl -s -4 -k '{{ radius_passwords.download_url }}' -o /etc/raddb/users.new; then + if ! diff -q /etc/raddb/users /etc/raddb/users.new >/dev/null; then + mv -f /etc/raddb/users.new /etc/raddb/mods-config/files/authorize + systemctl restart radiusd.service + fi +else + rm -f /etc/raddb/users.new +fi |