33 lines
1.2 KiB
YAML
33 lines
1.2 KiB
YAML
- name: "user : {{ services_service_name }} : set variables"
|
|
ansible.builtin.import_role:
|
|
name: "include"
|
|
tasks_from: "vars"
|
|
|
|
- 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:
|
|
name: "rpool/var/lib/{{ ansible_hostname }}/data/{{ services_service_user_name }}/{{ item.name }}"
|
|
state: "present"
|
|
extra_zfs_properties: "{{ item.properties | default({}) }}"
|
|
loop: "{{ services[services_service_name].volumes }}"
|