ansible-roles/kvm-host/tasks/tools.yml
Jérémy Lecour 7a0e0d81d6
All checks were successful
gitea/ansible-roles/pipeline/head This commit looks good
Proper jinja spacing
2022-12-28 09:03:37 +01:00

67 lines
1.3 KiB
YAML

---
- name: remove old package
apt:
name: kvm-tools
purge: yes
state: absent
- include_role:
name: remount-usr
when: kvm_scripts_dir is search("/usr")
- name: add-vm script is present
copy:
src: add-vm.sh
dest: "{{ kvm_scripts_dir }}/add-vm"
mode: "0700"
owner: root
group: root
force: yes
- name: migrate-vm script is present
copy:
src: migrate-vm.sh
dest: "{{ kvm_scripts_dir }}/migrate-vm"
mode: "0700"
owner: root
group: root
force: yes
- name: kvmstats script is present
copy:
src: kvmstats.sh
dest: "{{ kvm_scripts_dir }}/kvmstats"
mode: "0700"
owner: root
group: root
force: yes
- name: kvmstats cron is present
template:
src: kvmstats.cron.j2
dest: "/etc/cron.hourly/kvmstats"
mode: "0755"
owner: root
group: root
- name: entry for kvmstats in web page is present
lineinfile:
dest: /var/www/index.html
insertbefore: '</ul>'
line: '<li><a href="/kvmstats.html">kvmstats</a></li>'
# backward compatibility
- name: remove old migrate-vm script
file:
path: /usr/share/scripts/migrate-vm
state: absent
when: "'/usr/share/scripts' not in kvm_scripts_dir"
- name: remove old kvmstats script
file:
path: /usr/share/scripts/kvmstats
state: absent
when: "'/usr/share/scripts' not in kvm_scripts_dir"