Repository: ansible/ansible-modules-core

Issue:
RDS FACTS Capture endpoint data BEFORE the rds instance is in available status (If not limited by AWS API)
<!--- Verify first that your issue/request is not already reported in GitHub -->
##### ISSUE TYPE

<!--- Pick one below and delete the rest: -->
- Bug
##### COMPONENT NAME

<!--- Name of the plugin/module/task -->

rds: command: facts.
##### ANSIBLE VERSION

```
ansible 2.1.0.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides

```

<!--- Paste verbatim output from “ansible --version” between quotes -->
##### CONFIGURATION

<!---
Mention any settings you have changed/added/removed in ansible.cfg
(or using the ANSIBLE_* environment variables).
-->

Using Tower, nothing special
##### OS / ENVIRONMENT

<!---
Mention the OS you are running Ansible from, and the OS you are
managing, or say “N/A” for anything that is not platform-specific.
-->

N/A
##### SUMMARY

<!--- Explain the problem briefly -->

After restoring an rds instance from snapshot WIHTOUT waiting when using the rds module with facts command the endpoint value does not change from none UNTIL the rds instance status actually changes to available even though in AWS the endpoint becomes available AS SOON as the status changes from creating to backing up.

As a side step we also tried debuggin using the rds.instance.status field looking for backing-up and the endpoint field was still none even after that status is reached.
##### STEPS TO REPRODUCE

<!---
For bugs, show exactly how to reproduce the problem.
For new features, show how the feature would be used.
-->

1.-Restore an Instance from snapshot with wait: no
2.-Perform a Do..Until loop for rds:command:facts until the rds endpoint is defined
3.-debug endpoint once Do..until exits

```
<!--- Paste example playbooks or commands between quotes -->
- name: restore rds instance from snapshot
  rds:
    command: restore
    snapshot: "{{ wp_db_snapshot }}"
    instance_name: "{{ wp_db_instance }}"
    region: "{{ region }}"
    subnet: "{{ rds_subnet }}"
    zone: "{{ rds_az }}"
    publicly_accessible: yes
    # wait: yes
    # wait_timeout: 8000
  when: not create_rds
  register: rds
  # async: 8000
  # poll: 15
  tags: rds_database

- name: Debug RDS facts
  rds:
    command: facts
    instance_name: '{{ wp_db_instance}}'
    region: "{{ region }}"
  register: rds_facts
  until: not(rds_facts.instance.endpoint is none)
  retries: 20
  delay: 30

- debug: var=rds_facts
```

<!--- You can also paste gist.github.com links for larger files -->
##### EXPECTED RESULTS

<!--- What did you expect to happen when running the steps above? -->

The Do..Until exits as soon as the rds_facts.instance.endpoint field is anything else BUT None (the Python representation of the null value). In other words, the endpoint of the rds instance is defined.
In AWS this happens as soon as the instance exits the creating status and goes into the backing-up status.

In the output below there are 17 iterations rather then the maximum 20. This means the condition became true BEFORE the retry limit was reached, this happened only after the instance became available. It should happen as soon as the endpoint is actually available(if not limited by AWS API)
##### ACTUAL RESULTS

<!--- What actually happened? If possible run with high verbosity (-vvvv) -->

The Do..Until loops until the instance reaches the available status only THEN the endpoint becomes something other than null. This happens regardless of whether or not the endpoint is already available in AWS, the loop just keeps going until the instance becomes available.

```
<!--- Paste verbatim command output between quotes -->

TASK [seed : restore rds instance from snapshot] *******************************
task path: /var/lib/awx/projects/_1965__cross_region_voucher_w_ami/roles/seed/tasks/rds.yaml:28
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: awx
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1465007054.02-162531740248694 `" && echo ansible-tmp-1465007054.02-162531740248694="` echo $HOME/.ansible/tmp/ansible-tmp-1465007054.02-162531740248694 `" ) && sleep 0'
<127.0.0.1> PUT /tmp/tmp0IpTMO TO /var/lib/awx/.ansible/tmp/ansible-tmp-1465007054.02-162531740248694/rds
<127.0.0.1> EXEC /bin/sh -c 'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /var/lib/awx/.ansible/tmp/ansible-tmp-1465007054.02-162531740248694/rds; rm -rf "/var/lib/awx/.ansible/tmp/ansible-tmp-1465007054.02-162531740248694/" > /dev/null 2>&1 && sleep 0'
changed: [localhost] => {"changed": true, "instance": {"availability_zone": "us-west-2a", "backup_retention": 1, "create_time": null, "endpoint": null, "id": "wp-voucher-demo", "instance_type": "db.t2.small", "iops": null, "maintenance_window": "sat:12:00-sat:12:30", "multi_zone": false, "port": null, "replication_source": null, "status": "creating", "username": "voucherqadb", "vpc_security_groups": "sg-a635d9c3"}, "invocation": {"module_args": {"apply_immediately": false, "aws_access_key": null, "aws_secret_key": null, "backup_retention": null, "backup_window": null, "character_set_name": null, "command": "restore", "db_engine": null, "db_name": null, "ec2_url": null, "engine_version": null, "force_failover": false, "instance_name": "wp-voucher-demo", "instance_type": null, "iops": null, "license_model": null, "maint_window": null, "multi_zone": false, "new_instance_name": null, "option_group": null, "parameter_group": null, "password": null, "port": null, "profile": null, "publicly_accessible": "True", "region": "us-west-2", "security_groups": null, "security_token": null, "size": null, "snapshot": "voucher-ssd-qa", "source_instance": null, "subnet": "autoscale-blog-subnet", "tags": null, "upgrade": false, "username": null, "validate_certs": true, "vpc_security_groups": null, "wait": false, "wait_timeout": 300, "zone": "us-west-2a"}, "module_name": "rds"}}

