Browse Source

test container creation

main
pvincent 2 weeks ago
parent
commit
a773203b13
  1. 27
      sympa/miaou/miaou-migrate-sympa-from-container

27
sympa/miaou/miaou-migrate-sympa-from-container

@ -69,14 +69,20 @@ function get_container_net0 {
function stop_old_container { function stop_old_container {
pct-stop $CONTAINER pct-stop $CONTAINER
pct-rename $CONTAINER $CONTAINER.OLD
pct-rename $CONTAINER $CONTAINER.9
} }
function create_new_container{
# miaou-create $CONTAINER
# pct-stop $CONTAINER
local net1="net1: $(get_container_net0 | cut -d' ' -f2)"
echo $net1
function create_new_container {
miaou-create $CONTAINER
local vmid=$(pct-lookup $CONTAINER)
local vm_conf_file="/etc/pve/nodes/$(hostname)/lxc/$vmid.conf"
local net1="net1: $(grep ^net0 $vm_conf_file | cut -d' ' -f2 | sed 's/name=eth0/name=eth1/')"
pct stop $vmid
/opt/miaou-bash/tools/append_or_replace "^net0.*$" "$SYMPA_NET0\n$net1" $vm_conf_file
pct start $vmid
} }
# MAIN # MAIN
@ -84,13 +90,12 @@ function create_new_container{
set -Eue set -Eue
parse_options $* parse_options $*
assert_proxmox assert_proxmox
# assert_container_sympa_debian9
# export_sympa
# get_container_net0
# stop_old_container
assert_container_sympa_debian9
export_sympa
get_container_net0
stop_old_container
create_new_container create_new_container
# 4. create container with same IP
# 5. install sympa # 5. install sympa
# 6. import old data # 6. import old data
# 7. fix_dmarc_off + fix_dkim_global_on + fix external origin # 7. fix_dmarc_off + fix_dkim_global_on + fix external origin

Loading…
Cancel
Save