Initial changes to integrate new portal

This commit is contained in:
Ana Custura 2026-03-06 09:04:11 +00:00
parent c4ffbb00e2
commit 0fa18af48e
18 changed files with 311 additions and 221 deletions

View file

@ -11,19 +11,19 @@
tasks:
- name: Check if RaspAP is already installed
ansible.builtin.stat:
path: /var/www/html/admin
path: /var/www/html/raspap
register: raspap_stat
- name: Download RaspAP install script
get_url:
ansible.builtin.get_url:
url: https://install.raspap.com
dest: /tmp/raspap_install.sh
mode: "0755"
when: not raspap_stat.stat.exists
when: not raspap_stat.stat.exists
- name: Run RaspAP install script
ansible.builtin.shell: |
pwd && ls -alh / && /usr/bin/bash /tmp/raspap_install.sh --yes --path /var/www/html/admin \
pwd && ls -alh / && /usr/bin/bash /tmp/raspap_install.sh --yes --path /var/www/html/raspap \
--check 0 \
--wireguard {{ raspap_wireguard }} \
--openvpn {{ raspap_openvpn }} \
@ -35,37 +35,36 @@
failed_when: raspap_install.rc != 0
- name: Remove /var/www/html.* directories if they exist
become: true
ansible.builtin.shell: |
find /var/www/html.* -maxdepth 0 -type d -exec rm -r {} \; || :
changed_when: false
- name: Ensure /etc/hostapd directory exists
file:
ansible.builtin.file:
path: /etc/hostapd
state: directory
mode: '0755'
- name: Template RaspAP network config to target
template:
ansible.builtin.template:
src: "hostapd.conf.j2"
dest: "/etc/hostapd/hostapd.conf"
mode: '0644'
- name: Copy hostapd set_hostapd_iface config script
template:
ansible.builtin.template:
src: "set_hostapd_iface.py"
dest: "/usr/local/bin/set_hostapd_iface.py"
mode: '0755'
mode: '0744'
- name: Copy hostapd set_hostapd_iface service file
template:
ansible.builtin.template:
src: "set-hostapd-iface.service.j2"
dest: "/lib/systemd/system/set-hostapd-iface.service"
mode: '0755'
mode: '0644'
- name: Download hostapd raspapd systemd service file
get_url:
ansible.builtin.get_url:
url: "{{ config_base_url }}/raspapd.service"
dest: "/lib/systemd/system/raspapd.service"
owner: root
@ -73,7 +72,7 @@
mode: '0644'
- name: Enable service raspapd, avahi-daemon, and set_hostapd_iface by symlink
file:
ansible.builtin.file:
src: "/lib/systemd/system/{{ item }}"
dest: "/etc/systemd/system/multi-user.target.wants/{{ item }}"
state: link
@ -83,7 +82,7 @@
- "avahi-daemon.service"
- name: Copy dnsmasq config
template:
ansible.builtin.template:
src: "butterbox-dnsmasq.conf.j2"
dest: /etc/dnsmasq.d/butterbox-dnsmasq.conf
owner: root