TASK [seed : Debug RDS facts] **************************************************
task path: /var/lib/awx/projects/_1965__cross_region_voucher_w_ami/roles/seed/tasks/rds.yaml:45
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: awx
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1465007057.35-236490559562608 `" && echo ansible-tmp-1465007057.35-236490559562608="` echo $HOME/.ansible/tmp/ansible-tmp-1465007057.35-236490559562608 `" ) && sleep 0'
<127.0.0.1> PUT /tmp/tmp9FoYGr TO /var/lib/awx/.ansible/tmp/ansible-tmp-1465007057.35-236490559562608/rds
<127.0.0.1> EXEC /bin/sh -c 'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /var/lib/awx/.ansible/tmp/ansible-tmp-1465007057.35-236490559562608/rds; rm -rf "/var/lib/awx/.ansible/tmp/ansible-tmp-1465007057.35-236490559562608/" > /dev/null 2>&1 && sleep 0'
FAILED - RETRYING: TASK: seed : Debug RDS facts (19 retries left).Result was: {"attempts": 1, "changed": false, "instance": {"availability_zone": "us-west-2a", "backup_retention": 1, "create_time": null, "endpoint": null, "id": "wp-voucher-demo", "instance_type": "db.t2.small", "iops": null, "maintenance_window": "sat:12:00-sat:12:30", "multi_zone": false, "port": null, "replication_source": null, "status": "creating", "username": "voucherqadb", "vpc_security_groups": "sg-a635d9c3"}, "invocation": {"module_args": {"apply_immediately": false, "aws_access_key": null, "aws_secret_key": null, "backup_retention": null, "backup_window": null, "character_set_name": null, "command": "facts", "db_engine": null, "db_name": null, "ec2_url": null, "engine_version": null, "force_failover": false, "instance_name": "wp-voucher-demo", "instance_type": null, "iops": null, "license_model": null, "maint_window": null, "multi_zone": false, "new_instance_name": null, "option_group": null, "parameter_group": null, "password": null, "port": null, "profile": null, "publicly_accessible": null, "region": "us-west-2", "security_groups": null, "security_token": null, "size": null, "snapshot": null, "source_instance": null, "subnet": null, "tags": null, "upgrade": false, "username": null, "validate_certs": true, "vpc_security_groups": null, "wait": false, "wait_timeout": 300, "zone": null}, "module_name": "rds"}, "retries": 20}
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1465007088.27-143924874310286 `" && echo ansible-tmp-1465007088.27-143924874310286="` echo $HOME/.ansible/tmp/ansible-tmp-1465007088.27-143924874310286 `" ) && sleep 0'
<127.0.0.1> PUT /tmp/tmprv3W7s TO /var/lib/awx/.ansible/tmp/ansible-tmp-1465007088.27-143924874310286/rds
<127.0.0.1> EXEC /bin/sh -c 'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /var/lib/awx/.ansible/tmp/ansible-tmp-1465007088.27-143924874310286/rds; rm -rf "/var/lib/awx/.ansible/tmp/ansible-tmp-1465007088.27-143924874310286/" > /dev/null 2>&1 && sleep 0'
FAILED - RETRYING: TASK: seed : Debug RDS facts (18 retries left).Result was: {"attempts": 2, "changed": false, "instance": {"availability_zone": "us-west-2a", "backup_retention": 1, "create_time": null, "endpoint": null, "id": "wp-voucher-demo", "instance_type": "db.t2.small", "iops": null, "maintenance_window": "sat:12:00-sat:12:30", "multi_zone": false, "port": null, "replication_source": null, "status": "creating", "username": "voucherqadb", "vpc_security_groups": "sg-a635d9c3"}, "invocation": {"module_args": {"apply_immediately": false, "aws_access_key": null, "aws_secret_key": null, "backup_retention": null, "backup_window": null, "character_set_name": null, "command": "facts", "db_engine": null, "db_name": null, "ec2_url": null, "engine_version": null, "force_failover": false, "instance_name": "wp-voucher-demo", "instance_type": null, "iops": null, "license_model": null, "maint_window": null, "multi_zone": false, "new_instance_name": null, "option_group": null, "parameter_group": null, "password": null, "port": null, "profile": null, "publicly_accessible": null, "region": "us-west-2", "security_groups": null, "security_token": null, "size": null, "snapshot": null, "source_instance": null, "subnet": null, "tags": null, "upgrade": false, "username": null, "validate_certs": true, "vpc_security_groups": null, "wait": false, "wait_timeout": 300, "zone": null}, "module_name": "rds"}, "retries": 20}
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1465007119.18-110811022409230 `" && echo ansible-tmp-1465007119.18-110811022409230="` echo $HOME/.ansible/tmp/ansible-tmp-1465007119.18-110811022409230 `" ) && sleep 0'
<127.0.0.1> PUT /tmp/tmptKDn25 TO /var/lib/awx/.ansible/tmp/ansible-tmp-1465007119.18-110811022409230/rds
<127.0.0.1> EXEC /bin/sh -c 'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /var/lib/awx/.ansible/tmp/ansible-tmp-1465007119.18-110811022409230/rds; rm -rf "/var/lib/awx/.ansible/tmp/ansible-tmp-1465007119.18-110811022409230/" > /dev/null 2>&1 && sleep 0'
FAILED - RETRYING: TASK: seed : Debug RDS facts (17 retries left).Result was: {"attempts": 3, "changed": false, "instance": {"availability_zone": "us-west-2a", "backup_retention": 1, "create_time": null, "endpoint": null, "id": "wp-voucher-demo", "instance_type": "db.t2.small", "iops": null, "maintenance_window": "sat:12:00-sat:12:30", "multi_zone": false, "port": null, "replication_source": null, "status": "creating", "username": "voucherqadb", "vpc_security_groups": "sg-a635d9c3"}, "invocation": {"module_args": {"apply_immediately": false, "aws_access_key": null, "aws_secret_key": null, "backup_retention": null, "backup_window": null, "character_set_name": null, "command": "facts", "db_engine": null, "db_name": null, "ec2_url": null, "engine_version": null, "force_failover": false, "instance_name": "wp-voucher-demo", "instance_type": null, "iops": null, "license_model": null, "maint_window": null, "multi_zone": false, "new_instance_name": null, "option_group": null, "parameter_group": null, "password": null, "port": null, "profile": null, "publicly_accessible": null, "region": "us-west-2", "security_groups": null, "security_token": null, "size": null, "snapshot": null, "source_instance": null, "subnet": null, "tags": null, "upgrade": false, "username": null, "validate_certs": true, "vpc_security_groups": null, "wait": false, "wait_timeout": 300, "zone": null}, "module_name": "rds"}, "retries": 20}
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1465007150.11-112347523440333 `" && echo ansible-tmp-1465007150.11-112347523440333="` echo $HOME/.ansible/tmp/ansible-tmp-1465007150.11-112347523440333 `" ) && sleep 0'
<127.0.0.1> PUT /tmp/tmpitnWVn TO /var/lib/awx/.ansible/tmp/ansible-tmp-1465007150.11-112347523440333/rds
<127.0.0.1> EXEC /bin/sh -c 'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /var/lib/awx/.ansible/tmp/ansible-tmp-1465007150.11-112347523440333/rds; rm -rf "/var/lib/awx/.ansible/tmp/ansible-tmp-1465007150.11-112347523440333/" > /dev/null 2>&1 && sleep 0'
FAILED - RETRYING: TASK: seed : Debug RDS facts (16 retries left).Result was: {"attempts": 4, "changed": false, "instance": {"availability_zone": "us-west-2a", "backup_retention": 1, "create_time": null, "endpoint": null, "id": "wp-voucher-demo", "instance_type": "db.t2.small", "iops": null, "maintenance_window": "sat:12:00-sat:12:30", "multi_zone": false, "port": null, "replication_source": null, "status": "creating", "username": "voucherqadb", "vpc_security_groups": "sg-a635d9c3"}, "invocation": {"module_args": {"apply_immediately": false, "aws_access_key": null, "aws_secret_key": null, "backup_retention": null, "backup_window": null, "character_set_name": null, "command": "facts", "db_engine": null, "db_name": null, "ec2_url": null, "engine_version": null, "force_failover": false, "instance_name": "wp-voucher-demo", "instance_type": null, "iops": null, "license_model": null, "maint_window": null, "multi_zone": false, "new_instance_name": null, "option_group": null, "parameter_group": null, "password": null, "port": null, "profile": null, "publicly_accessible": null, "region": "us-west-2", "security_groups": null, "security_token": null, "size": null, "snapshot": null, "source_instance": null, "subnet": null, "tags": null, "upgrade": false, "username": null, "validate_certs": true, "vpc_security_groups": null, "wait": false, "wait_timeout": 300, "zone": null}, "module_name": "rds"}, "retries": 20}
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1465007181.07-269511628832301 `" && echo ansible-tmp-1465007181.07-269511628832301="` echo $HOME/.ansible/tmp/ansible-tmp-1465007181.07-269511628832301 `" ) && sleep 0'
<127.0.0.1> PUT /tmp/tmpndx8vG TO /var/lib/awx/.ansible/tmp/ansible-tmp-1465007181.07-269511628832301/rds
<127.0.0.1> EXEC /bin/sh -c 'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /var/lib/awx/.ansible/tmp/ansible-tmp-1465007181.07-269511628832301/rds; rm -rf "/var/lib/awx/.ansible/tmp/ansible-tmp-1465007181.07-269511628832301/" > /dev/null 2>&1 && sleep 0'
FAILED - RETRYING: TASK: seed : Debug RDS facts (15 retries left).Result was: {"attempts": 5, "changed": false, "instance": {"availability_zone": "us-west-2a", "backup_retention": 1, "create_time": null, "endpoint": null, "id": "wp-voucher-demo", "instance_type": "db.t2.small", "iops": null, "maintenance_window": "sat:12:00-sat:12:30", "multi_zone": false, "port": null, "replication_source": null, "status": "creating", "username": "voucherqadb", "vpc_security_groups": "sg-a635d9c3"}, "invocation": {"module_args": {"apply_immediately": false, "aws_access_key": null, "aws_secret_key": null, "backup_retention": null, "backup_window": null, "character_set_name": null, "command": "facts", "db_engine": null, "db_name": null, "ec2_url": null, "engine_version": null, "force_failover": false, "instance_name": "wp-voucher-demo", "instance_type": null, "iops": null, "license_model": null, "maint_window": null, "multi_zone": false, "new_instance_name": null, "option_group": null, "parameter_group": null, "password": null, "port": null, "profile": null, "publicly_accessible": null, "region": "us-west-2", "security_groups": null, "security_token": null, "size": null, "snapshot": null, "source_instance": null, "subnet": null, "tags": null, "upgrade": false, "username": null, "validate_certs": true, "vpc_security_groups": null, "wait": false, "wait_timeout": 300, "zone": null}, "module_name": "rds"}, "retries": 20}
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1465007212.06-169153417591558 `" && echo ansible-tmp-1465007212.06-169153417591558="` echo $HOME/.ansible/tmp/ansible-tmp-1465007212.06-169153417591558 `" ) && sleep 0'
<127.0.0.1> PUT /tmp/tmpP_mpxI TO /var/lib/awx/.ansible/tmp/ansible-tmp-1465007212.06-169153417591558/rds
<127.0.0.1> EXEC /bin/sh -c 'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /var/lib/awx/.ansible/tmp/ansible-tmp-1465007212.06-169153417591558/rds; rm -rf "/var/lib/awx/.ansible/tmp/ansible-tmp-1465007212.06-169153417591558/" > /dev/null 2>&1 && sleep 0'
FAILED - RETRYING: TASK: seed : Debug RDS facts (14 retries left).Result was: {"attempts": 6, "changed": false, "instance": {"availability_zone": "us-west-2a", "backup_retention": 1, "create_time": null, "endpoint": null, "id": "wp-voucher-demo", "instance_type": "db.t2.small", "iops": null, "maintenance_window": "sat:12:00-sat:12:30", "multi_zone": false, "port": null, "replication_source": null, "status": "creating", "username": "voucherqadb", "vpc_security_groups": "sg-a635d9c3"}, "invocation": {"module_args": {"apply_immediately": false, "aws_access_key": null, "aws_secret_key": null, "backup_retention": null, "backup_window": null, "character_set_name": null, "command": "facts", "db_engine": null, "db_name": null, "ec2_url": null, "engine_version": null, "force_failover": false, "instance_name": "wp-voucher-demo", "instance_type": null, "iops": null, "license_model": null, "maint_window": null, "multi_zone": false, "new_instance_name": null, "option_group": null, "parameter_group": null, "password": null, "port": null, "profile": null, "publicly_accessible": null, "region": "us-west-2", "security_groups": null, "security_token": null, "size": null, "snapshot": null, "source_instance": null, "subnet": null, "tags": null, "upgrade": false, "username": null, "validate_certs": true, "vpc_security_groups": null, "wait": false, "wait_timeout": 300, "zone": null}, "module_name": "rds"}, "retries": 20}
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1465007243.04-64066775898219 `" && echo ansible-tmp-1465007243.04-64066775898219="` echo $HOME/.ansible/tmp/ansible-tmp-1465007243.04-64066775898219 `" ) && sleep 0'
<127.0.0.1> PUT /tmp/tmp29hagx TO /var/lib/awx/.ansible/tmp/ansible-tmp-1465007243.04-64066775898219/rds
<127.0.0.1> EXEC /bin/sh -c 'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /var/lib/awx/.ansible/tmp/ansible-tmp-1465007243.04-64066775898219/rds; rm -rf "/var/lib/awx/.ansible/tmp/ansible-tmp-1465007243.04-64066775898219/" > /dev/null 2>&1 && sleep 0'
FAILED - RETRYING: TASK: seed : Debug RDS facts (13 retries left).Result was: {"attempts": 7, "changed": false, "instance": {"availability_zone": "us-west-2a", "backup_retention": 1, "create_time": null, "endpoint": null, "id": "wp-voucher-demo", "instance_type": "db.t2.small", "iops": null, "maintenance_window": "sat:12:00-sat:12:30", "multi_zone": false, "port": null, "replication_source": null, "status": "creating", "username": "voucherqadb", "vpc_security_groups": "sg-a635d9c3"}, "invocation": {"module_args": {"apply_immediately": false, "aws_access_key": null, "aws_secret_key": null, "backup_retention": null, "backup_window": null, "character_set_name": null, "command": "facts", "db_engine": null, "db_name": null, "ec2_url": null, "engine_version": null, "force_failover": false, "instance_name": "wp-voucher-demo", "instance_type": null, "iops": null, "license_model": null, "maint_window": null, "multi_zone": false, "new_instance_name": null, "option_group": null, "parameter_group": null, "password": null, "port": null, "profile": null, "publicly_accessible": null, "region": "us-west-2", "security_groups": null, "security_token": null, "size": null, "snapshot": null, "source_instance": null, "subnet": null, "tags": null, "upgrade": false, "username": null, "validate_certs": true, "vpc_security_groups": null, "wait": false, "wait_timeout": 300, "zone": null}, "module_name": "rds"}, "retries": 20}
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1465007273.99-120092815595427 `" && echo ansible-tmp-1465007273.99-120092815595427="` echo $HOME/.ansible/tmp/ansible-tmp-1465007273.99-120092815595427 `" ) && sleep 0'
<127.0.0.1> PUT /tmp/tmpcDLaj9 TO /var/lib/awx/.ansible/tmp/ansible-tmp-1465007273.99-120092815595427/rds
<127.0.0.1> EXEC /bin/sh -c 'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /var/lib/awx/.ansible/tmp/ansible-tmp-1465007273.99-120092815595427/rds; rm -rf "/var/lib/awx/.ansible/tmp/ansible-tmp-1465007273.99-120092815595427/" > /dev/null 2>&1 && sleep 0'
FAILED - RETRYING: TASK: seed : Debug RDS facts (12 retries left).Result was: {"attempts": 8, "changed": false, "instance": {"availability_zone": "us-west-2a", "backup_retention": 1, "create_time": null, "endpoint": null, "id": "wp-voucher-demo", "instance_type": "db.t2.small", "iops": null, "maintenance_window": "sat:12:00-sat:12:30", "multi_zone": false, "port": null, "replication_source": null, "status": "creating", "username": "voucherqadb", "vpc_security_groups": "sg-a635d9c3"}, "invocation": {"module_args": {"apply_immediately": false, "aws_access_key": null, "aws_secret_key": null, "backup_retention": null, "backup_window": null, "character_set_name": null, "command": "facts", "db_engine": null, "db_name": null, "ec2_url": null, "engine_version": null, "force_failover": false, "instance_name": "wp-voucher-demo", "instance_type": null, "iops": null, "license_model": null, "maint_window": null, "multi_zone": false, "new_instance_name": null, "option_group": null, "parameter_group": null, "password": null, "port": null, "profile": null, "publicly_accessible": null, "region": "us-west-2", "security_groups": null, "security_token": null, "size": null, "snapshot": null, "source_instance": null, "subnet": null, "tags": null, "upgrade": false, "username": null, "validate_certs": true, "vpc_security_groups": null, "wait": false, "wait_timeout": 300, "zone": null}, "module_name": "rds"}, "retries": 20}
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1465007304.92-150039761789581 `" && echo ansible-tmp-1465007304.92-150039761789581="` echo $HOME/.ansible/tmp/ansible-tmp-1465007304.92-150039761789581 `" ) && sleep 0'
<127.0.0.1> PUT /tmp/tmp4xQ9xP TO /var/lib/awx/.ansible/tmp/ansible-tmp-1465007304.92-150039761789581/rds
<127.0.0.1> EXEC /bin/sh -c 'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /var/lib/awx/.ansible/tmp/ansible-tmp-1465007304.92-150039761789581/rds; rm -rf "/var/lib/awx/.ansible/tmp/ansible-tmp-1465007304.92-150039761789581/" > /dev/null 2>&1 && sleep 0'
FAILED - RETRYING: TASK: seed : Debug RDS facts (11 retries left).Result was: {"attempts": 9, "changed": false, "instance": {"availability_zone": "us-west-2a", "backup_retention": 1, "create_time": null, "endpoint": null, "id": "wp-voucher-demo", "instance_type": "db.t2.small", "iops": null, "maintenance_window": "sat:12:00-sat:12:30", "multi_zone": false, "port": null, "replication_source": null, "status": "creating", "username": "voucherqadb", "vpc_security_groups": "sg-a635d9c3"}, "invocation": {"module_args": {"apply_immediately": false, "aws_access_key": null, "aws_secret_key": null, "backup_retention": null, "backup_window": null, "character_set_name": null, "command": "facts", "db_engine": null, "db_name": null, "ec2_url": null, "engine_version": null, "force_failover": false, "instance_name": "wp-voucher-demo", "instance_type": null, "iops": null, "license_model": null, "maint_window": null, "multi_zone": false, "new_instance_name": null, "option_group": null, "parameter_group": null, "password": null, "port": null, "profile": null, "publicly_accessible": null, "region": "us-west-2", "security_groups": null, "security_token": null, "size": null, "snapshot": null, "source_instance": null, "subnet": null, "tags": null, "upgrade": false, "username": null, "validate_certs": true, "vpc_security_groups": null, "wait": false, "wait_timeout": 300, "zone": null}, "module_name": "rds"}, "retries": 20}
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1465007335.83-67919203416425 `" && echo ansible-tmp-1465007335.83-67919203416425="` echo $HOME/.ansible/tmp/ansible-tmp-1465007335.83-67919203416425 `" ) && sleep 0'
<127.0.0.1> PUT /tmp/tmpxIg_RR TO /var/lib/awx/.ansible/tmp/ansible-tmp-1465007335.83-67919203416425/rds
<127.0.0.1> EXEC /bin/sh -c 'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /var/lib/awx/.ansible/tmp/ansible-tmp-1465007335.83-67919203416425/rds; rm -rf "/var/lib/awx/.ansible/tmp/ansible-tmp-1465007335.83-67919203416425/" > /dev/null 2>&1 && sleep 0'
FAILED - RETRYING: TASK: seed : Debug RDS facts (10 retries left).Result was: {"attempts": 10, "changed": false, "instance": {"availability_zone": "us-west-2a", "backup_retention": 1, "create_time": 1465007309.814, "endpoint": null, "id": "wp-voucher-demo", "instance_type": "db.t2.small", "iops": null, "maintenance_window": "sat:12:00-sat:12:30", "multi_zone": false, "port": null, "replication_source": null, "status": "backing-up", "username": "voucherqadb", "vpc_security_groups": "sg-a635d9c3"}, "invocation": {"module_args": {"apply_immediately": false, "aws_access_key": null, "aws_secret_key": null, "backup_retention": null, "backup_window": null, "character_set_name": null, "command": "facts", "db_engine": null, "db_name": null, "ec2_url": null, "engine_version": null, "force_failover": false, "instance_name": "wp-voucher-demo", "instance_type": null, "iops": null, "license_model": null, "maint_window": null, "multi_zone": false, "new_instance_name": null, "option_group": null, "parameter_group": null, "password": null, "port": null, "profile": null, "publicly_accessible": null, "region": "us-west-2", "security_groups": null, "security_token": null, "size": null, "snapshot": null, "source_instance": null, "subnet": null, "tags": null, "upgrade": false, "username": null, "validate_certs": true, "vpc_security_groups": null, "wait": false, "wait_timeout": 300, "zone": null}, "module_name": "rds"}, "retries": 20}
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1465007366.82-162784542118006 `" && echo ansible-tmp-1465007366.82-162784542118006="` echo $HOME/.ansible/tmp/ansible-tmp-1465007366.82-162784542118006 `" ) && sleep 0'
<127.0.0.1> PUT /tmp/tmpQtJzNQ TO /var/lib/awx/.ansible/tmp/ansible-tmp-1465007366.82-162784542118006/rds
<127.0.0.1> EXEC /bin/sh -c 'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /var/lib/awx/.ansible/tmp/ansible-tmp-1465007366.82-162784542118006/rds; rm -rf "/var/lib/awx/.ansible/tmp/ansible-tmp-1465007366.82-162784542118006/" > /dev/null 2>&1 && sleep 0'
FAILED - RETRYING: TASK: seed : Debug RDS facts (9 retries left).Result was: {"attempts": 11, "changed": false, "instance": {"availability_zone": "us-west-2a", "backup_retention": 1, "create_time": 1465007309.814, "endpoint": null, "id": "wp-voucher-demo", "instance_type": "db.t2.small", "iops": null, "maintenance_window": "sat:12:00-sat:12:30", "multi_zone": false, "port": null, "replication_source": null, "status": "backing-up", "username": "voucherqadb", "vpc_security_groups": "sg-a635d9c3"}, "invocation": {"module_args": {"apply_immediately": false, "aws_access_key": null, "aws_secret_key": null, "backup_retention": null, "backup_window": null, "character_set_name": null, "command": "facts", "db_engine": null, "db_name": null, "ec2_url": null, "engine_version": null, "force_failover": false, "instance_name": "wp-voucher-demo", "instance_type": null, "iops": null, "license_model": null, "maint_window": null, "multi_zone": false, "new_instance_name": null, "option_group": null, "parameter_group": null, "password": null, "port": null, "profile": null, "publicly_accessible": null, "region": "us-west-2", "security_groups": null, "security_token": null, "size": null, "snapshot": null, "source_instance": null, "subnet": null, "tags": null, "upgrade": false, "username": null, "validate_certs": true, "vpc_security_groups": null, "wait": false, "wait_timeout": 300, "zone": null}, "module_name": "rds"}, "retries": 20}
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1465007397.77-129821263847753 `" && echo ansible-tmp-1465007397.77-129821263847753="` echo $HOME/.ansible/tmp/ansible-tmp-1465007397.77-129821263847753 `" ) && sleep 0'
<127.0.0.1> PUT /tmp/tmphxHIzj TO /var/lib/awx/.ansible/tmp/ansible-tmp-1465007397.77-129821263847753/rds
<127.0.0.1> EXEC /bin/sh -c 'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /var/lib/awx/.ansible/tmp/ansible-tmp-1465007397.77-129821263847753/rds; rm -rf "/var/lib/awx/.ansible/tmp/ansible-tmp-1465007397.77-129821263847753/" > /dev/null 2>&1 && sleep 0'
FAILED - RETRYING: TASK: seed : Debug RDS facts (8 retries left).Result was: {"attempts": 12, "changed": false, "instance": {"availability_zone": "us-west-2a", "backup_retention": 1, "create_time": 1465007309.814, "endpoint": null, "id": "wp-voucher-demo", "instance_type": "db.t2.small", "iops": null, "maintenance_window": "sat:12:00-sat:12:30", "multi_zone": false, "port": null, "replication_source": null, "status": "backing-up", "username": "voucherqadb", "vpc_security_groups": "sg-a635d9c3"}, "invocation": {"module_args": {"apply_immediately": false, "aws_access_key": null, "aws_secret_key": null, "backup_retention": null, "backup_window": null, "character_set_name": null, "command": "facts", "db_engine": null, "db_name": null, "ec2_url": null, "engine_version": null, "force_failover": false, "instance_name": "wp-voucher-demo", "instance_type": null, "iops": null, "license_model": null, "maint_window": null, "multi_zone": false, "new_instance_name": null, "option_group": null, "parameter_group": null, "password": null, "port": null, "profile": null, "publicly_accessible": null, "region": "us-west-2", "security_groups": null, "security_token": null, "size": null, "snapshot": null, "source_instance": null, "subnet": null, "tags": null, "upgrade": false, "username": null, "validate_certs": true, "vpc_security_groups": null, "wait": false, "wait_timeout": 300, "zone": null}, "module_name": "rds"}, "retries": 20}
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1465007428.76-186996109895363 `" && echo ansible-tmp-1465007428.76-186996109895363="` echo $HOME/.ansible/tmp/ansible-tmp-1465007428.76-186996109895363 `" ) && sleep 0'
<127.0.0.1> PUT /tmp/tmpgtMmQO TO /var/lib/awx/.ansible/tmp/ansible-tmp-1465007428.76-186996109895363/rds
<127.0.0.1> EXEC /bin/sh -c 'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /var/lib/awx/.ansible/tmp/ansible-tmp-1465007428.76-186996109895363/rds; rm -rf "/var/lib/awx/.ansible/tmp/ansible-tmp-1465007428.76-186996109895363/" > /dev/null 2>&1 && sleep 0'
FAILED - RETRYING: TASK: seed : Debug RDS facts (7 retries left).Result was: {"attempts": 13, "changed": false, "instance": {"availability_zone": "us-west-2a", "backup_retention": 1, "create_time": 1465007309.814, "endpoint": null, "id": "wp-voucher-demo", "instance_type": "db.t2.small", "iops": null, "maintenance_window": "sat:12:00-sat:12:30", "multi_zone": false, "port": null, "replication_source": null, "status": "backing-up", "username": "voucherqadb", "vpc_security_groups": "sg-a635d9c3"}, "invocation": {"module_args": {"apply_immediately": false, "aws_access_key": null, "aws_secret_key": null, "backup_retention": null, "backup_window": null, "character_set_name": null, "command": "facts", "db_engine": null, "db_name": null, "ec2_url": null, "engine_version": null, "force_failover": false, "instance_name": "wp-voucher-demo", "instance_type": null, "iops": null, "license_model": null, "maint_window": null, "multi_zone": false, "new_instance_name": null, "option_group": null, "parameter_group": null, "password": null, "port": null, "profile": null, "publicly_accessible": null, "region": "us-west-2", "security_groups": null, "security_token": null, "size": null, "snapshot": null, "source_instance": null, "subnet": null, "tags": null, "upgrade": false, "username": null, "validate_certs": true, "vpc_security_groups": null, "wait": false, "wait_timeout": 300, "zone": null}, "module_name": "rds"}, "retries": 20}
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1465007459.73-47065084850033 `" && echo ansible-tmp-1465007459.73-47065084850033="` echo $HOME/.ansible/tmp/ansible-tmp-1465007459.73-47065084850033 `" ) && sleep 0'
<127.0.0.1> PUT /tmp/tmpDyneP_ TO /var/lib/awx/.ansible/tmp/ansible-tmp-1465007459.73-47065084850033/rds
<127.0.0.1> EXEC /bin/sh -c 'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /var/lib/awx/.ansible/tmp/ansible-tmp-1465007459.73-47065084850033/rds; rm -rf "/var/lib/awx/.ansible/tmp/ansible-tmp-1465007459.73-47065084850033/" > /dev/null 2>&1 && sleep 0'
FAILED - RETRYING: TASK: seed : Debug RDS facts (6 retries left).Result was: {"attempts": 14, "changed": false, "instance": {"availability_zone": "us-west-2a", "backup_retention": 1, "create_time": 1465007309.814, "endpoint": null, "id": "wp-voucher-demo", "instance_type": "db.t2.small", "iops": null, "maintenance_window": "sat:12:00-sat:12:30", "multi_zone": false, "port": null, "replication_source": null, "status": "backing-up", "username": "voucherqadb", "vpc_security_groups": "sg-a635d9c3"}, "invocation": {"module_args": {"apply_immediately": false, "aws_access_key": null, "aws_secret_key": null, "backup_retention": null, "backup_window": null, "character_set_name": null, "command": "facts", "db_engine": null, "db_name": null, "ec2_url": null, "engine_version": null, "force_failover": false, "instance_name": "wp-voucher-demo", "instance_type": null, "iops": null, "license_model": null, "maint_window": null, "multi_zone": false, "new_instance_name": null, "option_group": null, "parameter_group": null, "password": null, "port": null, "profile": null, "publicly_accessible": null, "region": "us-west-2", "security_groups": null, "security_token": null, "size": null, "snapshot": null, "source_instance": null, "subnet": null, "tags": null, "upgrade": false, "username": null, "validate_certs": true, "vpc_security_groups": null, "wait": false, "wait_timeout": 300, "zone": null}, "module_name": "rds"}, "retries": 20}
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1465007490.69-251383530368033 `" && echo ansible-tmp-1465007490.69-251383530368033="` echo $HOME/.ansible/tmp/ansible-tmp-1465007490.69-251383530368033 `" ) && sleep 0'
<127.0.0.1> PUT /tmp/tmpcUdI12 TO /var/lib/awx/.ansible/tmp/ansible-tmp-1465007490.69-251383530368033/rds
<127.0.0.1> EXEC /bin/sh -c 'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /var/lib/awx/.ansible/tmp/ansible-tmp-1465007490.69-251383530368033/rds; rm -rf "/var/lib/awx/.ansible/tmp/ansible-tmp-1465007490.69-251383530368033/" > /dev/null 2>&1 && sleep 0'
FAILED - RETRYING: TASK: seed : Debug RDS facts (5 retries left).Result was: {"attempts": 15, "changed": false, "instance": {"availability_zone": "us-west-2a", "backup_retention": 1, "create_time": 1465007309.814, "endpoint": null, "id": "wp-voucher-demo", "instance_type": "db.t2.small", "iops": null, "maintenance_window": "sat:12:00-sat:12:30", "multi_zone": false, "port": null, "replication_source": null, "status": "modifying", "username": "voucherqadb", "vpc_security_groups": "sg-a635d9c3"}, "invocation": {"module_args": {"apply_immediately": false, "aws_access_key": null, "aws_secret_key": null, "backup_retention": null, "backup_window": null, "character_set_name": null, "command": "facts", "db_engine": null, "db_name": null, "ec2_url": null, "engine_version": null, "force_failover": false, "instance_name": "wp-voucher-demo", "instance_type": null, "iops": null, "license_model": null, "maint_window": null, "multi_zone": false, "new_instance_name": null, "option_group": null, "parameter_group": null, "password": null, "port": null, "profile": null, "publicly_accessible": null, "region": "us-west-2", "security_groups": null, "security_token": null, "size": null, "snapshot": null, "source_instance": null, "subnet": null, "tags": null, "upgrade": false, "username": null, "validate_certs": true, "vpc_security_groups": null, "wait": false, "wait_timeout": 300, "zone": null}, "module_name": "rds"}, "retries": 20}
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1465007521.63-161285724606564 `" && echo ansible-tmp-1465007521.63-161285724606564="` echo $HOME/.ansible/tmp/ansible-tmp-1465007521.63-161285724606564 `" ) && sleep 0'
<127.0.0.1> PUT /tmp/tmpft4c0g TO /var/lib/awx/.ansible/tmp/ansible-tmp-1465007521.63-161285724606564/rds
<127.0.0.1> EXEC /bin/sh -c 'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /var/lib/awx/.ansible/tmp/ansible-tmp-1465007521.63-161285724606564/rds; rm -rf "/var/lib/awx/.ansible/tmp/ansible-tmp-1465007521.63-161285724606564/" > /dev/null 2>&1 && sleep 0'
FAILED - RETRYING: TASK: seed : Debug RDS facts (4 retries left).Result was: {"attempts": 16, "changed": false, "instance": {"availability_zone": "us-west-2a", "backup_retention": 1, "create_time": 1465007309.814, "endpoint": null, "id": "wp-voucher-demo", "instance_type": "db.t2.small", "iops": null, "maintenance_window": "sat:12:00-sat:12:30", "multi_zone": false, "port": null, "replication_source": null, "status": "modifying", "username": "voucherqadb", "vpc_security_groups": "sg-a635d9c3"}, "invocation": {"module_args": {"apply_immediately": false, "aws_access_key": null, "aws_secret_key": null, "backup_retention": null, "backup_window": null, "character_set_name": null, "command": "facts", "db_engine": null, "db_name": null, "ec2_url": null, "engine_version": null, "force_failover": false, "instance_name": "wp-voucher-demo", "instance_type": null, "iops": null, "license_model": null, "maint_window": null, "multi_zone": false, "new_instance_name": null, "option_group": null, "parameter_group": null, "password": null, "port": null, "profile": null, "publicly_accessible": null, "region": "us-west-2", "security_groups": null, "security_token": null, "size": null, "snapshot": null, "source_instance": null, "subnet": null, "tags": null, "upgrade": false, "username": null, "validate_certs": true, "vpc_security_groups": null, "wait": false, "wait_timeout": 300, "zone": null}, "module_name": "rds"}, "retries": 20}
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1465007552.65-3744011529619 `" && echo ansible-tmp-1465007552.65-3744011529619="` echo $HOME/.ansible/tmp/ansible-tmp-1465007552.65-3744011529619 `" ) && sleep 0'
<127.0.0.1> PUT /tmp/tmpdUPiN6 TO /var/lib/awx/.ansible/tmp/ansible-tmp-1465007552.65-3744011529619/rds
<127.0.0.1> EXEC /bin/sh -c 'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /var/lib/awx/.ansible/tmp/ansible-tmp-1465007552.65-3744011529619/rds; rm -rf "/var/lib/awx/.ansible/tmp/ansible-tmp-1465007552.65-3744011529619/" > /dev/null 2>&1 && sleep 0'
FAILED - RETRYING: TASK: seed : Debug RDS facts (3 retries left).Result was: {"attempts": 17, "changed": false, "instance": {"availability_zone": "us-west-2a", "backup_retention": 1, "create_time": 1465007309.814, "endpoint": null, "id": "wp-voucher-demo", "instance_type": "db.t2.small", "iops": null, "maintenance_window": "sat:12:00-sat:12:30", "multi_zone": false, "port": null, "replication_source": null, "status": "modifying", "username": "voucherqadb", "vpc_security_groups": "sg-a635d9c3"}, "invocation": {"module_args": {"apply_immediately": false, "aws_access_key": null, "aws_secret_key": null, "backup_retention": null, "backup_window": null, "character_set_name": null, "command": "facts", "db_engine": null, "db_name": null, "ec2_url": null, "engine_version": null, "force_failover": false, "instance_name": "wp-voucher-demo", "instance_type": null, "iops": null, "license_model": null, "maint_window": null, "multi_zone": false, "new_instance_name": null, "option_group": null, "parameter_group": null, "password": null, "port": null, "profile": null, "publicly_accessible": null, "region": "us-west-2", "security_groups": null, "security_token": null, "size": null, "snapshot": null, "source_instance": null, "subnet": null, "tags": null, "upgrade": false, "username": null, "validate_certs": true, "vpc_security_groups": null, "wait": false, "wait_timeout": 300, "zone": null}, "module_name": "rds"}, "retries": 20}
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1465007583.63-257660294629509 `" && echo ansible-tmp-1465007583.63-257660294629509="` echo $HOME/.ansible/tmp/ansible-tmp-1465007583.63-257660294629509 `" ) && sleep 0'
<127.0.0.1> PUT /tmp/tmpVXnPxF TO /var/lib/awx/.ansible/tmp/ansible-tmp-1465007583.63-257660294629509/rds
<127.0.0.1> EXEC /bin/sh -c 'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /var/lib/awx/.ansible/tmp/ansible-tmp-1465007583.63-257660294629509/rds; rm -rf "/var/lib/awx/.ansible/tmp/ansible-tmp-1465007583.63-257660294629509/" > /dev/null 2>&1 && sleep 0'
ok: [localhost] => {"changed": false, "instance": {"availability_zone": "us-west-2a", "backup_retention": 1, "create_time": 1465007309.814, "endpoint": "wp-voucher-demo.cjtxgdw81xfu.us-west-2.rds.amazonaws.com", "id": "wp-voucher-demo", "instance_type": "db.t2.small", "iops": null, "maintenance_window": "sat:12:00-sat:12:30", "multi_zone": false, "port": 3306, "replication_source": null, "status": "available", "username": "voucherqadb", "vpc_security_groups": "sg-a635d9c3"}, "invocation": {"module_args": {"apply_immediately": false, "aws_access_key": null, "aws_secret_key": null, "backup_retention": null, "backup_window": null, "character_set_name": null, "command": "facts", "db_engine": null, "db_name": null, "ec2_url": null, "engine_version": null, "force_failover": false, "instance_name": "wp-voucher-demo", "instance_type": null, "iops": null, "license_model": null, "maint_window": null, "multi_zone": false, "new_instance_name": null, "option_group": null, "parameter_group": null, "password": null, "port": null, "profile": null, "publicly_accessible": null, "region": "us-west-2", "security_groups": null, "security_token": null, "size": null, "snapshot": null, "source_instance": null, "subnet": null, "tags": null, "upgrade": false, "username": null, "validate_certs": true, "vpc_security_groups": null, "wait": false, "wait_timeout": 300, "zone": null}, "module_name": "rds"}}

