diff --git a/ansible/install-rasp-ap.yml b/ansible/install-rasp-ap.yml index fd537bb..e9e390a 100644 --- a/ansible/install-rasp-ap.yml +++ b/ansible/install-rasp-ap.yml @@ -9,6 +9,12 @@ raspap_adblock: 0 tasks: + - name: ensure lighttpd listens on port 8080 + ansible.builtin.lineinfile: + path: /etc/lighttpd/lighttpd.conf + regexp: '^server.port' + line: server.port=8080 + - name: Check if RaspAP is already installed ansible.builtin.stat: path: /var/www/html/raspap @@ -81,6 +87,13 @@ - "set-hostapd-iface.service" - "avahi-daemon.service" + - name: Disable service raspapd restapi service + ansible.builtin.file: + path: "/etc/systemd/system/multi-user.target.wants/{{ item }}" + state: absent + with_items: + - "restapi.service" + - name: Copy dnsmasq config ansible.builtin.template: src: "butterbox-dnsmasq.conf.j2" @@ -88,13 +101,3 @@ owner: root group: root mode: '0644' - - - name: Restart service raspapd, issue daemon-reload to pick up config changes - ansible.builtin.systemd_service: - state: restarted - daemon_reload: true - name: "{{ item }}" - when: not (is_vmdb2 | bool) - with_items: - - raspapd - - set-hostapd-iface diff --git a/ansible/install-usb-viewer.yml b/ansible/install-usb-viewer.yml index d965dee..9144fca 100644 --- a/ansible/install-usb-viewer.yml +++ b/ansible/install-usb-viewer.yml @@ -4,8 +4,8 @@ become: true tasks: - name: Copy systemd services - ansible.builtin.copy: - src: "{{ vmdb2_config_base_dir }}/{{ item }}" + ansible.builtin.template: + src: "{{ item }}" dest: "/etc/systemd/system/{{ item }}" mode: '0644' loop: diff --git a/ansible/remove-wifi-creds.yml b/ansible/remove-wifi-creds.yml index 80880be..e3184ab 100644 --- a/ansible/remove-wifi-creds.yml +++ b/ansible/remove-wifi-creds.yml @@ -4,8 +4,8 @@ become: true tasks: - name: Copy wpa_supplicant config - ansible.builtin.copy: - src: "{{ vmdb2_config_base_dir }}/wpa_supplicant.conf" + ansible.builtin.template: + src: "wpa_supplicant.conf" dest: /etc/wpa_supplicant/wpa_supplicant.conf force: true mode: '0644' diff --git a/ansible/templates/hostapd.conf.j2 b/ansible/templates/hostapd.conf.j2 index 1f8b8e4..9e197c1 100644 --- a/ansible/templates/hostapd.conf.j2 +++ b/ansible/templates/hostapd.conf.j2 @@ -7,7 +7,7 @@ beacon_int=100 ssid={{ butter_name }} channel=1 hw_mode=g -ieee80211n=0 +ieee80211ac=1 interface=wlan0 wpa=none wpa_pairwise=CCMP diff --git a/ansible/templates/nginx-config.j2 b/ansible/templates/nginx-config.j2 index 5ef7794..262ac5e 100644 --- a/ansible/templates/nginx-config.j2 +++ b/ansible/templates/nginx-config.j2 @@ -8,7 +8,7 @@ server { } location ^~ /raspap { - alias /var/www/html/raspap; + proxy_pass http://127.0.0.1:8080; } location ^~ /_matrix { diff --git a/ansible/templates/serve-usb@.service b/ansible/templates/serve-usb@.service new file mode 100644 index 0000000..4081b72 --- /dev/null +++ b/ansible/templates/serve-usb@.service @@ -0,0 +1,8 @@ +[Unit] +Description=Serve USB content +BindTo=dev-%i.device + +[Service] +ExecStart=/bin/sh -c '/usr/bin/on-usb-drive-mounted.sh /dev/%i' +ExecStop=/bin/sh -c 'rm /media/usb-butter/' +RemainAfterExit=yes \ No newline at end of file diff --git a/ansible/templates/udisks2-mount@.service b/ansible/templates/udisks2-mount@.service new file mode 100644 index 0000000..c87a591 --- /dev/null +++ b/ansible/templates/udisks2-mount@.service @@ -0,0 +1,8 @@ +[Unit] +Description=Mount service +BindTo=dev-%i.device + +[Service] +ExecStart=/bin/sh -c '/usr/bin/udisksctl mount -b /dev/%i' +ExecStop=/bin/sh -c '/usr/bin/udisksctl unmount -b /dev/%i' +RemainAfterExit=yes \ No newline at end of file diff --git a/ansible/templates/wpa_supplicant.conf b/ansible/templates/wpa_supplicant.conf new file mode 100644 index 0000000..5622f2e --- /dev/null +++ b/ansible/templates/wpa_supplicant.conf @@ -0,0 +1,3 @@ +country=US +ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev +ap_scan=1 diff --git a/vmdb2-recipes/amd64_trixie.yaml b/vmdb2-recipes/amd64_trixie.yaml index d3c7be9..65b186e 100644 --- a/vmdb2-recipes/amd64_trixie.yaml +++ b/vmdb2-recipes/amd64_trixie.yaml @@ -98,6 +98,7 @@ steps: - python3-packaging - python3-virtualenv - nginx + - lighttpd - unzip - sudo - systemd-timesyncd diff --git a/vmdb2-recipes/raspi_4_trixie.yaml b/vmdb2-recipes/raspi_4_trixie.yaml index d622a41..7c2b9ab 100644 --- a/vmdb2-recipes/raspi_4_trixie.yaml +++ b/vmdb2-recipes/raspi_4_trixie.yaml @@ -84,6 +84,7 @@ steps: - python3-packaging - python3-virtualenv - nginx + - lighttpd - git - unzip - sudo