-
Notifications
You must be signed in to change notification settings - Fork 98
/
exercise153-step9.yaml
39 lines (39 loc) · 1.06 KB
/
exercise153-step9.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
---
- 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: 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