TASK [seed : debug] ************************************************************
task path: /var/lib/awx/projects/_1965__cross_region_voucher_w_ami/roles/seed/tasks/rds.yaml:56
ok: [localhost] => {
    "rds_facts": {
        "changed": false, 
        "instance": {
            "availability_zone": "us-west-2a", 
            "backup_retention": 1, 
            "create_time": 1465007309.814, 
            "endpoint": "wp-voucher-demo.cjtxgdw81xfu.us-west-2.rds.amazonaws.com", 
            "id": "wp-voucher-demo", 
            "instance_type": "db.t2.small", 
            "iops": null, 
            "maintenance_window": "sat:12:00-sat:12:30", 
            "multi_zone": false, 
            "port": 3306, 
            "replication_source": null, 
            "status": "available", 
            "username": "voucherqadb", 
            "vpc_security_groups": "sg-a635d9c3"
        }
    }
}

PLAY RECAP *********************************************************************
localhost                  : ok=4    changed=1    unreachable=0    failed=0   
```



Discussion:
Async wouldn't work either:

https://groups.google.com/forum/?hl=en%3De28007a285fbef44#!topic/ansible-project/0I20c9_Razg

Confirmed that aws cli is capable of obtaining this information BEFORE the rds instance is in available state.
Also, according to PIP AWS CLI itself is ALSO using BOTO?

```
[root@ip-172-16-1-20 ~]# pip install awscli
Collecting awscli
  Downloading awscli-1.10.35-py2.py3-none-any.whl (938kB)
    100% |████████████████████████████████| 942kB 632kB/s 
