ansible-lint --fix
This commit is contained in:
parent
5634cd32d3
commit
faa046aa21
21 changed files with 181 additions and 179 deletions
|
@ -1,45 +1,45 @@
|
|||
---
|
||||
- name: Check for existing zroot zfs volume
|
||||
command: zpool list -Ho name zroot
|
||||
ansible.builtin.command: zpool list -Ho name zroot
|
||||
register: zroot_check
|
||||
ignore_errors: true
|
||||
|
||||
- block:
|
||||
- name: Initialize disk device to id table
|
||||
set_fact:
|
||||
partition_device_to_ids: {}
|
||||
- when: zroot_check.rc != 0
|
||||
|
||||
- name: Create disk device to id table
|
||||
set_fact:
|
||||
partition_device_to_ids: >-
|
||||
{{
|
||||
partition_device_to_ids
|
||||
| combine({ item.value: (partition_device_to_ids[item.value] | default([])) + [item.key] })
|
||||
}}
|
||||
with_items: "{{ base_partitions_by_id | dict2items }}"
|
||||
block:
|
||||
- name: Initialize disk device to id table
|
||||
ansible.builtin.set_fact:
|
||||
partition_device_to_ids: {}
|
||||
|
||||
- debug:
|
||||
var: base_root_partitions | map('extract', partition_device_to_ids) | map('first')
|
||||
- name: Create disk device to id table
|
||||
ansible.builtin.set_fact:
|
||||
partition_device_to_ids: >-
|
||||
{{
|
||||
partition_device_to_ids
|
||||
| combine({ item.value: (partition_device_to_ids[item.value] | default([])) + [item.key] })
|
||||
}}
|
||||
with_items: "{{ base_partitions_by_id | dict2items }}"
|
||||
|
||||
- name: Create zroot volume
|
||||
become: true
|
||||
command: >-
|
||||
zpool create -f -o ashift=12
|
||||
-o autotrim=on
|
||||
-O devices=off
|
||||
-O relatime=on
|
||||
-O xattr=sa
|
||||
-O acltype=posixacl
|
||||
-O normalization=formD
|
||||
-O compression=lz4
|
||||
-O canmount=off
|
||||
-O mountpoint=none
|
||||
-R /mnt
|
||||
zroot {{ mirror }} {{ base_root_partitions | map('extract', partition_device_to_ids) | map('first') | list | join(' ') }}
|
||||
vars:
|
||||
mirror: "{{ 'mirror' if base_root_partitions | length > 1 else '' }}"
|
||||
when: zroot_check.rc != 0
|
||||
- ansible.builtin.debug:
|
||||
var: base_root_partitions | map('extract', partition_device_to_ids) | map('first')
|
||||
|
||||
- name: Create zroot volume
|
||||
become: true
|
||||
ansible.builtin.command: >-
|
||||
zpool create -f -o ashift=12
|
||||
-o autotrim=on
|
||||
-O devices=off
|
||||
-O relatime=on
|
||||
-O xattr=sa
|
||||
-O acltype=posixacl
|
||||
-O normalization=formD
|
||||
-O compression=lz4
|
||||
-O canmount=off
|
||||
-O mountpoint=none
|
||||
-R /mnt
|
||||
zroot {{ mirror }} {{ base_root_partitions | map('extract', partition_device_to_ids) | map('first') | list | join(' ') }}
|
||||
vars:
|
||||
mirror: "{{ 'mirror' if base_root_partitions | length > 1 else '' }}"
|
||||
- name: Create zroot/ROOT and zroot/DATA volumes
|
||||
community.general.zfs:
|
||||
name: "zroot/{{ item }}"
|
||||
|
@ -64,7 +64,6 @@
|
|||
mountpoint: /home
|
||||
|
||||
- name: Export zroot pool
|
||||
command: zpool export zroot
|
||||
|
||||
ansible.builtin.command: zpool export zroot
|
||||
- name: Import zroot pool (-R /mnt)
|
||||
command: zpool import -R /mnt zroot -N
|
||||
ansible.builtin.command: zpool import -R /mnt zroot -N
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue