forked from sandervanvugt/rhce8-book
-
Notifications
You must be signed in to change notification settings - Fork 2
/
exercise153-step11.yaml
41 lines (41 loc) · 1.13 KB
/
exercise153-step11.yaml
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
---
- name: set up hosts that have an sdb device
hosts: all
tasks:
- name: getting out with a nice failure message if there is no second disk
fail:
msg: there is no second disk
when: ansible_facts['devices']['sdb'] is not defined
- name: create a partition
parted:
device: /dev/sdb
number: 1
state: present
- name: create a volume group
lvg:
pvs: /dev/sdb1
vg: vgfiles
- name: run the setup module so that we can use updated facts
setup:
- name: get vg size and convert to integer in new variable
set_fact:
vgsize: "{{ ansible_facts['lvm']['vgs']['vgfiles']['size_g'] | int }}"
- name: show vgsize value
debug:
var: "{{ vgsize }}"
- name: create an LVM on big volume groups
# lvol:
debug:
msg: creating an LVM on big volume groups
- name: create an LVM on small volume groups
# lvol:
debug:
msg: creating an LVM on small volume groups
- name: formatting the XFS filesystem
# filesystem:
debug:
msg: creating the filesystem
- name: mounting /dev/vgfile/lvfiles
# mount:
debug:
msg: mounting the volume