This ansible role configure lvm, create, remove, extend and mount lv.
Platform | Versions |
---|---|
Debian | all |
EL | all |
Fedora | all |
Ubuntu | all |
Ansible >= 2.13
None.
ansible-galaxy install dginhoux.lvm
git clone https://github.com/dginhoux/ansible_role.lvm dginhoux.lvm
- hosts: all
roles:
- name: start role dginhoux.lvm
ansible.builtin.include_role:
name: dginhoux.lvm
Defaults variables defined in defaults/main.yml
:
---
lvm_configure: "yes"
lvm_pvresize_to_max: "true"
lvm_vg_list:
- vg_name: vg_ansible
pv_list:
- /dev/sdc
state: present
lv_list:
- lv_name: lv_ansible
size: 15G
filesystem: ext4
# mount: "true"
# mount_point: /mnt/lv_ansible
state: present
- vg_name: vg_swarm
pv_list:
- /dev/sdd
state: present
lv_list:
- lv_name: lv_swarm_registry
size: 35G
filesystem: ext4
# mount: "true"
# mount_point: /mnt/lv_swarm_registry
state: present
- lv_name: lv_swarm_prod3
size: 120G
filesystem: xfs
# mount: "true"
# mount_point: /mnt/lv_swarm_prod3
state: present
Those variables files are located in vars/*.yml
are used to handle OS differences.
One of theses is loaded dynamically during role runtime using the include_vars
module and set OS specifics variable's.
NOT USED BY THIS ROLE
Dany GINHOUX - https://github.com/dginhoux
MIT