Collecting s3transfer==0.0.1 (from awscli)
  Downloading s3transfer-0.0.1-py2.py3-none-any.whl
Collecting botocore==1.4.25 (from awscli)
  Downloading botocore-1.4.25-py2.py3-none-any.whl (2.3MB)
    100% |████████████████████████████████| 2.3MB 269kB/s 
Collecting rsa<=3.5.0,>=3.1.2 (from awscli)
  Downloading rsa-3.4.2-py2.py3-none-any.whl (46kB)
    100% |████████████████████████████████| 51kB 8.7MB/s 
Collecting colorama<=0.3.3,>=0.2.5 (from awscli)
  Downloading colorama-0.3.3.tar.gz
Collecting docutils>=0.10 (from awscli)
  Downloading docutils-0.12.tar.gz (1.6MB)
    100% |████████████████████████████████| 1.6MB 366kB/s 
Collecting futures<4.0.0,>=2.2.0; python_version == "2.6" or python_version == "2.7" (from s3transfer==0.0.1->awscli)
  Downloading futures-3.0.5-py2-none-any.whl
Collecting python-dateutil<3.0.0,>=2.1 (from botocore==1.4.25->awscli)
  Downloading python_dateutil-2.5.3-py2.py3-none-any.whl (201kB)
    100% |████████████████████████████████| 204kB 2.9MB/s 
