Mathieu Trossevin
c2de4b4cd1
All checks were successful
Ansible Lint |Total|New|Outstanding|Fixed|Trend
|:-:|:-:|:-:|:-:|:-:
|2671|8|2663|5|:-1:
Reference build: <a href="https://jenkins.evolix.org/job/gitea/job/ansible-roles/job/unstable/439//ansiblelint">Evolix » ansible-roles » unstable #439</a>
gitea/ansible-roles/pipeline/head This commit looks good
38 lines
1.1 KiB
YAML
38 lines
1.1 KiB
YAML
---
|
|
|
|
- name: 'Figure out if /etc/lvm/lvm.conf exists'
|
|
ansible.builtin.stat:
|
|
path: '/etc/lvm/lvm.conf'
|
|
follow: true
|
|
get_checksum: false
|
|
get_mime: false
|
|
get_attributes: false
|
|
ignore_errors: true
|
|
register: lvm_conf_stat
|
|
|
|
- name: Add LVM filter
|
|
ansible.builtin.lineinfile:
|
|
path: '/etc/lvm/lvm.conf'
|
|
insertafter: '# Configuration option devices/filter.'
|
|
regexp: '^\s*(#\s*)?filter\s*=\s*\[.*\]'
|
|
line: " filter = [ {{ lvm_filter | list | join(', ') }}, \"r|.*/|\" ]"
|
|
state: present
|
|
firstmatch: true
|
|
notify: 'Update initramfs'
|
|
when:
|
|
- lvm_conf_stat is succeeded
|
|
- lvm_conf_stat.stat.exists | bool
|
|
|
|
- name: Add LVM global_filter
|
|
ansible.builtin.lineinfile:
|
|
path: '/etc/lvm/lvm.conf'
|
|
insertafter: '# Configuration option devices/global_filter.'
|
|
regexp: '^\s*(#\s*)?global_filter\s*=\s*\[.*\]'
|
|
line: " global_filter = [ {{ lvm_filter | list | join(', ') }}, \"r|.*/|\" ]"
|
|
state: present
|
|
firstmatch: true
|
|
notify: 'Update initramfs'
|
|
when:
|
|
- lvm_conf_stat is succeeded
|
|
- lvm_conf_stat.stat.exists | bool
|