summaryrefslogtreecommitdiffstats
path: root/roles/openshift_storage_nfs_lvm/tasks/main.yml
blob: ead81b876d9d534113fa86cd9a938f4caaaeb5fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
---
- name: Create lvm volumes
  lvol: vg={{osnl_volume_group}} lv={{ item }} size={{osnl_volume_size}}G
  with_sequence: start={{osnl_volume_num_start}} count={{osnl_number_of_volumes}} format={{osnl_volume_prefix}}{{osnl_volume_size}}g%04d

- name: create filesystem
  filesystem: fstype=xfs dev=/dev/{{osnl_volume_group}}/{{ item }}
  with_sequence: start={{osnl_volume_num_start}} count={{osnl_number_of_volumes}} format={{osnl_volume_prefix}}{{osnl_volume_size}}g%04d

- name: mount volumes
  mount: name={{osnl_mount_dir}}/{{ item }} src=/dev/{{osnl_volume_group}}/{{ item }} state=mounted fstype=xfs passno=0
  with_sequence: start={{osnl_volume_num_start}} count={{osnl_number_of_volumes}} format={{osnl_volume_prefix}}{{osnl_volume_size}}g%04d

- name: Make mounts owned by nfsnobody
  file: path={{osnl_mount_dir}}/{{ item }} owner=nfsnobody group=nfsnobody mode=0700
  with_sequence: start={{osnl_volume_num_start}} count={{osnl_number_of_volumes}} format={{osnl_volume_prefix}}{{osnl_volume_size}}g%04d

- include: nfs.yml

- name: Create volume json file
  template: src=../templates/nfs.json.j2 dest=/root/persistent-volume.{{ item }}.json
  with_sequence: start={{osnl_volume_num_start}} count={{osnl_number_of_volumes}} format={{osnl_volume_prefix}}{{osnl_volume_size}}g%04d

# TODO - Get the json files to a master, and load them.