Collecting jmespath<1.0.0,>=0.7.1 (from botocore==1.4.25->awscli)
  Downloading jmespath-0.9.0-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): pyasn1>=0.1.3 in /usr/lib/python2.7/site-packages (from rsa<=3.5.0,>=3.1.2->awscli)
Requirement already satisfied (use --upgrade to upgrade): six>=1.5 in /usr/lib/python2.7/site-packages (from python-dateutil<3.0.0,>=2.1->botocore==1.4.25->awscli)
Installing collected packages: python-dateutil, jmespath, docutils, botocore, futures, s3transfer, rsa, colorama, awscli
  Found existing installation: python-dateutil 1.5
    Uninstalling python-dateutil-1.5:
      Successfully uninstalled python-dateutil-1.5
  Running setup.py install for docutils ... done
  Running setup.py install for colorama ... done
Successfully installed awscli-1.10.35 **botocore-1.4.25** colorama-0.3.3 docutils-0.12 futures-3.0.5 jmespath-0.9.0 python-dateutil-2.5.3 rsa-3.4.2 s3transfer-0.0.1
`
```

So at first sight, if aws cli can do it, ansible should be able too.

@einarc I see that in the google group you said

> The solution was to piggy back on aws cli to pull the RDS endpoint after waiting for the RDS instance to shift out of creating into backing-up (use a !="creating" comparison)

