refs #7593 Add task to clean old vn-host package

This commit is contained in:
Juan Ferrer 2025-02-06 07:56:39 +01:00
parent bf76e83b5e
commit e9a9cf7be0
3 changed files with 18 additions and 2 deletions

View File

@ -34,3 +34,19 @@
vars:
start_delimiter: '### 4Loo'
end_delimiter: 'esac'
- name: Delete old vn-host package
tags: vn-host
block:
- name: Get vn-host package version
shell: "dpkg-query -W -f='${Version}' vn-host 2>/dev/null || echo '0'"
register: vn_host_version
changed_when: false
- name: Display vn-host version
debug:
msg: "Version: {{ vn_host_version.stdout }}"
- name: Uninstall vn-host if old version
apt:
name: vn-host
state: absent
when: >
vn_host_version.stdout is version('3.0.0', '<')

View File

@ -45,8 +45,8 @@
tags: fail2ban
- import_tasks: bacula.yml
tags: bacula
- import_tasks: vn-repo.yml
tags: vn-repo
- import_tasks: vn-host.yml
tags: vn-host
- name: Configure guest
when: ansible_virtualization_role == 'guest'