blob: 6a1b2cf5930ace89f43f00ad9daf3d2359b23529 (
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
25
26
27
28
29
30
31
32
33
34
35
|
# Instance configuration for Baserock MySQL on for StoryBoard host
#
# This script expects a volume to be available at /dev/vdb.
---
- hosts: storyboard
gather_facts: False
sudo: yes
vars:
- lv_size: 25g
- mountpoint: /var/lib/mysql
- lv_name: database-storyboard
tasks:
- name: install lvm2 tools
apt: name=lvm2 state=latest
- name: LVM logical volume group on /dev/vdb
lvg: vg=vg0 pvs=/dev/vdb
# Duplicated from:
#- include: ../tasks/create-data-volume.yml lv_name=database-storyboard lv_size=25g mountpoint=/var/lib/mysql
# given that is not ubuntu compatible
- name: logical volume for {{ lv_name }}
lvol: vg=vg0 lv={{ lv_name }} size={{ lv_size }}
# This will NEVER overwrite an existing filesystem. Unless you add
# 'force=yes' to the arguments. So don't do that. See:
# http://docs.ansible.com/filesystem_module.html.
#
- name: ext4 filesystem on /dev/vg0/{{ lv_name }}
filesystem: fstype=ext4 dev=/dev/vg0/{{ lv_name }}
- name: mount {{ lv_name }} logical volume
mount: src=/dev/vg0/{{ lv_name }} name={{ mountpoint }} fstype=ext4 state=mounted
# End of duplication
|