Before we run ansible we need to give it some information about our network so that when it goes to create the configuration from templates it puts the correct information in each file.
The topology file is generated from the scinet database and includes a list of vlans we need to configure (+ IP configuration) and a booth-to-access-port mapping. The topology file is generated by fauscet/genconfigs.
Place the generated yaml topology file in vars/scinet.yml
.
We now need to fill in some variables that we use to configure faucet, e.g BGP peering sessions, physical port mappings, etc. Variables are local to an environment, in the case of our ansible we have two available environments:
- inventories/development/ (Test lab @ LBNL)
- inventories/production/ (Real SCinet)
In each inventory directory is a hosts
file which says where the
configuration will be applied (this can stay the same). There is also a
group_vars/all.yml
file which needs to change to reflect
how things are plugged in and which VLAN IDs should be used. This file is
commented to explain what each option does.
Once you have setup your topology and variables, We can ask ansible to generate all configuration files for our deployment:
ansible-playbook configure.yml
We can also tell ansible to just deploy the configs for an individual service:
-
faucet controllers (/etc/faucet/*)
ansible-playbook faucet.yml
-
bird and bird6 (/etc/bird/*)
ansible-playbook bird.yml
-
dhcpd (/etc/dhcp/dhcpd.conf) and network interfaces (/etc/network/interfaces.d/nfv-interfaces)
ansible-playbook nfv.yml
Note: Ansible will not try to reload into the new configs, you will need to do that yourself:
-
faucet
sudo systemctl reload {faucet-l2|faucet-l3}
-
bird
sudo birdc configure sudo birdc6 configure
-
isc-dhcp-server
sudo systemctl restart isc-dhcp-server