-
Notifications
You must be signed in to change notification settings - Fork 25
Static network configuration
Although you can rely on DHCP, there is also the option of injecting static network configuration for the remote workers. This is useful for the cases where there is no possibility of having a configurable DHCP and DNS server.
This feature is achieved by injecting an static network configuration folder structure, that is being packed as a ramdisk and then added into the ISO that will be installed into the workers.
Each worker node should have its own network folder, and it can contain the needed files, such as the /etc/hostname, or the nmconnection files. A sample network folder structure looks like:
/opt/network-config
└── etc
··├── hostname
··└── NetworkManager
····└── system-connections
····└── eno1.nmconnection
The content of the files need to match your environment, but you can see a sample:
[yolanda@localhost ai-deploy-cluster-remoteworker]$ cat /opt/network-config/etc/hostname
worker-1.test-aut.cluster-testing
and:
[yolanda@localhost ai-deploy-cluster-remoteworker]$ cat /opt/network-config/etc/NetworkManager/system-connections/eno1.nmconnection
[connection]
id=eno1
type=ethernet
interface-name=eno1
permissions=
[ethernet]
mac-address-blacklist=
[ipv4]
address1=192.168.112.29/24
dns=192.168.112.1;8.8.8.8;
gateway=192.168.112.1
method=manual
router-metric=50
[ipv6]
method=ignore
This path is a local folder on the host from where you are running the ansible playbook. The name of the nmconnection file needs to match your interface name, and the ipv4/ipv6/hostname definitions need to match with your network environment.
Currently the worker nodes are defined in the ansible inventory, following this pattern: https://github.com/redhat-ztp/ztp-cluster-deploy/blob/master/ai-deploy-cluster-remoteworker/inventory/hosts.sample#L44
The ramdisk_path on each worker should point to the local folder containing the network definition. This will be embedded on the ISO, so the network is configured on boot, and propagated through all the steps of the deployment.