From eb545b5d691efed2d1e58cea533126d406c2b948 Mon Sep 17 00:00:00 2001 From: Wojciech Kozlowski Date: Sun, 19 Mar 2023 19:17:18 +0100 Subject: [PATCH] Fix issue with refreservation in testing --- .../roles/system/datasets/meta/argument_specs.yml | 4 ++++ playbooks/roles/system/datasets/tasks/include/var.yml | 4 +--- playbooks/system.yml | 10 ++++++++++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/playbooks/roles/system/datasets/meta/argument_specs.yml b/playbooks/roles/system/datasets/meta/argument_specs.yml index 7bd0516..3f24b10 100644 --- a/playbooks/roles/system/datasets/meta/argument_specs.yml +++ b/playbooks/roles/system/datasets/meta/argument_specs.yml @@ -29,3 +29,7 @@ argument_specs: system_backups_snapshots_data_dataset: type: "str" required: true + system_datasets_var_containers_zvol_properties: + type: "dict" + elem: "str" + required: true diff --git a/playbooks/roles/system/datasets/tasks/include/var.yml b/playbooks/roles/system/datasets/tasks/include/var.yml index 7b10411..e7384c4 100644 --- a/playbooks/roles/system/datasets/tasks/include/var.yml +++ b/playbooks/roles/system/datasets/tasks/include/var.yml @@ -15,9 +15,7 @@ community.general.zfs: name: "{{ system_var_containers_dataset }}" state: "present" - extra_zfs_properties: - volsize: "21474836480" # 20G - "com.sun:auto-snapshot": "false" + extra_zfs_properties: "{{ system_datasets_var_containers_zvol_properties }}" - name: "var : format containers zvol" community.general.filesystem: diff --git a/playbooks/system.yml b/playbooks/system.yml index 5ae8f86..7bbfb12 100644 --- a/playbooks/system.yml +++ b/playbooks/system.yml @@ -106,6 +106,16 @@ roles: - role: "system/datasets" tags: "system:datasets" + vars: + _zvol_volsize: "21474836480" # 20G + system_datasets_var_containers_zvol_properties: "\ + {% set _zvol_properties = {} %}\ + {{ _zvol_properties.update({ 'volsize': _zvol_volsize }) }}\ + {{ _zvol_properties.update({ 'com.sun:auto-snapshot': 'false' }) }}\ + {% if not (the_nine_worlds_production | bool) %}\ + {{ _zvol_properties.update({ 'refreservation': '0' }) }}\ + {% endif %}\ + {{ _zvol_properties }}" - name: "system : asgard" hosts: "asgard"