https://github.com/alecaddd/ansible-ec2-snapshot
ec2 snapshot automation with Ansible and bash script
https://github.com/alecaddd/ansible-ec2-snapshot
ansible aws ec2 snapshot yml-files
Last synced: about 1 year ago
JSON representation
ec2 snapshot automation with Ansible and bash script
- Host: GitHub
- URL: https://github.com/alecaddd/ansible-ec2-snapshot
- Owner: Alecaddd
- License: gpl-3.0
- Created: 2017-07-12T02:32:49.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-07-12T23:00:51.000Z (almost 9 years ago)
- Last Synced: 2025-04-15T03:54:59.663Z (about 1 year ago)
- Topics: ansible, aws, ec2, snapshot, yml-files
- Language: Shell
- Size: 15.6 KB
- Stars: 2
- Watchers: 3
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ansible-ec2-snapshot
ec2 snapshot automation with Ansible and bash script
## Installation
* Install Ansible on your AWS ec2 with `pip install ansible`
* Be sure your ec2 is running the latest version of bob `pip install bobo3`
* Clone this repo or upload these files in your user directory
## Usage
Setup your ec2 Variables in the `vars/ec2_env.yml` file
```YAML
device_name: # Instance Root Device (eg. /dev/sda)
name: # Your EC2 Instance Name
ec2_url: # Instance Region URL (eg. https://ec2.us-east-1.amazonaws.com)
ec2_region: # Instance Region (eg. us-east-1)
```
Update the `ec2_snapshot.sh` script to set if you want to add or delete a snapshot
```Shell
ansible-playbook playbook.yml -e"add_snapshot=true del_snapshot=false"
```
Create a CRON job to execut the script automatically
```
# Run the script once a month
0 0 1 * * ansible-ec2-snapshot/ec2_snapshot.sh
```