diff --git a/conf/default.conf b/conf/default.conf index 89f8c4b..ae6ea01 100644 --- a/conf/default.conf +++ b/conf/default.conf @@ -1,5 +1,5 @@ lxc.net.0.type = veth -lxc.net.0.link = __LXC_BRIDGE__ +lxc.net.0.link = __CLIENT_LXC_BRIDGE__ lxc.net.0.flags = up lxc.net.0.hwaddr = 00:16:3e:xx:xx:xx lxc.apparmor.profile = generated diff --git a/conf/dnsmasq-lxd b/conf/dnsmasq-lxd index aa50cdd..ebadaf0 100644 --- a/conf/dnsmasq-lxd +++ b/conf/dnsmasq-lxd @@ -1,2 +1,2 @@ bind-interfaces -except-interface=__LXC_BRIDGE__ +except-interface=__CLIENT_LXC_BRIDGE__ diff --git a/conf/lxc-net b/conf/lxc-net index c19bedb..2307d88 100644 --- a/conf/lxc-net +++ b/conf/lxc-net @@ -1,9 +1,9 @@ USE_LXC_BRIDGE="true" -LXC_BRIDGE="__LXC_BRIDGE__" -LXC_ADDR="__PLAGE_IP__.1" +LXC_BRIDGE="__CLIENT_LXC_BRIDGE__" +LXC_ADDR="__CLIENT_LXC_PLAGE_IP__.1" LXC_NETMASK="255.255.255.0" -LXC_NETWORK="__PLAGE_IP__.0/24" -LXC_DHCP_RANGE="__PLAGE_IP__.2,__PLAGE_IP__.254" +LXC_NETWORK="__CLIENT_LXC_PLAGE_IP__.0/24" +LXC_DHCP_RANGE="__CLIENT_LXC_PLAGE_IP__.2,__CLIENT_LXC_PLAGE_IP__.254" LXC_DHCP_MAX="253" LXC_DHCP_CONFILE="" LXC_DOMAIN="" diff --git a/scripts/install b/scripts/install index 1c3289f..27645a0 100644 --- a/scripts/install +++ b/scripts/install @@ -35,9 +35,9 @@ driver_lxc=$YNH_APP_ARG_DRIVER_LXC app=$YNH_APP_INSTANCE_NAME -lxc_bridge="lxcbr0" -plage_ip="10.1.44" -main_iface=$(ip route | grep default | awk '{print $5;}') +client_lxc_bridge="lxcbr0" +client_lxc_plage_ip="10.1.44" +client_lxc_main_iface=$(ip route | grep default | awk '{print $5;}') #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS @@ -59,9 +59,9 @@ ynh_app_setting_set --app=$app --key=bootstrap_expect --value=$bootstrap_expect ynh_app_setting_set --app=$app --key=retry_join --value=$retry_join ynh_app_setting_set --app=$app --key=server_ip --value=$server_ip ynh_app_setting_set --app=$app --key=driver_lxc --value=$driver_lxc -ynh_app_setting_set --app=$app --key=lxc_bridge --value=$lxc_bridge -ynh_app_setting_set --app=$app --key=plage_ip --value=$plage_ip -ynh_app_setting_set --app=$app --key=main_iface --value=$main_iface +ynh_app_setting_set --app=$app --key=client_lxc_bridge --value=$client_lxc_bridge +ynh_app_setting_set --app=$app --key=client_lxc_plage_ip --value=$client_lxc_plage_ip +ynh_app_setting_set --app=$app --key=client_lxc_main_iface --value=$client_lxc_main_iface #================================================= # STANDARD MODIFICATIONS diff --git a/scripts/remove b/scripts/remove index 1f58367..0a4afe1 100755 --- a/scripts/remove +++ b/scripts/remove @@ -84,7 +84,7 @@ then if [ $driver_lxc -eq 1 ] then - lxc_bridge=$(ynh_app_setting_get --app=$app --key=lxc_bridge) + client_lxc_bridge=$(ynh_app_setting_get --app=$app --key=client_lxc_bridge) ynh_systemd_action --service_name=lxc-net --action="stop" systemctl disable lxc-net --quiet diff --git a/scripts/restore b/scripts/restore index 98b03d0..7ecc196 100644 --- a/scripts/restore +++ b/scripts/restore @@ -119,10 +119,10 @@ if [ "$node_type" == "client" ] then if [ $driver_lxc -eq 1 ] then - lxc_bridge=$(ynh_app_setting_get --app=$app --key=lxc_bridge) - plage_ip=$(ynh_app_setting_get --app=$app --key=plage_ip) - main_iface=$(ip route | grep default | awk '{print $5;}') - ynh_app_setting_set --app=$app --key=main_iface --value=$main_iface + client_lxc_bridge=$(ynh_app_setting_get --app=$app --key=client_lxc_bridge) + client_lxc_plage_ip=$(ynh_app_setting_get --app=$app --key=client_lxc_plage_ip) + client_lxc_main_iface=$(ip route | grep default | awk '{print $5;}') + ynh_app_setting_set --app=$app --key=client_lxc_main_iface --value=$client_lxc_main_iface ynh_add_config --template="../conf/dnsmasq-lxd" --destination="/etc/dnsmasq.d/lxd" systemctl restart dnsmasq