Would you be able to share a code snippet for how you were able to do this? I'm trying to get the endpoint when a new instance is created without having to wait for it to become available.

Thanks

You need to use either command or shell modules to make the respective aws
cli call once the instance is out of the creating phase(use a wait
condition for that) to describe the instance, then parse the job aws CLI
returns. This is done as a local task(just like any other aws module call).
To use aws cli your ansible master must have it installed and you must pass
in the aws credentials.
All the necessary documentation is on aws CLI Rds describe instance, aws
configure credentials, and in ansible Rds facts and while loop. I use the
state of the instance to check when the endpoint is ready in a while loop.
No asynchronous calls are necessary for this. Just set wait to false when
you create it and then do something else. Then wait for it to get out of
creating. It is not immediate but it's faster than waiting 7 to 10 minutes
for the instance to be in available state. I usually create a whole Ha
environment on the meantime. Ami and all. The code will be on my git hub
soon.
On Jun 25, 2016 4:45 AM, "Jamie Dyer" notifications@github.com wrote:

> @einarc https://github.com/einarc I see that in the google group you
> said
> 
> The solution was to piggy back on aws cli to pull the RDS endpoint after
> waiting for the RDS instance to shift out of creating into backing-up (use
> a !="creating" comparison)
> 
> Would you be able to share a code snippet for how you were able to do
> this? I'm trying to get the endpoint when a new instance is created without
> having to wait for it to become available.
> 
> Thanks
> 
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> https://github.com/ansible/ansible-modules-core/issues/3865#issuecomment-228535437,
> or mute the thread
> https://github.com/notifications/unsubscribe/AGN5qGhAr5tJBHJ4S7PnCTIuuFJM2QQLks5qPRTfgaJpZM4IuCVo
> .


