Compare commits

..

2 Commits

Author SHA1 Message Date
82d2f13981 Add legacy config cleanup to playbook 2023-12-01 02:17:42 -05:00
73ad2a7751 Avoid removal of old versions at all
We simply shouldn't do this here. Let's leave them hanging around unless
removed in another way (e.g. in update-pvc-daemons)
2023-12-01 02:08:22 -05:00
2 changed files with 26 additions and 16 deletions

View File

@ -125,3 +125,29 @@
- name: unset PVC maintenance mode
command: pvc cluster maintenance off
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

View File

@ -36,22 +36,6 @@
group: sudo
with_items:
- 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
copy: