|
1 | 1 | --- |
2 | | -- name: "Add irqbalance if multicore" |
| 2 | + |
| 3 | +- name: "Omit irqbalance unless multicore" |
3 | 4 | set_fact: |
4 | | - packages: "{{ packages + ['irqbalance'] }}" |
| 5 | + multicore__packages__to_merge: [] |
5 | 6 | when: |
6 | | - - multicore|default(false)|bool |
| 7 | + - not (multicore | default(false)) |
7 | 8 |
|
8 | | -- name: "Add airos-dfs-reset if configured" |
| 9 | +- name: "Omit airos-dfs-reset unless configured" |
9 | 10 | set_fact: |
10 | | - packages: "{{ packages + ['airos-dfs-reset'] }}" |
| 11 | + dfs__packages__to_merge: [] |
11 | 12 | when: |
12 | | - - airos_dfs_reset|default([])|length > 0 |
13 | | - - role == 'corerouter' |
| 13 | + - not (airos_dfs_reset | default([]) | count > 1) |
14 | 14 |
|
15 | | -- name: "Add Dawn + Luci app for corerouters" |
| 15 | +- name: "Omit DAWN unless configured" |
16 | 16 | set_fact: |
17 | | - packages: "{{ packages + [item] }}" |
| 17 | + dawn__packages__to_merge: [] |
18 | 18 | when: |
19 | | - - role == 'corerouter' or role == 'ap' |
20 | | - - not (low_mem | default(false)) |
21 | | - - not (low_flash | default(false)) |
22 | | - - wifi_roaming | default(false) |
23 | | - loop: |
24 | | - - dawn |
25 | | - - luci-app-dawn |
26 | | - - umdns |
| 19 | + - not (wifi_roaming | default(false)) |
27 | 20 |
|
28 | | -- name: "Add tunspace if configured" |
| 21 | +- name: "Omit tunspace unless configured" |
29 | 22 | set_fact: |
30 | | - packages: "{{ packages + ['tunspace', 'wireguard-tools'] }}" |
| 23 | + tunnel__packages__to_merge: [] |
31 | 24 | when: |
32 | | - - networks is defined |
33 | | - - networks | selectattr('role', 'defined') | selectattr('role','equalto','tunnel') | count > 0 |
34 | | - - role == 'corerouter' |
| 25 | + - networks is not defined or networks | selectattr('role','equalto','tunnel') | count == 0 |
35 | 26 |
|
36 | | -- name: "Add zram-swap on low mem and big flash" |
| 27 | +- name: "Omit zram-swap unless low mem and big flash" |
37 | 28 | set_fact: |
38 | | - packages: "{{ packages + ['zram-swap'] }}" |
| 29 | + zram__packages__to_merge: [] |
39 | 30 | when: |
40 | | - - low_mem | default(false) |
41 | | - - not (low_flash | default(false)) |
| 31 | + # CONFIG_KERNEL_SWAP is disabled on many low_flash devices (citation needed) |
| 32 | + - not (low_mem | default(false) and not (low_flash | default(false))) |
42 | 33 |
|
43 | | -- name: "Add debugging-packages on core-routers" |
| 34 | +- name: "Omit corerouter utilities if low mem or low flash" |
44 | 35 | set_fact: |
45 | | - packages: "{{ packages + ['mosh-server', 'tmux'] }}" |
| 36 | + util__packages__to_merge: [] |
46 | 37 | when: |
47 | | - - role == 'corerouter' |
48 | | - - not (low_mem | default(false)) |
49 | | - - not (low_flash | default(false)) |
| 38 | + - low_mem | default(false) or low_flash | default(false) |
50 | 39 |
|
51 | | -- name: "Remove or replace packages on low mem and low flash" |
| 40 | +- name: "Omit notlow packages if low mem or low flash" |
52 | 41 | set_fact: |
53 | | - packages: "{{ packages + [item] }}" |
| 42 | + notlow__packages__to_merge: [] |
54 | 43 | when: low_mem | default(false) or low_flash | default(false) |
55 | | - loop: |
56 | | - - -ethtool |
57 | | - - -iperf3 |
58 | | - - -iwinfo |
59 | | - - -libiwinfo-lua |
60 | | - - -collectd-mod-iwinfo |
61 | | - - -kmod-ipt-core |
62 | | - - -kmod-ipt-offload |
63 | | - - -kmod-nf-ipt |
64 | | - - -kmod-nls-base |
65 | | - - -kmod-phy-ath79-usb |
66 | | - - -kmod-usb-core |
67 | | - - -kmod-usb-ehci |
68 | | - - -kmod-usb-ohci |
69 | | - - -kmod-usb2 |
70 | | - - -opkg |
71 | | - - -tcpdump |
72 | | - - tcpdump-mini |
73 | | - - -vnstat |
74 | 44 |
|
75 | | -- name: "Remove Luci on low mem and low flash" |
| 45 | +- name: "Omit low packages unless low mem or low flash" |
| 46 | + set_fact: |
| 47 | + low__packages__to_merge: [] |
| 48 | + when: not (low_mem | default(false) or low_flash | default(false)) |
| 49 | + |
| 50 | +- name: "Omit LuCI if low mem or low flash unless corerouter" |
76 | 51 | set_fact: |
77 | | - packages: "{{ packages + ['-' + item] }}" |
| 52 | + all_luci_base__packages__to_merge: [] |
78 | 53 | when: (low_mem | default(false) or low_flash | default(false)) and role != "corerouter" |
79 | | - loop: "{{ all_luci_base__packages__to_merge }}" |
80 | 54 |
|
81 | | -- name: "Disable uhttpd on low mem" |
| 55 | +- name: "Skip disabling uhttpd unless low mem" |
82 | 56 | set_fact: |
83 | | - disabled_services: "{{ disabled_services + ['uhttpd'] }}" |
84 | | - when: low_mem | default(false) |
| 57 | + low__disabled_services__to_merge: [] |
| 58 | + when: not (low_mem | default(false)) |
85 | 59 |
|
86 | | -- name: "Add ip-bridge if dsa target" |
| 60 | +- name: "Omit ip-bridge unless DSA target" |
87 | 61 | set_fact: |
88 | | - packages: "{{ packages + ['ip-bridge'] }}" |
| 62 | + dsa__packages__to_merge: [] |
89 | 63 | when: |
90 | | - - dsa_ports is defined |
| 64 | + - not (dsa_ports is defined) |
91 | 65 |
|
92 | 66 | - name: "Add QOS support if configured" |
93 | 67 | set_fact: |
94 | | - packages: "{{ packages + ['qos-scripts'] }}" |
| 68 | + qos__packages__to_merge: [] |
95 | 69 | when: |
96 | | - - networks is defined |
97 | | - - networks | selectattr('ingress', 'defined') | count > 0 or networks | selectattr('egress', 'defined') | count > 0 |
| 70 | + - networks is not defined or networks | selectattr('ingress', 'defined') | count == 0 or networks | selectattr('egress', 'defined') | count == 0 |
0 commit comments