Skip to content

audreyper/ansible-disks-mount

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Ansible Playbook: Disk Partitioning and Mounting

This Ansible playbook is designed to partition, format, and mount block devices on EC2 instances. It can be used standalone or in conjunction with Terraform code (ec2-create-attach) that creates EC2 instances, volumes, and attaches volumes to instances.

Usage

With Terraform Integration

  1. Clone the ec2-create-attach repository into your local environment.
  2. Follow the instructions in the README.md file of the ec2-create-attach repository to provision your infrastructure using Terraform.
  3. Use the inventory file generated by Terraform as input for the Ansible playbook.

Standalone Usage

If you're not using Terraform to provision EC2 instances and volumes, you can still use this playbook by adjusting it for your environment.

  • Modify the playbook (your_playbook.yaml) to match your requirements, such as specifying different block devices or hostnames.
  • Ensure that the block devices and hostnames are properly defined in your Ansible inventory file.

Requirements

  1. Parted version 1.8.3 and above. Parted is part of the community.general collection. To install it, use: ansible-galaxy collection install community.general.
  2. ansible.posix collection. To install it, run: ansible-galaxy collection install ansible.posix.

Notes

  • The playbook assumes the use of Amazon Linux instances. If you're using a different Linux distribution, you may need to adjust the tasks accordingly.
  • Make sure to replace placeholder values with the appropriate values for your environment.
  • The block_devices variable in the inventory file should contain the last letter of each block device name as obtained from the Terraform code to ensure dynamic partitioning.
  • We welcome your feedback and encourage you to report any issues or suggestions for improvement.

About

Partitions, formats, and mounts block devices on EC2 instances

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published