summaryrefslogtreecommitdiffstats
path: root/tutorials/vFWDT/playbooks/vfw-sink
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/vfw-sink
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/vfw-sink')
-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
3 files changed, 58 insertions, 0 deletions
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