Jérémy Lecour
ee21973371
All checks were successful
Ansible Lint |Total|New|Outstanding|Fixed|Trend
|:-:|:-:|:-:|:-:|:-:
|2777|524|2253|2462|:+1:
Reference build: <a href="https://jenkins.evolix.org/job/gitea/job/ansible-roles/job/unstable/223//ansiblelint">Evolix » ansible-roles » unstable #223</a>
gitea/ansible-roles/pipeline/head This commit looks good
Fully Qualified Collection Name
41 lines
1.4 KiB
YAML
41 lines
1.4 KiB
YAML
---
|
|
|
|
- name: Set images path when customized
|
|
block:
|
|
- name: "Is {{ kvm_custom_libvirt_images_path }} present ?"
|
|
ansible.builtin.stat:
|
|
path: "{{ kvm_custom_libvirt_images_path }}"
|
|
check_mode: no
|
|
register: kvm_custom_libvirt_images_path_test
|
|
|
|
- name: "read the real datadir"
|
|
ansible.builtin.command: readlink -f /var/lib/libvirt/images
|
|
changed_when: False
|
|
check_mode: no
|
|
register: kvm_libvirt_images_current_real_path_test
|
|
when: kvm_custom_libvirt_images_path | length > 0
|
|
|
|
- name: Images directory is moved to custom path
|
|
block:
|
|
- name: "Move libvirt images to {{ kvm_custom_libvirt_images_path }}"
|
|
ansible.builtin.command: mv /var/lib/libvirt/images {{ kvm_custom_libvirt_images_path }}
|
|
args:
|
|
creates: "{{ kvm_custom_libvirt_images_path }}"
|
|
|
|
- name: Fix owner/group/permissions
|
|
ansible.builtin.file:
|
|
path: "{{ kvm_custom_libvirt_images_path }}"
|
|
owner: root
|
|
group: libvirt
|
|
mode: "02775"
|
|
|
|
- name: "Symlink {{ kvm_custom_libvirt_images_path }} to /var/lib/libvirt/images"
|
|
ansible.builtin.file:
|
|
src: "{{ kvm_custom_libvirt_images_path }}"
|
|
dest: '/var/lib/libvirt/images'
|
|
state: link
|
|
when:
|
|
- kvm_custom_libvirt_images_path | length > 0
|
|
- kvm_custom_libvirt_images_path != kvm_libvirt_images_current_real_path_test.stdout
|
|
- not kvm_custom_libvirt_images_path_test.stat.exists
|