summaryrefslogtreecommitdiff
path: root/roles/elevate/media/tasks/nextcloud-lvm.yml
blob: d24326d37e389458ecc6a77227f3db921ab28a0a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
---
- name: prepare nextcloud system disk as LVM
  when: nextcloud_lvm.system is defined
  block:
  - name: create logical volume
    lvol:
      vg: "{{ nextcloud_lvm.system.vg }}"
      lv: "{{ nextcloud_lvm.system.lv }}"
      size: "{{ nextcloud_lvm.system.size }}"

  - name: create filesystem
    filesystem:
      fstype: "{{ nextcloud_lvm.system.fs }}"
      dev: "/dev/mapper/{{ nextcloud_lvm.system.vg | replace('-', '--') }}-{{ nextcloud_lvm.system.lv | replace('-', '--') }}"

  - name: mount filesytem
    mount:
      src: "/dev/mapper/{{ nextcloud_lvm.system.vg | replace('-', '--') }}-{{ nextcloud_lvm.system.lv | replace('-', '--') }}"
      path: /srv/nextcloud
      fstype: "{{ nextcloud_lvm.system.fs }}"
      state: mounted

- name: prepare nextcloud data disk as LVM
  when: nextcloud_lvm.data is defined
  block:
  - name: create logical volume
    lvol:
      vg: "{{ nextcloud_lvm.data.vg }}"
      lv: "{{ nextcloud_lvm.data.lv }}"
      size: "{{ nextcloud_lvm.data.size }}"

  - name: create filesystem
    filesystem:
      fstype: "{{ nextcloud_lvm.data.fs }}"
      dev: "/dev/mapper/{{ nextcloud_lvm.data.vg | replace('-', '--') }}-{{ nextcloud_lvm.data.lv | replace('-', '--') }}"

  - name: mount filesytem
    mount:
      src: "/dev/mapper/{{ nextcloud_lvm.data.vg | replace('-', '--') }}-{{ nextcloud_lvm.data.lv | replace('-', '--') }}"
      path: /srv/ncdata
      fstype: "{{ nextcloud_lvm.data.fs }}"
      state: mounted