docs 📝: Updated README for multiple bridges and improved persistence method.
Some checks failed
ansible-lint / Ansible Lint (push) Failing after 9s

The README has been updated to include instructions for supporting multiple bridges and enhancing the persistence method.
This commit is contained in:
2025-12-26 11:54:23 +01:00
parent 47d10beea0
commit b1b73151b6
3 changed files with 82 additions and 147 deletions

View File

@@ -5,10 +5,10 @@ A robust, idempotent Ansible role for enabling persistent Wake-on-LAN (WOL) on P
## Features
**Fully Idempotent**: Checks current WOL status and only applies changes when needed
**Bridge Support**: Automatically detects physical interfaces backing configured bridges
**Multiple Bridge Support**: Configure WOL on multiple bridges simultaneously
**Bond0 Detection**: Automatically detects and configures bonded interfaces
**Ansible Facts-Based**: Uses Ansible facts to detect and validate WOL-capable interfaces
**Persistent**: Uses udev rules for persistence across reboots
**Safe & Persistent**: Uses udev rules for persistence across reboots
**Comprehensive Validation**: Verifies WOL capability before configuration
**Detailed Reporting**: Shows configuration status and MAC addresses for WOL senders
@@ -25,12 +25,12 @@ A robust, idempotent Ansible role for enabling persistent Wake-on-LAN (WOL) on P
1. **Package Installation**: Ensures `ethtool` is installed for WOL management
2. **Interface Discovery**: Uses Ansible facts to identify all physical Ethernet interfaces
3. **Bridge Mapping**: Detects physical interfaces backing configured bridges
4. **Bond0 Detection**: Identifies bonded interfaces and their slaves
5. **WOL Validation**: Tests each interface for Wake-on-LAN capability using ethtool
3. **WOL Validation**: Tests each interface for Wake-on-LAN capability using ethtool
4. **Bridge Mapping**: Maps configured bridges to their backing WOL-capable physical NICs
5. **Bond0 Detection**: Detects if interfaces are bonded and extracts slave information
6. **Idempotency Check**: Reads current WOL status to avoid redundant changes
7. **Enable WOL**: Applies WOL settings only to interfaces that need it
8. **Persist Settings**: Creates udev rules for persistence across reboots
8. **Persist Settings**: Creates/updates udev rules for persistence across reboots
9. **Reload Udev**: Reloads udev rules and triggers network interface refresh
10. **Verification & Reporting**: Displays WOL configuration status and MAC addresses
@@ -155,7 +155,10 @@ This role is fully idempotent. Running it multiple times has the same effect as
## Implementation Details
### Persistence Method
WOL settings are persisted using udev rules at `/etc/udev/rules.d/90-wol.rules`. This ensures WOL is re-enabled whenever network interfaces are added or the system reboots.
WOL settings are persisted using udev rules at `/etc/udev/rules.d/90-wol.rules`. This is the most reliable method for Debian/Proxmox systems and survives:
- System reboots
- Network service restarts
- Interface state changes
Example generated udev rule:
```
@@ -164,14 +167,10 @@ ACTION=="add", SUBSYSTEM=="net", KERNEL=="eno1", RUN+="/sbin/ethtool -s eno1 wol
### Detection Logic
1. **Interface Discovery**: Uses Ansible facts to enumerate all network interfaces
2. **Bridge Mapping**: Identifies physical interfaces backing configured bridges using `bridge link show`
3. **Bond0 Detection**: Detects bonded interfaces and extracts slave information from `/proc/net/bonding/bond0`
4. **WOL Capability Testing**: Tests each physical interface with ethtool to verify WOL support
5. **Idempotency Check**: Reads current WOL status to avoid redundant changes
6. **Enable WOL**: Applies WOL settings only to interfaces that need it
7. **Persist Settings**: Creates/updates udev rules for persistence
8. **Reload Udev**: Reloads udev rules and triggers network interface refresh
9. **Verification & Reporting**: Displays WOL configuration status and MAC addresses
2. **Physical Interface Filtering**: Filters for Ethernet interfaces, excluding virtual interfaces (veth, tap, fw*, docker, br*)
3. **WOL Capability Testing**: Tests each physical interface with ethtool to verify WOL support
4. **Bridge Mapping**: Maps configured bridges to their backing WOL-capable physical NICs
5. **Bond0 Detection**: Extracts slave interfaces from `/proc/net/bonding/bond0` when present
## Troubleshooting
@@ -217,4 +216,4 @@ MIT
## Author
Ansible Proxmox WOL Contributors
Ansible Proxmox WOL Contributors