Verified Commit 6570c919 authored by Evangelos Foutras's avatar Evangelos Foutras 🐱
Browse files

common: group mounts by uuid and scrub only the first

sort + groupby fanciness by @klausenbusk.
parent cb339991
Pipeline #11701 passed with stage
in 35 seconds
......@@ -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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment