2022-12-10 17:52:15 +01:00
|
|
|
- name: "user : {{ services_service_name }} : set variables"
|
|
|
|
ansible.builtin.import_role:
|
2022-12-10 21:39:04 +01:00
|
|
|
name: "include"
|
|
|
|
tasks_from: "vars"
|
2022-12-10 17:52:15 +01:00
|
|
|
|
|
|
|
- name: "user : {{ services_service_name }} : create home dataset"
|
|
|
|
community.general.zfs:
|
|
|
|
name: "rpool/var/lib/{{ ansible_hostname }}/home/{{ services_service_user_name }}"
|
|
|
|
state: "present"
|
|
|
|
register: services_datasets_user_zfs_home
|
|
|
|
|
|
|
|
- name: "user : {{ services_service_name }} : populate home dataset with skeleton"
|
|
|
|
ansible.builtin.copy:
|
|
|
|
src: "/etc/skel/"
|
|
|
|
dest: "{{ services_service_user_home }}"
|
|
|
|
remote_src: true
|
|
|
|
when:
|
|
|
|
services_datasets_user_zfs_home.changed
|
|
|
|
|
|
|
|
- name: "user : {{ services_service_name }} : create data dataset"
|
|
|
|
community.general.zfs:
|
|
|
|
name: "rpool/var/lib/{{ ansible_hostname }}/data/{{ services_service_user_name }}"
|
|
|
|
state: "present"
|
|
|
|
extra_zfs_properties:
|
|
|
|
canmount: "off"
|
|
|
|
|
|
|
|
- name: "user : {{ services_service_name }} : create volume datasets"
|
|
|
|
community.general.zfs:
|
2022-12-11 00:41:50 +01:00
|
|
|
name: "rpool/var/lib/{{ ansible_hostname }}/data/{{ services_service_user_name }}/{{ item.name }}"
|
2022-12-10 17:52:15 +01:00
|
|
|
state: "present"
|
|
|
|
extra_zfs_properties: "{{ item.properties | default({}) }}"
|
|
|
|
loop: "{{ services[services_service_name].volumes }}"
|