Skip to content

Instantly share code, notes, and snippets.

@nshores
Created February 2, 2021 05:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nshores/22b81791161da5069272b91bab41a968 to your computer and use it in GitHub Desktop.
Save nshores/22b81791161da5069272b91bab41a968 to your computer and use it in GitHub Desktop.
ansible-resize-lvm.sh
ansible -i /mnt/c/Users/nshores/Documents/repos/shoreslab/ansible/hosts.nshores swarm_nodes -m shell -a '/bin/bash -c " \
(echo n; echo ""; echo ""; echo ""; echo w) | sudo fdisk /dev/sda && \
sudo pvcreate /dev/sda4 && \
sudo vgextend ubuntu-vg /dev/sda4 && \
sudo lvextend -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv && \
sudo resize2fs /dev/ubuntu-vg/ubuntu-lv"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment