]> arthur.barton.de Git - AnsibleRoles.git/blob - roles/lvm-lv/tasks/main.yml
37ec17123149f38c76aa750a4f48bbf4b3db6c4b
[AnsibleRoles.git] / roles / lvm-lv / tasks / main.yml
1 ---
2 # lvm-lv tasks
3
4 # Setup a new LVM volume, create a new ext4 file system, and add it to
5 # /etc/fstab and mount it.
6
7 - name: setup LVM volume "{{ lvm_lv_name }}" for MySQL
8   tags:
9     - partition
10     - lvm
11     - fs
12   lvol: >
13     lv={{ lvm_lv_name }}
14     size={{ lvm_lv_size }}
15     vg={{ lvm_vg }}
16
17 - name: create/resize ext4 filesystem on MySQL partition "{{ lvm_lv_name }}"
18   tags:
19     - fs
20   filesystem: >
21     dev=/dev/{{ lvm_vg }}/{{ lvm_lv_name }}
22     fstype=ext4
23     opts="-L {{ lvm_lv_name }}"
24     resizefs=yes
25
26 - name: create mount point "{{ lvm_lv_mountpoint }}"
27   tags:
28     - fs
29   file: >
30     path={{ lvm_lv_mountpoint }}
31     state=directory
32
33 - name: configure and mount MySQL partition "{{ lvm_lv_name }}"
34   tags:
35     - fs
36     - mount
37   mount: >
38     fstype=ext4
39     name={{ lvm_lv_mountpoint }}
40     src=/dev/{{ lvm_vg }}/{{ lvm_lv_name }}
41     state=mounted
42     opts=rw,errors=remount-ro,noatime
43     passno=2