Ensure PVC daemons are updated before reboots

This commit is contained in:
Joshua Boniface 2023-09-01 15:42:30 -04:00
parent f79d1da5be
commit 7a2d5ac0c4
2 changed files with 9 additions and 11 deletions

View File

@ -1,15 +1,13 @@
--- ---
- include: update-pvc-daemons.yml
- hosts: all - hosts: all
remote_user: deploy remote_user: deploy
become: yes become: yes
become_user: root become_user: root
gather_facts: yes gather_facts: yes
tasks: tasks:
- name: set PVC maintenance mode (legacy)
command: pvc maintenance on
run_once: yes
ignore_errors: yes
- name: set PVC maintenance mode - name: set PVC maintenance mode
command: pvc cluster maintenance on command: pvc cluster maintenance on
run_once: yes run_once: yes
@ -47,7 +45,7 @@
file: file:
dest: /var/cache/apt/archives dest: /var/cache/apt/archives
state: absent state: absent
- name: remove temporarily set norestart policy - name: remove temporarily set norestart policy
file: file:
dest: "/usr/sbin/policy-rc.d" dest: "/usr/sbin/policy-rc.d"
@ -72,17 +70,17 @@
- name: secondary node - name: secondary node
command: 'pvc node secondary --wait {{ ansible_hostname }}' command: 'pvc node secondary --wait {{ ansible_hostname }}'
ignore_errors: true ignore_errors: true
- name: wait 15 seconds for system to stabilize - name: wait 15 seconds for system to stabilize
pause: pause:
seconds: 15 seconds: 15
become: no become: no
connection: local connection: local
- name: flush node - name: flush node
command: "pvc node flush {{ ansible_hostname }} --wait" command: "pvc node flush {{ ansible_hostname }} --wait"
ignore_errors: yes ignore_errors: yes
- name: make sure node is in flushed state - name: make sure node is in flushed state
shell: "pvc node info {{ ansible_hostname }} | grep '^Domain State' | awk '{ print $NF }'" shell: "pvc node info {{ ansible_hostname }} | grep '^Domain State' | awk '{ print $NF }'"
register: pvcflush register: pvcflush
@ -204,7 +202,7 @@
seconds: 30 seconds: 30
become: no become: no
connection: local connection: local
- name: reset any systemd failures - name: reset any systemd failures
command: systemctl reset-failed command: systemctl reset-failed
when: freshness.changed when: freshness.changed

View File

@ -43,7 +43,7 @@
- name: restart daemons cleanly - name: restart daemons cleanly
block: block:
- name: secondary node - name: secondary node
command: 'pvc node secondary {{ ansible_hostname }}' command: 'pvc node secondary --wait {{ ansible_hostname }}'
ignore_errors: true ignore_errors: true
- name: wait 15 seconds for system to stabilize - name: wait 15 seconds for system to stabilize