aboutsummaryrefslogtreecommitdiffstats
path: root/installation
diff options
context:
space:
mode:
Diffstat (limited to 'installation')
-rw-r--r--installation/ansible-server/src/main/Playbooks/ansible_huawei_rollback@0.00.yml21
-rwxr-xr-xinstallation/sdnc/src/main/scripts/startODL.sh30
-rw-r--r--installation/src/main/properties/lcm-dg.properties2
3 files changed, 53 insertions, 0 deletions
diff --git a/installation/ansible-server/src/main/Playbooks/ansible_huawei_rollback@0.00.yml b/installation/ansible-server/src/main/Playbooks/ansible_huawei_rollback@0.00.yml
new file mode 100644
index 00000000..ef56c54f
--- /dev/null
+++ b/installation/ansible-server/src/main/Playbooks/ansible_huawei_rollback@0.00.yml
@@ -0,0 +1,21 @@
+---
+- hosts: all
+ tasks:
+ - name: create a temporary file for additional data
+ file:
+ path: /tmp/tmp-{{Id}}
+ state: touch
+ become: false
+
+ - name: prepare additional data
+ shell: echo {{additionalData}} > /tmp/tmp-{{Id}}
+ become: false
+
+ - name: execute rollback operation
+ shell: ./swm/rollback.sh {{pnfId}} {{oldSwVersion}} /tmp/tmp-{{Id}}
+
+ - name: remove the temporary file
+ file:
+ path: /tmp/tmp-{{Id}}
+ state: absent
+ become: false
diff --git a/installation/sdnc/src/main/scripts/startODL.sh b/installation/sdnc/src/main/scripts/startODL.sh
index 73e3eaa7..09876252 100755
--- a/installation/sdnc/src/main/scripts/startODL.sh
+++ b/installation/sdnc/src/main/scripts/startODL.sh
@@ -21,6 +21,26 @@
# ============LICENSE_END=========================================================
###
+# Append features to karaf boot feature configuration
+# $1 additional feature to be added
+# $2 repositories to be added (optional)
+function addToFeatureBoot() {
+ CFG=$ODL_HOME/etc/org.apache.karaf.features.cfg
+ ORIG=$CFG.orig
+ if [ -n "$2" ] ; then
+ echo "Add repository: $2"
+ mv $CFG $ORIG
+ cat $ORIG | sed -e "\|featuresRepositories|s|$|,$2|" > $CFG
+ fi
+ echo "Add boot feature: $1"
+ mv $CFG $ORIG
+ cat $ORIG | sed -e "\|featuresBoot *=|s|$|,$1|" > $CFG
+}
+
+function install_sdnrwt_features() {
+ addToFeatureBoot "$SDNRWT_BOOTFEATURES" $SDNRWT_REPOSITORY
+}
+
function enable_odl_cluster(){
if [ -z $SDNC_REPLICAS ]; then
echo "SDNC_REPLICAS is not configured in Env field"
@@ -81,6 +101,14 @@ ENABLE_ODL_CLUSTER=${ENABLE_ODL_CLUSTER:-false}
IS_PRIMARY_CLUSTER=${IS_PRIMARY_CLUSTER:-false}
MY_ODL_CLUSTER=${MY_ODL_CLUSTER:-127.0.0.1}
INSTALLED_DIR=${INSTALLED_FILE:-/opt/opendaylight/current/daexim}
+SDNRWT=${SDNRWT:-false}
+SDNRWT_BOOTFEATURES=${SDNRWT_BOOTFEATURES:-sdnr-wt-feature-aggregator}
+
+
+echo "Settings:"
+echo " ENABLE_ODL_CLUSTER=$ENABLE_ODL_CLUSTER"
+echo " SDNC_REPLICAS=$SDNC_REPLICAS"
+echo " SDNRWT=$SDNRWT"
#
# Wait for database
@@ -115,6 +143,8 @@ then
if $ENABLE_ODL_CLUSTER ; then enable_odl_cluster ; fi
+ if $SDNRWT ; then install_sdnrwt_features ; fi
+
echo "Installed at `date`" > ${INSTALLED_DIR}/.installed
fi
diff --git a/installation/src/main/properties/lcm-dg.properties b/installation/src/main/properties/lcm-dg.properties
index 3c6920e3..53cecfba 100644
--- a/installation/src/main/properties/lcm-dg.properties
+++ b/installation/src/main/properties/lcm-dg.properties
@@ -9,9 +9,11 @@ ansible.version=0.00
lcm.upgrade-pre-check.playbookname=ansible_precheck
lcm.upgrade-post-check.playbookname=ansible_postcheck
lcm.upgrade-software.playbookname=ansible_upgradesw
+lcm.rollback.playbookname=ansible_rollback
lcm.pnf.upgrade-pre-check.playbookname=ansible_precheck_pnf
lcm.pnf.upgrade-post-check.playbookname=ansible_postcheck_pnf
lcm.pnf.upgrade-software.playbookname=ansible_upgradesw_pnf
+lcm.pnf.rollback.playbookname=ansible_rollback_pnf
lcm.quiesce-traffic.playbookname=ansible_quiescetraffic
lcm.resume-traffic.playbookname=ansible_resumetraffic
lcm.distribute-traffic.playbookname=ansible_distributetraffic