add docker mountpoint on extra subvolume

note: right now the subvol needs to be created prior running this
playbook
This commit is contained in:
2021-10-31 15:14:53 +01:00
parent 6b575f9cf0
commit d8ec78a841
6 changed files with 52 additions and 19 deletions

View File

@@ -1,18 +1,36 @@
---
- name: Merge fstab entries
set_fact:
etc_fstab_entries: '{{ etc_fstab_entries | combine(etc_fstab_entries_overwrite, recursive=True) }}'
when:
- etc_fstab_entries_overwrite | default()
- name: Configure fstab
ansible.posix.mount:
src: "{{ item.value.src }}"
path: "{{ item.value.path }}"
fstype: "{{ item.value.fstype }}"
opts: "{{ item.value.opts }}"
passno: "{{ item.value.passno }}"
dump: "{{ item.value.dump }}"
state: present
become: yes
loop: "{{ lookup('dict', etc_fstab_entries, wantlist=True) }}"
block:
- name: Merge variables
set_fact:
etc_fstab_entries: '{{ etc_fstab_entries | combine(etc_fstab_entries_overwrite, recursive=True) }}'
when:
- etc_fstab_entries_overwrite | default()
#- name: Mount btrfs root
# ansible.posix.mount:
# src: "'/dev/mapper/luks-' + {{ etc_fstab_btrfs_root }}"
# path: "/mnt"
# become: yes
#- name: Create subvolume
# #ansible.builtin.command:
# ansible.builtin.debug:
# #cmd: "btrfs subvolume create {{ item }}"
# msg: "{{ item }}"
# become: yes
# loop: "{{ lookup('dict', etc_fstab_entries, wantlist=True) }}"
# when:
# "item.value.path != '/' and item.value.path != '/home'"
- name: Write fstab entries
ansible.posix.mount:
src: "{{ item.value.src }}"
path: "{{ item.value.path }}"
fstype: "{{ item.value.fstype }}"
opts: "{{ item.value.opts }}"
passno: "{{ item.value.passno }}"
dump: "{{ item.value.dump }}"
state: "{{ item.value.state }}"
become: yes
loop: "{{ lookup('dict', etc_fstab_entries, wantlist=True) }}"