Merge "[ha] Re-enable nginx proxy for Horizon"
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Thu, 6 Jun 2019 13:46:29 +0000 (13:46 +0000)
committerGerrit Code Review <gerrit@opnfv.org>
Thu, 6 Jun 2019 13:46:29 +0000 (13:46 +0000)
ci/deploy.sh
mcp/reclass/classes/cluster/mcp-common-ha/openstack_control.yml.j2
mcp/reclass/classes/cluster/mcp-common-noha/openstack_control.yml.j2
mcp/scripts/lib_jump_deploy.sh

index 75a1a88..a657f76 100755 (executable)
@@ -83,6 +83,9 @@ $(notify_i "Input parameters to the build script are:" 2)
    currently defined on cluster KVM nodes. If specified twice (e.g. -E -E),
    baremetal nodes (VCP too, implicitly) will be removed, then reprovisioned.
    Only applicable for baremetal deploys.
+   If specified 3 times, a complete uninstallation (cleanup) will be performed
+   on the jumpserver (even for virtual deploys): VMs, virsh networks,
+   containers, networks, services etc.
 -f Deploy on existing Salt master. It will skip infrastructure VM creation,
    but it will still sync reclass configuration from current repo to Salt
    Master node.
@@ -302,6 +305,10 @@ jumpserver_check_requirements "${cluster_states[*]}" "${virtual_nodes[*]}" \
 if [ ${DRY_RUN} -eq 1 ]; then
     notify "[NOTE] Dry run, skipping all deployment tasks" 2
     exit 0
+elif [ ${ERASE_ENV} -gt 2 ]; then
+    notify "[NOTE] Uninstall / cleanup all jumpserver Fuel resources" 2
+    cleanup_all "${MCP_STORAGE_DIR}" "${OPNFV_BRIDGES[@]}"
+    exit 0
 elif [ ${USE_EXISTING_INFRA} -gt 0 ]; then
     notify "[NOTE] Use existing infra: skip first ${USE_EXISTING_INFRA} states" 2
     notify "[STATE] Skipping: ${cluster_states[*]::${USE_EXISTING_INFRA}}" 2
index 9f19415..fe844e7 100644 (file)
@@ -97,7 +97,6 @@ parameters:
       cacert: /etc/ssl/certs/mcp_os_cacert
       openrc_extra:
         volume_device_name: sdc
-        block_migration: false
   glance:
     server:
       <<: *db_conn_recycle_time
index 019fc0c..cf09d59 100644 (file)
@@ -83,7 +83,6 @@ parameters:
       admin_email: ${_param:admin_email}
       openrc_extra:
         volume_device_name: sdc
-        block_migration: false
       pkgs:
         - keystone
         - python-psycopg2
index a96beca..a8444b8 100644 (file)
@@ -327,6 +327,27 @@ function create_networks {
   sudo systemctl restart opnfv-fuel-vetha
 }
 
+function cleanup_all {
+  local image_dir=$1; shift
+  local all_vnode_networks=("$@")
+  [ ! -e "${image_dir}/docker-compose" ] || COMPOSE_PREFIX="${image_dir}/"
+
+  cleanup_uefi
+  __cleanup_vms
+  sudo ip link del veth_mcp0 || true
+  sudo ip link del veth_mcp2 || true
+  for net in "mcpcontrol" "${all_vnode_networks[@]}"; do
+    if ${VIRSH} net-info "${net}" >/dev/null 2>&1; then
+      ${VIRSH} net-destroy "${net}" || true
+      ${VIRSH} net-undefine "${net}"
+    fi
+  done
+  sudo rm -f "/etc/systemd/system/multi-user.target.wants/opnfv-fuel"* \
+             "/etc/systemd/system/opnfv-fuel"*
+  sudo systemctl daemon-reload
+  "${COMPOSE_PREFIX}docker-compose" -f docker-compose/docker-compose.yaml down
+}
+
 function create_vms {
   local image_dir=$1; shift
   local image=base_image_opnfv_fuel.img