From 5187d6ed8d485729aa2d34cb040b26c12a6e69ad Mon Sep 17 00:00:00 2001 From: Dan Radez Date: Wed, 6 Jul 2016 09:35:07 -0400 Subject: Splitting post-install into functions file trying to reduce the monolith deploy.sh to smaller parts Change-Id: Ie7068473e4ddd8eeca28ebd03de57781222ad761 Signed-off-by: Dan Radez --- build/opnfv-apex-common.spec | 2 + ci/deploy.sh | 146 +--------------------------------------- lib/post-install-functions.sh | 153 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 156 insertions(+), 145 deletions(-) create mode 100755 lib/post-install-functions.sh diff --git a/build/opnfv-apex-common.spec b/build/opnfv-apex-common.spec index 231b4801..8808cdb1 100644 --- a/build/opnfv-apex-common.spec +++ b/build/opnfv-apex-common.spec @@ -57,6 +57,7 @@ install lib/parse-functions.sh %{buildroot}%{_var}/opt/opnfv/lib/ install lib/virtual-setup-functions.sh %{buildroot}%{_var}/opt/opnfv/lib/ install lib/undercloud-functions.sh %{buildroot}%{_var}/opt/opnfv/lib/ install lib/overcloud-deploy-functions.sh %{buildroot}%{_var}/opt/opnfv/lib/ +install lib/post-install-functions.sh %{buildroot}%{_var}/opt/opnfv/lib/ install lib/utility-functions.sh %{buildroot}%{_var}/opt/opnfv/lib/ install lib/python/apex_python_utils.py %{buildroot}%{_var}/opt/opnfv/lib/python/ mkdir -p %{buildroot}%{python3_sitelib}/apex/ @@ -94,6 +95,7 @@ install config/inventory/pod_example_settings.yaml %{buildroot}%{_docdir}/opnfv/ %{_var}/opt/opnfv/lib/virtual-setup-functions.sh %{_var}/opt/opnfv/lib/undercloud-functions.sh %{_var}/opt/opnfv/lib/overcloud-deploy-functions.sh +%{_var}/opt/opnfv/lib/post-install-functions.sh %{_var}/opt/opnfv/lib/utility-functions.sh %{_var}/opt/opnfv/lib/python/ %{python3_sitelib}/apex/ diff --git a/ci/deploy.sh b/ci/deploy.sh index c00b2c5c..b25392f1 100755 --- a/ci/deploy.sh +++ b/ci/deploy.sh @@ -63,6 +63,7 @@ $LIB/parse-functions.sh $LIB/virtual-setup-functions.sh $LIB/undercloud-functions.sh $LIB/overcloud-deploy-functions.sh +$LIB/post-install-functions.sh $LIB/utility-functions.sh $LIB/installer/onos/onos_gw_mac_update.sh ) @@ -104,151 +105,6 @@ function verify_internet { fi } -##Post configuration after install -##params: none -function configure_post_install { - local opnfv_attach_networks ovs_ip ip_range net_cidr tmp_ip - opnfv_attach_networks="admin_network public_network" - - echo -e "${blue}INFO: Post Install Configuration Running...${reset}" - - echo -e "${blue}INFO: Configuring ssh for root to overcloud nodes...${reset}" - # copy host key to instack - scp ${SSH_OPTIONS[@]} /root/.ssh/id_rsa.pub "stack@$UNDERCLOUD":jumphost_id_rsa.pub - - # add host key to overcloud nodes authorized keys - ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" << EOI -source stackrc -nodes=\$(nova list | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+") -for node in \$nodes; do -cat ~/jumphost_id_rsa.pub | ssh -T ${SSH_OPTIONS[@]} "heat-admin@\$node" 'cat >> ~/.ssh/authorized_keys' -done -EOI - - if [ "${deploy_options_array['dataplane']}" == 'ovs_dpdk' ]; then - echo -e "${blue}INFO: Bringing up br-phy and ovs-agent for dpdk compute nodes...${reset}" - compute_nodes=$(undercloud_connect stack "source stackrc; nova list | grep compute | wc -l") - i=0 - while [ "$i" -lt "$compute_nodes" ]; do - overcloud_connect compute${i} "sudo ifup br-phy; sudo systemctl restart neutron-openvswitch-agent" - i=$((i + 1)) - done - fi - - ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <> ~/.ssh/authorized_keys' +done +EOI + + if [ "${deploy_options_array['dataplane']}" == 'ovs_dpdk' ]; then + echo -e "${blue}INFO: Bringing up br-phy and ovs-agent for dpdk compute nodes...${reset}" + compute_nodes=$(undercloud_connect stack "source stackrc; nova list | grep compute | wc -l") + i=0 + while [ "$i" -lt "$compute_nodes" ]; do + overcloud_connect compute${i} "sudo ifup br-phy; sudo systemctl restart neutron-openvswitch-agent" + i=$((i + 1)) + done + fi + + ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <