--- - name: create zfs datasets when: bluespice_zfs is defined block: - name: create zfs base dataset zfs: name: "{{ bluespice_zfs.pool }}/{{ bluespice_zfs.name }}" state: present extra_zfs_properties: "{{ bluespice_zfs.properties | dehumanize_zfs_properties | default(omit) }}" - name: create zfs volumes for instances loop: "{{ bluespice_instances | dict2items }}" loop_control: label: "{{ item.key }} ({{ (item.value.zfs_properties | default({})).items() | map('join', '=') | join(', ') }})" zfs: name: "{{ bluespice_zfs.pool }}/{{ bluespice_zfs.name }}/{{ item.key }}" state: present extra_zfs_properties: "{{ item.value.zfs_properties | dehumanize_zfs_properties | default(omit) }}" - name: configure bluespice base bath set_fact: bluespice_base_path: "{{ (zfs_pools[bluespice_zfs.pool].mountpoint, bluespice_zfs.name) | path_join }}" - name: create instance subdirectories loop: "{{ bluespice_instances | list }}" file: path: "{{ bluespice_base_path }}/{{ item }}/data" state: directory - name: install pod manifest loop: "{{ bluespice_instances | dict2items }}" loop_control: label: "{{ item.key }}" vars: kubernetes_standalone_pod: name: "bluespice-{{ item.key }}" spec: "{{ lookup('template', 'pod-spec.yml.j2') }}" mode: "0600" include_role: name: kubernetes/standalone/pod - name: configure nginx vhost loop: "{{ bluespice_instances | dict2items }}" loop_control: label: "{{ item.key }}" vars: nginx_vhost: name: "bluespice-{{ item.key }}" template: generic tls: certificate_provider: "{{ acme_client }}" hostnames: - "{{ item.value.hostname }}" locations: '/': proxy_pass: "http://127.0.0.1:{{ item.value.port }}" extra_directives: |- client_max_body_size 0; include_role: name: nginx/vhost