Resolving patch:
diff --git a/cloud/amazon/rds.py b/cloud/amazon/rds.py
--- a/cloud/amazon/rds.py
+++ b/cloud/amazon/rds.py
@@ -538,8 +538,8 @@ def get_data(self):
             'iops'               : self.instance.iops
             }
 
-        # Endpoint exists only if the instance is available
-        if self.status == 'available':
+        # Only assign an Endpoint if one is available
+        if hasattr(self.instance, 'endpoint'):
             d["endpoint"] = self.instance.endpoint[0]
             d["port"] = self.instance.endpoint[1]
             if self.instance.vpc_security_groups is not None:
@@ -586,9 +586,9 @@ def get_data(self):
         }
         if self.instance["VpcSecurityGroups"] is not None:
             d['vpc_security_groups'] = ','.join(x['VpcSecurityGroupId'] for x in self.instance['VpcSecurityGroups'])
-        if self.status == 'available':
-            d['endpoint'] = self.instance["Endpoint"]["Address"]
-            d['port'] = self.instance["Endpoint"]["Port"]
+        if "Endpoint" in self.instance and self.instance["Endpoint"] is not None:
+            d['endpoint'] = self.instance["Endpoint"].get('Address', None)
+            d['port'] = self.instance["Endpoint"].get('Port', None)
         else:
             d['endpoint'] = None
             d['port'] = None


Test patch: