Start an ansible config for maintaining

Datacenter staff installed Debain 10.4 and left us with
ssh access to the root account, and a minimal lvm filesystem

To help document and maintain the configuration, declare
the basic storage volumes.

Assuming ssh access to, the config
can be applied with:

  ansible-playbook -i hosts mf4.yaml

In theory it should verify the config, but avoid doing anything
destructive if it finds the system in a state that doesn't match
what's described.

This hasn't actually been tested on a bare system; resizing
the root and swap might need manual intervention.
# Ansible playbook for
- name: Configure storage
# Run the remaining steps on the target instance.
remote_user: root
- name: lvm volume group on RAID
# Debian installer defaults to `lvm` for the volume group name.
vg: lvm
pvs: /dev/sda3
- name: lvm root volume
vg: lvm
lv: root
size: 64G
- name: lvm swap volume
vg: lvm
lv: swap
size: 12G
- name: mkswap
fstype: swap
dev: /dev/mapper/lvm-swap
- name: lvm home volume
vg: lvm
lv: home
size: 1T
- name: home filesystem
fstype: ext4
dev: /dev/mapper/lvm-home
opts: -L mf4-home
- name: home volume mountpoint
state: mounted
src: /dev/mapper/lvm-home
path: /home
fstype: ext4
opts: defaults,errors=remount-ro
passno: 2
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment