summaryrefslogtreecommitdiff
path: root/roles/storage/disk/volume/tasks/main.yml
blob: 364e4d7f579c98c75d341972740aec75ca2083e4 (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
---
- name: create disk device
  vars:
    disk_device: "{{ disk_volume }}"
  include_role:
    name: storage/disk/device

- name: create filesystem
  filesystem:
    dev: "{{ storage_device_path }}"
    fstype: "{{ disk_volume.fs }}"

- name: mount filesytem
  mount:
    src: "{{ storage_device_path }}"
    path: "{{ disk_volume.dest }}"
    fstype: "{{ disk_volume.fs }}"
    opts: "{{ disk_volume.mntopts | default(omit) }}"
    state: mounted

- name: set volume owner/group and mode
  file:
    state: directory
    path: "{{ disk_volume.dest }}"
    mode: "{{ disk_volume.mode | default(omit) }}"
    owner: "{{ disk_volume.owner | default(omit) }}"
    group: "{{ disk_volume.group | default(omit) }}"

- name: export volume mountpoint
  set_fact:
    storage_volume_mountpoint: "{{ disk_volume.dest }}"