Changeset - 5eeaa6ef80fd
[Not reviewed]
0 3 0
Branko Majic (branko) - 2 months ago 2024-02-17 13:38:27
branko@majic.rs
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.
3 files changed with 47 insertions and 4 deletions:
0 comments (0 inline, 0 general)
docs/development.rst
Show inline comments
 
@@ -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
 
   <https://github.com/jazzband/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
roles/common/molecule/default/molecule.yml
Show inline comments
 
@@ -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
roles/common/molecule/default/prepare.yml
Show inline comments
 
@@ -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
0 comments (0 inline, 0 general)