hostvars.localhost.rds_database
When using register it creates the variable for the host(s) in the play. Also, you need to make sure both plays are occurring within the same playbook run.
hostvars.localhost.rds_database
When using register it creates the variable for the host(s) in the play. Also, you need to make sure both plays are occurring within the same playbook run.