summaryrefslogtreecommitdiffstats
path: root/tutorials/vFWDT/playbooks
diff options
context:
space:
mode:
authorLukasz Rajewski <lukasz.rajewski@orange.com>2020-01-01 14:39:09 +0100
committerLukasz Rajewski <lukasz.rajewski@orange.com>2020-01-02 23:28:04 +0100
commite4e0beac8bb2168303f10a4e4b9b1247fdd0501c (patch)
tree4f1b7bd777898962909f5490f593871d678a616f /tutorials/vFWDT/playbooks
parent0da47c8f827bd06ae55690f4c7cb99fdc2c188b0 (diff)
vFW Upgrade Workflow
Continuation of changes for migiration of vFW DT use case to vFW DT & Upgrade Use case. This patch contains complete and final changes in the workflow script like upgrade, lock, unlock actions. The workflow was also switched to use latest APPC VNFC Ansible support feature. Logging of LCM execution statistics also was added. Change-Id: Iba744cd485eb2460951019fb2a6c5bce5d3e37b1 Signed-off-by: Lukasz Rajewski <lukasz.rajewski@orange.com> Issue-ID: INT-1278
Diffstat (limited to 'tutorials/vFWDT/playbooks')
-rwxr-xr-xtutorials/vFWDT/playbooks/darkstatbin0 -> 391544 bytes
-rwxr-xr-xtutorials/vFWDT/playbooks/upgrade.sh6
-rwxr-xr-xtutorials/vFWDT/playbooks/vfw-sink/latest/ansible/upgradepostcheck/site.yml15
-rwxr-xr-xtutorials/vFWDT/playbooks/vfw-sink/latest/ansible/upgradeprecheck/site.yml15
-rwxr-xr-xtutorials/vFWDT/playbooks/vfw-sink/latest/ansible/upgradesoftware/site.yml28
5 files changed, 61 insertions, 3 deletions
diff --git a/tutorials/vFWDT/playbooks/darkstat b/tutorials/vFWDT/playbooks/darkstat
new file mode 100755
index 00000000..e80f43fe
--- /dev/null
+++ b/tutorials/vFWDT/playbooks/darkstat
Binary files differ
diff --git a/tutorials/vFWDT/playbooks/upgrade.sh b/tutorials/vFWDT/playbooks/upgrade.sh
index 0dd27d08..e7cadc10 100755
--- a/tutorials/vFWDT/playbooks/upgrade.sh
+++ b/tutorials/vFWDT/playbooks/upgrade.sh
@@ -19,9 +19,9 @@
#change IP addresses and upload to playbooks folder darkstat and server.py before
-SINK1=10.254.184.217
-SINK2=10.254.184.210
-VFW1=10.254.184.208
+SINK1=10.254.184.195
+SINK2=10.254.184.218
+VFW1=10.254.184.196
VFW2=10.254.184.216
echo $VFW1 > vfw_mgt_ip.txt
diff --git a/tutorials/vFWDT/playbooks/vfw-sink/latest/ansible/upgradepostcheck/site.yml b/tutorials/vFWDT/playbooks/vfw-sink/latest/ansible/upgradepostcheck/site.yml
new file mode 100755
index 00000000..6d6d51b6
--- /dev/null
+++ b/tutorials/vFWDT/playbooks/vfw-sink/latest/ansible/upgradepostcheck/site.yml
@@ -0,0 +1,15 @@
+---
+- hosts: vfw-sink
+ gather_facts: no
+ remote_user: ubuntu
+ tasks:
+ - debug: var="new_software_version"
+ failed_when: new_software_version is not defined
+ - debug: var="existing_software_version"
+ failed_when: existing_software_version is not defined
+ - name: Read OLD Software Version
+ shell: cat /opt/config/version.txt
+ register: old_version
+ become: true
+ - debug: var=old_version.stdout
+ failed_when: old_version.stdout != new_software_version
diff --git a/tutorials/vFWDT/playbooks/vfw-sink/latest/ansible/upgradeprecheck/site.yml b/tutorials/vFWDT/playbooks/vfw-sink/latest/ansible/upgradeprecheck/site.yml
new file mode 100755
index 00000000..05da22a7
--- /dev/null
+++ b/tutorials/vFWDT/playbooks/vfw-sink/latest/ansible/upgradeprecheck/site.yml
@@ -0,0 +1,15 @@
+---
+- hosts: vfw-sink
+ gather_facts: no
+ remote_user: ubuntu
+ tasks:
+ - debug: var="new_software_version"
+ failed_when: new_software_version is not defined
+ - debug: var="existing_software_version"
+ failed_when: existing_software_version is not defined
+ - name: Read OLD Software Version
+ shell: cat /opt/config/version.txt
+ register: old_version
+ become: true
+ - debug: var=old_version.stdout
+ failed_when: old_version.stdout == new_software_version
diff --git a/tutorials/vFWDT/playbooks/vfw-sink/latest/ansible/upgradesoftware/site.yml b/tutorials/vFWDT/playbooks/vfw-sink/latest/ansible/upgradesoftware/site.yml
new file mode 100755
index 00000000..1a11f082
--- /dev/null
+++ b/tutorials/vFWDT/playbooks/vfw-sink/latest/ansible/upgradesoftware/site.yml
@@ -0,0 +1,28 @@
+---
+- hosts: vfw-sink
+ gather_facts: no
+ remote_user: ubuntu
+ tasks:
+ - debug: var="new_software_version"
+ failed_when: new_software_version is not defined
+ - debug: var="existing_software_version"
+ failed_when: existing_software_version is not defined
+ - name: Read OLD Software Version
+ shell: cat /opt/config/version.txt
+ register: old_version
+ become: true
+ - debug: var=old_version.stdout
+ - block:
+ - name: Update Software
+ shell: apt-get -y --force-yes -u update
+ args:
+ warn: no
+ - name: Upgrade Version
+ shell: echo {{new_software_version}} > /opt/config/version.txt
+ - debug:
+ msg: Software version has been upgraded to {{new_software_version}}
+ become: true
+ when: old_version.stdout != new_software_version
+ - debug:
+ msg: "The software version is up to date"
+ when: old_version.stdout == new_software_version