A simple echo vnf
The lifecycle management are defined in ETSI GS NFV-IFA 007. The events are implemented in the ansible/events
folder
The VNF uses a collection of ansible roles to set up the environment.
ansible-galaxy install -r ansible/requirements.yml
This can be a server or a local VM on your machine
- Generate ssh key to use to run ansible without password.
ssh-keygen
# Copy the public key to the machine
cat ~/.ssh/local_rsa.pub | ssh [email protected] "mkdir ~/.ssh && cat >> ~/.ssh/authorized_keys"
- Create inventory
The scenario and the plays depend on a host group libpcap. The group should the the VNF name. This will mean that wehn we have a number of VNFs on a host, their variables will be found under the VNFs group name.
Using .INI
[libpcap]
server1 ansible_host=192.168.122.185 ansible_user=olan ansible_ssh_private_key_file=~/.ssh/local_rsa
[libpcap:vars]
vnf_path=/home/libpcap_echo_server
receive_interface=eth2
send_interface=eth2
Using YAML
---
vnf_path: /home/libpcap_echo_server
receive_interface: eth2
send_interface: eth2
You can run the test using molecule
cd ansible
molecule test
If you want to do some debug
cd ansible
# Run the tasks defined in molecule/converge
molecule converge
# ssh into the container
molecule login
# print the logs of the service
journalctl -o json-pretty -u olan-libpcap-echo-server