From 5eeaa6ef80fdc034369cef4d84840febcb793b2a 2024-02-17 13:38:27 From: Branko Majic Date: 2024-02-17 13:38:27 Subject: [PATCH] MAR-194: Configure static IPv6 addresses for testing of common role: - Requires some additional steps to be done when preparing the development machine, since VirtualBox prohibits use of network subnets that are not explicitly configured for use with private networks. --- diff --git a/docs/development.rst b/docs/development.rst index affb4b1cdc2144dc5131a4611d0480381a0ec3eb..558f3bce66d044b8c553a5469dc10abc68f22fee 100644 --- a/docs/development.rst +++ b/docs/development.rst @@ -36,21 +36,37 @@ performing the following steps: to use latest versions available. At time of this writing the role tests have been successfully run on *VirtualBox 5.2.12* and *Vagrant 2.0.4*. -3. Clone the git repository:: +3. In order to allow static IPv6 addresses to be allocated to virtual + machines during testing, it is necessary to explicitly white-list + the range used by the tests. Once the configuration file has been + created, however, even the VirtualBox default allowed IPv4 subnet + needs to be in the configuration explicitly as well. + + Update the VirtulBox configuration file (and make sure it can be + read by the user running the tests): + + :file:`/etc/vbox/networks.conf` + + :: + + * 192.168.56.0/21 + * fd00::192:168:56:0/116 + +4. Clone the git repository:: git clone https://code.majic.rs/majic-ansible-roles/ ~/projects/ -4. Create a separate Python virtual environment:: +5. Create a separate Python virtual environment:: mkvirtualenv majic-ansible-roles -a ~/projects/majic-ansible-roles/ -5. Make sure the virtual environment has been activated, and install `pip-tools +6. Make sure the virtual environment has been activated, and install `pip-tools `_:: workon majic-ansible-roles pip install pip-tools -6. Synchronise Python virtual environment with requirements file using +7. Synchronise Python virtual environment with requirements file using **pip-tools**:: workon majic-ansible-roles diff --git a/roles/common/molecule/default/molecule.yml b/roles/common/molecule/default/molecule.yml index 63073c4e1ce258359364344926b2c81c53d8d451..03df9bbfcaf37a8b91ae93f4a944b4772d9803a9 100644 --- a/roles/common/molecule/default/molecule.yml +++ b/roles/common/molecule/default/molecule.yml @@ -24,6 +24,11 @@ platforms: ip: 192.168.56.2 network_name: private_network type: static + - auto_config: true + ip: fd00::192:168:56:2 + network_name: private_network + netmask: 116 + type: static - name: client1 groups: @@ -39,6 +44,11 @@ platforms: ip: 192.168.56.3 network_name: private_network type: static + - auto_config: true + ip: fd00::192:168:56:3 + network_name: private_network + netmask: 116 + type: static - name: client2 groups: @@ -54,6 +64,11 @@ platforms: ip: 192.168.56.4 network_name: private_network type: static + - auto_config: true + ip: fd00::192:168:56:4 + network_name: private_network + netmask: 116 + type: static - name: parameters-mandatory-bullseye groups: @@ -68,6 +83,11 @@ platforms: ip: 192.168.56.31 network_name: private_network type: static + - auto_config: true + ip: fd00::192:168:56:31 + network_name: private_network + netmask: 116 + type: static - name: parameters-optional-bullseye groups: @@ -82,6 +102,11 @@ platforms: ip: 192.168.56.32 network_name: private_network type: static + - auto_config: true + ip: fd00::192:168:56:32 + network_name: private_network + netmask: 116 + type: static provisioner: name: ansible diff --git a/roles/common/molecule/default/prepare.yml b/roles/common/molecule/default/prepare.yml index 10e953f9da9fe5ff5f2b8eeafbda47e65c634c53..cea4db88c576368f5715f7e838eb9cabd3fe02b0 100644 --- a/roles/common/molecule/default/prepare.yml +++ b/roles/common/molecule/default/prepare.yml @@ -72,6 +72,8 @@ with_dict: 192.168.56.31: parameters-mandatory-bullseye 192.168.56.32: parameters-optional-bullseye + fd00::192:168:56:31: parameters-mandatory-bullseye + fd00::192:168:56:32: parameters-optional-bullseye - hosts: parameters-mandatory,parameters-optional become: true