hello, i overengineer everything

This commit is contained in:
2026-09-15 15:06:19 +05:30
parent abe2daebb9
commit 8bde23573c
+28
View File
@@ -0,0 +1,28 @@
- ansible.builtin.include_role:
role: ensureparentdir
apply:
vars:
path: "{{ path }}"
- name: check if btrfs subv exists
register: btrfssubvexists
become: true
failed_when: false
changed_when: false
ansible.builtin.shell: "btrfs subv list {{ path | mandatory | dirname }} | grep -qF {{ path | basename }}"
- block:
- name: "create btrfs subv {{ path | mandatory }}"
when: btrfssubvexists.rc != 0
become: true
ansible.builtin.command:
cmd: "btrfs subv create {{ path }}"
- name: "set owner:group of subv {{ path }}"
when: btrfssubvexists.rc != 0
become: true
ansible.builtin.file:
state: touch
path: "{{ path | mandatory }}"
owner: "{{ owner | mandatory }}"
group: "{{ group | default(owner) }}"