1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/nomad_ynh.git synced 2024-09-03 19:55:53 +02:00

client_lxc specific parameters

This commit is contained in:
yalh76 2022-07-23 16:56:59 +02:00
parent 7b1afd5ee2
commit dd981783dd
6 changed files with 17 additions and 17 deletions

View file

@ -1,5 +1,5 @@
lxc.net.0.type = veth 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.flags = up
lxc.net.0.hwaddr = 00:16:3e:xx:xx:xx lxc.net.0.hwaddr = 00:16:3e:xx:xx:xx
lxc.apparmor.profile = generated lxc.apparmor.profile = generated

View file

@ -1,2 +1,2 @@
bind-interfaces bind-interfaces
except-interface=__LXC_BRIDGE__ except-interface=__CLIENT_LXC_BRIDGE__

View file

@ -1,9 +1,9 @@
USE_LXC_BRIDGE="true" USE_LXC_BRIDGE="true"
LXC_BRIDGE="__LXC_BRIDGE__" LXC_BRIDGE="__CLIENT_LXC_BRIDGE__"
LXC_ADDR="__PLAGE_IP__.1" LXC_ADDR="__CLIENT_LXC_PLAGE_IP__.1"
LXC_NETMASK="255.255.255.0" LXC_NETMASK="255.255.255.0"
LXC_NETWORK="__PLAGE_IP__.0/24" LXC_NETWORK="__CLIENT_LXC_PLAGE_IP__.0/24"
LXC_DHCP_RANGE="__PLAGE_IP__.2,__PLAGE_IP__.254" LXC_DHCP_RANGE="__CLIENT_LXC_PLAGE_IP__.2,__CLIENT_LXC_PLAGE_IP__.254"
LXC_DHCP_MAX="253" LXC_DHCP_MAX="253"
LXC_DHCP_CONFILE="" LXC_DHCP_CONFILE=""
LXC_DOMAIN="" LXC_DOMAIN=""

View file

@ -35,9 +35,9 @@ driver_lxc=$YNH_APP_ARG_DRIVER_LXC
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
lxc_bridge="lxcbr0" client_lxc_bridge="lxcbr0"
plage_ip="10.1.44" client_lxc_plage_ip="10.1.44"
main_iface=$(ip route | grep default | awk '{print $5;}') client_lxc_main_iface=$(ip route | grep default | awk '{print $5;}')
#================================================= #=================================================
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS # 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=retry_join --value=$retry_join
ynh_app_setting_set --app=$app --key=server_ip --value=$server_ip 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=driver_lxc --value=$driver_lxc
ynh_app_setting_set --app=$app --key=lxc_bridge --value=$lxc_bridge ynh_app_setting_set --app=$app --key=client_lxc_bridge --value=$client_lxc_bridge
ynh_app_setting_set --app=$app --key=plage_ip --value=$plage_ip ynh_app_setting_set --app=$app --key=client_lxc_plage_ip --value=$client_lxc_plage_ip
ynh_app_setting_set --app=$app --key=main_iface --value=$main_iface ynh_app_setting_set --app=$app --key=client_lxc_main_iface --value=$client_lxc_main_iface
#================================================= #=================================================
# STANDARD MODIFICATIONS # STANDARD MODIFICATIONS

View file

@ -84,7 +84,7 @@ then
if [ $driver_lxc -eq 1 ] if [ $driver_lxc -eq 1 ]
then 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" ynh_systemd_action --service_name=lxc-net --action="stop"
systemctl disable lxc-net --quiet systemctl disable lxc-net --quiet

View file

@ -119,10 +119,10 @@ if [ "$node_type" == "client" ]
then then
if [ $driver_lxc -eq 1 ] if [ $driver_lxc -eq 1 ]
then 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)
plage_ip=$(ynh_app_setting_get --app=$app --key=plage_ip) client_lxc_plage_ip=$(ynh_app_setting_get --app=$app --key=client_lxc_plage_ip)
main_iface=$(ip route | grep default | awk '{print $5;}') client_lxc_main_iface=$(ip route | grep default | awk '{print $5;}')
ynh_app_setting_set --app=$app --key=main_iface --value=$main_iface 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" ynh_add_config --template="../conf/dnsmasq-lxd" --destination="/etc/dnsmasq.d/lxd"
systemctl restart dnsmasq systemctl restart dnsmasq