create datanommer timescale instance
This commit is contained in:
parent
64fdf441d1
commit
d523e68a3e
4 changed files with 19 additions and 1 deletions
|
@ -1,3 +1,14 @@
|
||||||
Dependencies:
|
Dependencies:
|
||||||
- awscli
|
- awscli
|
||||||
- python3-boto3
|
- python3-boto3
|
||||||
|
|
||||||
|
|
||||||
|
Before running any of the EC2 related playbooks, first create a vars file. Use host_vars/datanommer.yml as a reference.
|
||||||
|
When running the playbook add an extra var "-e initiative_name=<vars_file_name>"
|
||||||
|
|
||||||
|
i.e. ansible-playbook create_ec2.yml -e "initiative_name=datanommer"
|
||||||
|
|
||||||
|
When creating a snapshot a description must be passed as an extra var with the key `snap_description`
|
||||||
|
The description should mention why the snaphot was created.
|
||||||
|
|
||||||
|
i.e. ansible-playbook snapshot_ebs_volume.yml -e "initiative_name=datanommer" -e "snap_description=database partitioned by year"
|
||||||
|
|
|
@ -9,6 +9,9 @@
|
||||||
roles:
|
roles:
|
||||||
- ec2_instance
|
- ec2_instance
|
||||||
|
|
||||||
|
post_tasks:
|
||||||
|
- meta: refresh_inventory
|
||||||
|
|
||||||
|
|
||||||
- name: Put ssh keys on host
|
- name: Put ssh keys on host
|
||||||
hosts: "{{initiative_name}}"
|
hosts: "{{initiative_name}}"
|
||||||
|
@ -24,4 +27,5 @@
|
||||||
- pingou
|
- pingou
|
||||||
- mobrien
|
- mobrien
|
||||||
- wwoods
|
- wwoods
|
||||||
|
- asaleh
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
[datanommer]
|
[datanommer]
|
||||||
datanommer ansible_host=100.26.18.234
|
datanommer ansible_host=100.26.18.234
|
||||||
|
[datanommer-test]
|
||||||
datanommer-test ansible_host=54.236.16.215
|
datanommer-test ansible_host=54.236.16.215
|
||||||
|
[datanommer-timescale]
|
||||||
|
datanommer-timescale ansible_host=54.146.95.101
|
||||||
|
|
|
@ -15,6 +15,6 @@
|
||||||
- name: create snapshot
|
- name: create snapshot
|
||||||
ec2_snapshot:
|
ec2_snapshot:
|
||||||
volume_id: "{{instance_info.instances[0].block_device_mappings[0].ebs.volume_id}}"
|
volume_id: "{{instance_info.instances[0].block_device_mappings[0].ebs.volume_id}}"
|
||||||
description: "Snapshot of volume for the {{instance_name}} ec2 instance"
|
description: "{{ snap_description }}"
|
||||||
region: "{{ aws_region }}"
|
region: "{{ aws_region }}"
|
||||||
wait: no
|
wait: no
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue