Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions roles/libvirt_manager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Used for checking if:
* `cifmw_libvirt_manager_default_gw_nets`: (List[String]) List of networks used as default gateway. If not set, defaults to the `cifmw_libvirt_manager_pub_net`. Read bellow for more information about that parameter.
* `cifmw_libvirt_manager_vm_users`: (List[Dict]) Used to override the default list of users enabled in the vm. For its format, refers to cloud-init [documentation](https://cloudinit.readthedocs.io/en/latest/reference/modules.html#users-and-groups) about `users`. Defaults to `[]`.
* `cifmw_libvirt_manager_extra_network_configuration`: (Dict) Extra network configuration in nmstate format for the hypervisor. This configuration is applied after creating the libvirt networks, so it can be used to create VLAN interfaces on the libvirt bridges. In addition to nmstate, it also supports a `cifmw_firewall_zone` hint in nmstate interfaces. Defaults to: `{}`.
* `cifmw_libvirt_manager_radvd_networks`: (List[Dict]) List of networks to configure with radvd for IPv6 router advertisements. When defined, the `radvd` role will be included after network creation. Each network definition follows the format documented in the `radvd` role. Defaults to `[]`.

### `cifmw_libvirt_manager_default_gw_nets` parameter usage

Expand Down Expand Up @@ -245,3 +246,20 @@ layout used by the role.
name: libvirt_manager
tasks_from: attack_interface.yml
```

## IPv6 Router Advertisements with radvd

The libvirt_manager role can automatically configure IPv6 router advertisements using the `radvd` role. This is useful for providing SLAAC and/or DHCPv6 configuration to VMs on IPv6-enabled networks.

To enable radvd, define `cifmw_libvirt_manager_radvd_networks` with a list of network configurations:

```yaml
cifmw_libvirt_manager_radvd_networks:
- name: cifmw-testnet1
adv_managed_flag: true
adv_other_config_flag: true
prefixes:
- network: "2001:db8:1::/64"
```

For complete documentation on available parameters and configuration options, refer to the [radvd role documentation](../radvd/README.md).
1 change: 1 addition & 0 deletions roles/libvirt_manager/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,4 @@ cifmw_libvirt_manager_attach_dummy_interface_on_bridges: true
cifmw_libvirt_manager_extra_network_configuration: {}

cifmw_libvirt_manager_vm_users: []
cifmw_libvirt_manager_radvd_networks: []
5 changes: 5 additions & 0 deletions roles/libvirt_manager/tasks/clean_layout.yml
Original file line number Diff line number Diff line change
Expand Up @@ -341,3 +341,8 @@
ansible.builtin.import_role:
name: dnsmasq
tasks_from: cleanup.yml

- name: Clean radvd
ansible.builtin.import_role:
name: radvd
tasks_from: cleanup.yml
8 changes: 8 additions & 0 deletions roles/libvirt_manager/tasks/create_networks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,14 @@
loop_control:
label: "{{ item.name }}"

- name: Deploy radvd for IPv6 router advertisements
when:
- cifmw_libvirt_manager_radvd_networks | length > 0
vars:
cifmw_radvd_networks: "{{ cifmw_libvirt_manager_radvd_networks }}"
ansible.builtin.include_role:
name: radvd

- name: Ensure network is in correct zone
become: true
notify: Restart firewalld
Expand Down
Loading