NFP[Contrib] - Vyos service day0 configuration
Vyos service day0 configuration installation. Vyos password is by default 'vyos' after installation. User can still customize the password in the day0 file before service launch. Change-Id: I5041f8b8fcfe1e70c3c2b54076d586ca87b54925 Closes-Bug: 1681471
This commit is contained in:
parent
5f34af5bdc
commit
5350967066
|
@ -436,7 +436,12 @@ function copy_nfp_files_and_start_process {
|
|||
sudo rm -rf /etc/nfp*
|
||||
sudo cp -r bin/nfp.ini /etc/
|
||||
sudo cp -r bin/nfp_proxy /usr/bin/
|
||||
[[ $NFP_DEVSTACK_MODE = advanced ]] && sudo bash -c 'cat '$NFPSERVICE_DIR'/gbpservice/contrib/nfp/bin/nfp.ini >> /etc/nfp.ini'
|
||||
if [[ $NFP_DEVSTACK_MODE = advanced ]]; then
|
||||
sudo bash -c 'cat '$NFPSERVICE_DIR'/gbpservice/contrib/nfp/bin/nfp.ini >> /etc/nfp.ini'
|
||||
sudo mkdir -p /etc/nfp/vyos/
|
||||
sudo cp -r $NFPSERVICE_DIR/gbpservice/contrib/nfp/bin/vyos.day0 /etc/nfp/vyos/
|
||||
sudo sed -i 's/"password": ""/"password": "vyos"/' /etc/nfp/vyos/vyos.day0
|
||||
fi
|
||||
if [[ $NFP_DEVSTACK_MODE = base ]]; then
|
||||
configurator_ip=127.0.0.1
|
||||
configurator_port=8080
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"vyos": {
|
||||
"username": "vyos",
|
||||
"password": ""
|
||||
}
|
||||
}
|
|
@ -17,6 +17,8 @@ import time
|
|||
|
||||
from neutron._i18n import _LI
|
||||
|
||||
from neutron._i18n import _LI
|
||||
|
||||
from gbpservice.contrib.nfp.configurator.drivers.base import base_driver
|
||||
from gbpservice.contrib.nfp.configurator.drivers.vpn.vyos import (
|
||||
vyos_vpn_constants as const)
|
||||
|
|
|
@ -98,6 +98,9 @@ def set_keystone_authtoken_section():
|
|||
|
||||
def configure_nfp():
|
||||
commands.getoutput("cat /usr/lib/python2.7/site-packages/gbpservice/contrib/nfp/bin/nfp.ini >> /etc/nfp.ini")
|
||||
commands.getoutput("mkdir -p /etc/nfp/vyos/")
|
||||
commands.getoutput("cp -r /usr/lib/python2.7/site-packages/gbpservice/contrib/nfp/bin/vyos.day0 /etc/nfp/vyos/")
|
||||
commands.getoutput("sed -i 's/\"password\": \"\"/\"password\": \"vyos\"/' /etc/nfp/vyos/vyos.day0")
|
||||
set_keystone_authtoken_section()
|
||||
check_if_apic_sys()
|
||||
curr_service_plugins = commands.getoutput("crudini --get /etc/neutron/neutron.conf DEFAULT service_plugins")
|
||||
|
|
|
@ -60,12 +60,8 @@ def is_vpn_in_service_chain(sc_specs):
|
|||
return False
|
||||
|
||||
|
||||
def get_config_file(dir_name, service_vendor):
|
||||
file_name = ''
|
||||
for _file in os.listdir(dir_name):
|
||||
if _file.startswith(service_vendor):
|
||||
file_name = _file
|
||||
break
|
||||
def get_config_file(service_vendor):
|
||||
file_name = service_vendor + '.day0'
|
||||
return file_name
|
||||
|
||||
|
||||
|
@ -75,16 +71,16 @@ def get_service_vm_context(service_vendor, tenant_name=None):
|
|||
:param tenant_name
|
||||
|
||||
- Day0 file name must start with service vendor name followed by
|
||||
string '_day0'
|
||||
e.g Vyos day0 file name can be vyos_day0.json or vyos_day0
|
||||
string '.day0'
|
||||
e.g Vyos day0 file name must be vyos.day0
|
||||
- File format can be of any type like text file, json file etc
|
||||
|
||||
- service vendor specific default day0 config file
|
||||
/etc/nfp/<service_vendor>/<day0_file>
|
||||
e.g /etc/nfp/vyos/vyos_day0.json
|
||||
e.g /etc/nfp/vyos/vyos.day0
|
||||
- tenant specific vendor day0 config file
|
||||
/etc/nfp/<service_vendor>/<tenant_name>/<day0_file>
|
||||
e.g /etc/nfp/vyos/services/vyos_day0.json
|
||||
e.g /etc/nfp/vyos/services/vyos.day0
|
||||
|
||||
Returns - day0 config file
|
||||
"""
|
||||
|
@ -95,14 +91,12 @@ def get_service_vm_context(service_vendor, tenant_name=None):
|
|||
if tenant_name:
|
||||
tenant_day0_dir = vendor_day0_dir + tenant_name + '/'
|
||||
if os.path.isdir(tenant_day0_dir):
|
||||
file_name = get_config_file(tenant_day0_dir,
|
||||
service_vendor)
|
||||
file_name = get_config_file(service_vendor)
|
||||
if file_name:
|
||||
day0_config_file = tenant_day0_dir + file_name
|
||||
else:
|
||||
if os.path.isdir(vendor_day0_dir):
|
||||
file_name = get_config_file(vendor_day0_dir,
|
||||
service_vendor)
|
||||
file_name = get_config_file(service_vendor)
|
||||
day0_config_file = vendor_day0_dir + file_name
|
||||
else:
|
||||
day0_config_file = '/fake_file_path'
|
||||
|
|
Loading…
Reference in New Issue