A comprehensive Linux Volume Management (LVM) tool that provides both interactive command-line interface and automated deployment capabilities through Ansible.
- Interactive CLI for LVM operations
- Automated deployment using Ansible
- Support for all major LVM operations:
- Disk management
- Volume Group (VG) operations
- Logical Volume (LV) operations
- Partition and mount point management
- Volume resizing (extend/reduce)
- Safe deletion of VGs and LVs
- Python 3.x
- Ansible (for automated deployment)
- Linux system with LVM support
- Root/sudo privileges for LVM operations
- Clone the repository:
git clone https://github.com/adarsh-k27r/LVM-Automation-with-Ansible.git
cd LVM
- Install required Python packages:
pip install pyfiglet termcolor
- Make the script executable:
chmod +x lvm.py
- Clone the repository:
git clone https://github.com/adarsh-k27r/LVM-Automation-with-Ansible.git
cd LVM
- Run the Ansible playbook:
ansible-playbook -i inventory.ini ansible_playbooks/lvm_deploy.yml
Run the script:
./lvm.py
The interactive menu provides the following options:
- View all available disks
- View all existing volume groups
- View a specific volume group
- View all logical volumes
- View partitions and mount points
- Create a new volume group
- Create a new logical volume
- Resize a logical volume
- Remove a volume group
- Delete a logical volume
- Exit
The project includes Ansible playbooks for automated deployment:
lvm_deploy.yml
: Sets up the environment and deploys the LVM management scriptinventory.ini
: Contains the target hosts configuration
LVM/
├── lvm.py # Main LVM management script
├── inventory.ini # Ansible inventory file
├── ansible_playbooks/ # Ansible automation scripts
│ └── lvm_deploy.yml # Deployment playbook
└── README.md # This documentation
- Confirmation prompts for destructive operations
- Filesystem checks before resizing
- Proper unmounting before volume deletion
- Error handling and validation
Contributions are welcome! Please feel free to submit a Pull Request.
MIT
Adarsh Kumar