Make canmount configurable for bhyve and jails.

This commit is contained in:
Tom Alexander 2022-11-12 17:04:25 -05:00
parent a2a7da0d9b
commit 0a49fc16b6
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
4 changed files with 31 additions and 27 deletions

View File

@ -19,6 +19,8 @@ build_user:
group: talexander
jail_zfs_dataset: zmass/encrypted/jails
jail_zfs_dataset_mountpoint: /jail/main
jail_canmount: "on"
jail_bemount: "on"
jail_list:
- name: cloak
conf:
@ -34,3 +36,5 @@ jail_list:
mount: /var/db/murmur
bhyve_dataset: zmass/encrypted/vm
bhyve_list: []
bhyve_canmount: "on"
bhyve_bemount: "on"

View File

@ -2,29 +2,29 @@
vars:
ansible_become: True
roles:
- sudo
# - sudo
- users
- package_manager
- zrepl
- zsh
- network
- sshd
- base
- firewall
- cpu
- ntp
- build
- graphics
- gpg
- fonts
- alacritty
- sway
- emacs
- firefox
- devfs
- ssh_client
# - package_manager
# - zrepl
# - zsh
# - network
# - sshd
# - base
# - firewall
# - cpu
# - ntp
# - build
# - graphics
# - gpg
# - fonts
# - alacritty
# - sway
# - emacs
# - firefox
# - devfs
# - ssh_client
- jail
- fuse
- autofs
- exfat
# - fuse
# - autofs
# - exfat
- bhyve

View File

@ -19,8 +19,8 @@
state: present
extra_zfs_properties:
mountpoint: "{{ bhyve_mountpoint }}"
canmount: "noauto"
"ta:bemount": "on"
canmount: "{{ bhyve_canmount|default('noauto') }}"
"ta:bemount": "{{ bhyve_bemount|default('on') }}"
- name: Enable bhyve
community.general.sysrc:

View File

@ -10,7 +10,7 @@
zfs:
name: "{{ item.dataset|default(jail_zfs_dataset) }}/jails/{{ item.name }}"
state: present
extra_zfs_properties: '{{ {''mountpoint'': item.dataset_mountpoint|default(jail_zfs_dataset_mountpoint) + "/jails/" + item.name}|combine(item.properties|default({}))|combine({''canmount'': ''noauto'', ''ta:bemount'': ''on''}) }}'
extra_zfs_properties: '{{ {''mountpoint'': item.dataset_mountpoint|default(jail_zfs_dataset_mountpoint) + "/jails/" + item.name}|combine({''canmount'': jail_canmount|default(''noauto''), ''ta:bemount'': jail_bemount|default(''on'')})|combine(item.properties|default({})) }}'
loop: "{{ jail_list }}"
@ -27,7 +27,7 @@
zfs:
name: "{{ item.0.dataset|default(jail_zfs_dataset) }}/persistent/{{ item.0.name }}/{{ item.1.name }}"
state: present
extra_zfs_properties: '{{ {''mountpoint'': item.0.dataset_mountpoint|default(jail_zfs_dataset_mountpoint) + "/jails/" + item.0.name + item.1.mount }|combine(item.1.properties|default({}))|combine({''canmount'': ''noauto'', ''ta:bemount'': ''on''}) }}'
extra_zfs_properties: '{{ {''mountpoint'': item.0.dataset_mountpoint|default(jail_zfs_dataset_mountpoint) + "/jails/" + item.0.name + item.1.mount }|combine({''canmount'': jail_canmount|default(''noauto''), ''ta:bemount'': jail_bemount|default(''on'')})|combine(item.1.properties|default({})) }}'
loop: "{{ jail_list|subelements('persist', skip_missing=True) }}"
- name: Install scripts