feat: Configure network-specific packages

This is probably not the right way to do this ... but it's
tricky. Packages that are REQUIRED for proper network config need to
be handled somewhere before we do network config.

Perhaps this could be moved to the netconfig role on its own, but I
don't really want to try.
This commit is contained in:
Martin Kennedy 2022-08-06 22:51:11 -04:00
parent ad80c3d464
commit b46bf38e84
5 changed files with 48 additions and 8 deletions

View File

@ -1,15 +1,30 @@
templates:
package_ath10k_mesh: &package_ath10k_mesh
- name: kmod-ath10k-ct
state: absent
- name: ath10k-firmware-qca988x-ct
state: absent
- name: kmod-ath10k
state: present
- name: ath10k-firmware-qca988x
state: present
package_wpad_mesh: &package_wpad_mesh
- name: wpad-basic-wolfssl
state: absent
- name: wpad-mesh-wolfssl
state: absent
- name: wpad-wolfssl
state: present
notify:
- Reload wpad
openwrt:
hosts:
ap3825i2.lan:
packages:
- name: kmod-ath10k-ct
state: absent
- name: ath10k-firmware-qca988x-ct
state: absent
- name: kmod-ath10k
state: present
- name: ath10k-firmware-qca988x
state: present
ath10k: *package_ath10k_mesh
wpad: *package_wpad_mesh
network:
device:

View File

@ -0,0 +1,9 @@
- name: Reload wpad
nohup:
command: "wifi down; /etc/init.d/wpad restart; wifi up"
- name: Touch a file
command:
argv:
- touch
- /tmp/test_proof

View File

@ -0,0 +1,2 @@
dependencies:
- role: gekmihesg.openwrt

View File

@ -0,0 +1,13 @@
- name: Install the correct wpad packages
opkg:
name: "{{ item.name }}"
state: "{{ item.state }}"
loop: "{{ packages.wpad | default([]) }}"
notify: "{{ item.notify | default([]) }}"
- name: Install the correct ath10k packages
opkg:
name: "{{ item.name }}"
state: "{{ item.state }}"
loop: "{{ packages.ath10k | default([]) }}"
notify: "{{ item.notify | default([]) }}"

View File

@ -1,3 +1,4 @@
- hosts: openwrt
roles:
- netpkgconfig
- netconfig