Compare commits
2 Commits
97b1469a70
...
82d2f13981
Author | SHA1 | Date | |
---|---|---|---|
82d2f13981 | |||
73ad2a7751 |
@ -125,3 +125,29 @@
|
|||||||
- name: unset PVC maintenance mode
|
- name: unset PVC maintenance mode
|
||||||
command: pvc cluster maintenance off
|
command: pvc cluster maintenance off
|
||||||
run_once: yes
|
run_once: yes
|
||||||
|
|
||||||
|
# Clean up legacy configs if safe to do so
|
||||||
|
- hosts: all
|
||||||
|
remote_user: deploy
|
||||||
|
become: yes
|
||||||
|
become_user: root
|
||||||
|
gather_facts: yes
|
||||||
|
tasks:
|
||||||
|
- name: check if new configuration exists
|
||||||
|
stat:
|
||||||
|
path: /etc/pvc/pvc.conf
|
||||||
|
register: pvc_config_check
|
||||||
|
|
||||||
|
- name: check if installed PVC version is above 0.9.82
|
||||||
|
shell: "dpkg --compare-versions $(dpkg-query --showformat='${Version}' --show pvc-daemon-node) gt 0.9.82"
|
||||||
|
register: pvc_version_check
|
||||||
|
|
||||||
|
- name: remove obsolete PVC daemon configurations
|
||||||
|
file:
|
||||||
|
dest: "/etc/pvc/{{ item }}"
|
||||||
|
state: absent
|
||||||
|
with_items:
|
||||||
|
- pvcnoded.yaml
|
||||||
|
- pvcapid.yaml
|
||||||
|
- autobackup.yaml
|
||||||
|
when: pvc_config_file_check.stat.exists and pvc_version_check.rc == 0
|
||||||
|
@ -36,22 +36,6 @@
|
|||||||
group: sudo
|
group: sudo
|
||||||
with_items:
|
with_items:
|
||||||
- pvc.conf
|
- pvc.conf
|
||||||
register: new_daemon_config
|
|
||||||
|
|
||||||
- name: remove obsolete pvc daemon configurations
|
|
||||||
file:
|
|
||||||
dest: "/etc/pvc/{{ item }}"
|
|
||||||
state: absent
|
|
||||||
with_items:
|
|
||||||
- pvcnoded.yaml
|
|
||||||
- pvcapid.yaml
|
|
||||||
- autobackup.yaml
|
|
||||||
# Only apply this task when the new daemon config has NOT changed.
|
|
||||||
# In practice, this means that the first time pvc.conf is written,
|
|
||||||
# the old configs will NOT be purged. Then, the next time this is
|
|
||||||
# run (presuming no fundamental changes happen to that config),
|
|
||||||
# they will be removed. Provides safety in case of a failed update.
|
|
||||||
when: not new_daemon_config.changed
|
|
||||||
|
|
||||||
- name: install API SSL certificate file
|
- name: install API SSL certificate file
|
||||||
copy:
|
copy:
|
||||||
|
Reference in New Issue
Block a user