catch up with refactor
This commit is contained in:
@@ -1,28 +1,28 @@
|
||||
- ansible.builtin.include_role:
|
||||
role: ensureparentdir
|
||||
apply:
|
||||
vars:
|
||||
path: "{{ path }}"
|
||||
- ansible.builtin.import_role:
|
||||
role: ensuredir
|
||||
become: true
|
||||
vars:
|
||||
path: "{{ subvpath | dirname }}"
|
||||
|
||||
- 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 }}"
|
||||
ansible.builtin.shell: "btrfs subv list {{ subvpath | mandatory | dirname }} | grep -qF {{ subvpath | basename }}"
|
||||
|
||||
- block:
|
||||
- name: "create btrfs subv {{ path | mandatory }}"
|
||||
- name: "create btrfs subv {{ subvpath | mandatory }}"
|
||||
when: btrfssubvexists.rc != 0
|
||||
become: true
|
||||
ansible.builtin.command:
|
||||
cmd: "btrfs subv create {{ path }}"
|
||||
- name: "set owner:group of subv {{ path }}"
|
||||
cmd: "btrfs subv create {{ subvpath }}"
|
||||
- name: "set owner:group of subv {{ subvpath }}"
|
||||
when: btrfssubvexists.rc != 0
|
||||
become: true
|
||||
ansible.builtin.file:
|
||||
state: touch
|
||||
path: "{{ path | mandatory }}"
|
||||
path: "{{ subvpath | mandatory }}"
|
||||
owner: "{{ owner | mandatory }}"
|
||||
group: "{{ group | default(owner) }}"
|
||||
|
||||
|
||||
@@ -14,5 +14,5 @@
|
||||
role: createbtrfssubv
|
||||
apply:
|
||||
vars:
|
||||
path: "/home/{{ item.name }}/.local/share/containers"
|
||||
owner: "{{ item.name }}"
|
||||
subvpath: "/home/{{ item.name }}/.local/share/containers"
|
||||
owner: "{{ item.name }}"
|
||||
|
||||
Reference in New Issue
Block a user