Skip to content

Commit

Permalink
Merge pull request #2 from hellofresh/feature/fix-non-replicate-cmd-i…
Browse files Browse the repository at this point in the history
…ssues

Preventing errors when not using replicate command.
  • Loading branch information
ahelal committed May 12, 2016
2 parents 62044ed + 46d00d8 commit 1c8bbf1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,10 @@ aws_rds_instance_type : "db.t2.micro"
aws_rds_wait : "true"


aws_rds_command : "create"


# High wait timeout because RDS takes it's time.
aws_rds_wait_timeout : 900

#aws_rds_vpc_subnet
8 changes: 7 additions & 1 deletion tasks/rds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
port: "{{ aws_rds_port | default(omit) }}"
iops: "{{ aws_rds_iops | default(omit) }}"
character_set_name: "{{ aws_rds_character_set_name | default(omit) }}"
register: rds_server
register: rds_server_others
when: aws_rds_command != 'replicate'


Expand Down Expand Up @@ -61,3 +61,9 @@
character_set_name: "{{ aws_rds_character_set_name | default(omit) }}"
register: rds_server
when: aws_rds_command == 'replicate'

- name: Set fact if command is not replicate
set_fact:
# Overwrite rds_server variable with actual run result for later usage by other roles (e.g. aws-route53).
rds_server={{rds_server_others}}
when: aws_rds_command != 'replicate'

0 comments on commit 1c8bbf1

Please sign in to comment.