aboutsummaryrefslogtreecommitdiffstats
path: root/tutorials/vFWDT/playbooks/vfw-sink
diff options
context:
space:
mode:
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