Skip to content
Snippets Groups Projects
Verified Commit 6570c919 authored by Evangelos Foutras's avatar Evangelos Foutras :smiley_cat:
Browse files

common: group mounts by uuid and scrub only the first

sort + groupby fanciness by @klausenbusk.
parent cb339991
No related branches found
No related tags found
No related merge requests found
Pipeline #11701 passed
......@@ -37,8 +37,10 @@
- name: start and enable btrfs scrub timer
service: name=btrfs-scrub@{{ '-' if (item.mount | length == 1) else (item.mount.split("/", 1)[1] | replace("/", "-")) }}.timer enabled=yes state=started
loop: "{{ ansible_mounts }}"
when: "item.fstype == 'btrfs' and item.mount != '/var/lib/docker/btrfs' and 'backup' not in item.mount"
loop: "{{ ansible_mounts | sort(attribute='mount') | groupby('uuid') | map(attribute=1) | map('first') }}"
when:
- item.fstype == 'btrfs'
- not 'backup' in item.mount
- name: install mlocate
pacman: name=mlocate state=present
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment