Skip to content

Commit 62044ed

Browse files
committed
Merge pull request #1 from hellofresh/feature/replica-creation
Replica creation.
2 parents 141e756 + f0b964a commit 62044ed

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

tasks/rds.yml

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,34 @@
3030
port: "{{ aws_rds_port | default(omit) }}"
3131
iops: "{{ aws_rds_iops | default(omit) }}"
3232
character_set_name: "{{ aws_rds_character_set_name | default(omit) }}"
33-
register: rds_server
33+
register: rds_server
34+
when: aws_rds_command != 'replicate'
35+
36+
37+
# Ugly hack. We MUST ONLY provide the options listed below when using 'replicate' command:
38+
39+
- name: rds | Provision a set of instances
40+
rds:
41+
instance_type: "{{ aws_rds_instance_type }}"
42+
# Even when the Ansible description [1] for the 'db_engine' option states:
43+
# "The type of database. Used only when command=create."
44+
# The ansible-playbook fails with following error when *not* providing the 'db_engine' option:
45+
# TypeError: argument of type 'NoneType' is not iterable
46+
# [1] http://docs.ansible.com/ansible/rds_module.html#options
47+
db_engine: "{{ aws_rds_db_engine }}"
48+
region: "{{ aws_rds_region }}"
49+
wait: "{{ aws_rds_wait | default(omit) }}"
50+
wait_timeout: "{{ aws_rds_wait_timeout | default(omit) }}"
51+
tags: "{{ aws_rds_instance_tags | default(omit) }}"
52+
publicly_accessible: "{{ aws_rds_publicly_accessible | default(omit) }}"
53+
zone: "{{ aws_rds_zone | default(omit) }}"
54+
command: "{{ aws_rds_command | default('create') }}"
55+
instance_name: "{{ aws_rds_instance_name | default(omit) }}"
56+
new_instance_name: "{{ aws_rds_new_instance_name | default(omit) }}"
57+
aws_rds_access_key: "{{ aws_rds_access_key | default(omit) }}"
58+
aws_rds_secret_key: "{{ aws_rds_secret_key | default(omit) }}"
59+
source_instance: "{{ aws_rds_source_instance | default(omit) }}"
60+
port: "{{ aws_rds_port | default(omit) }}"
61+
character_set_name: "{{ aws_rds_character_set_name | default(omit) }}"
62+
register: rds_server
63+
when: aws_rds_command == 'replicate'

0 commit comments

Comments
 (0)