Hello All,
Disclaimer this is my first Ansible (python) module.
I wrote for it for AWS RDS instance creation (because currently the ansible RDS module only provisions instances with magnetic media and we require gp2/ssd).
I am passing ENV vars and other standard variables to the module and it completes and creates the RDS instances fine via boto3 calls, however, I’m stuck on perhaps preventing boto3 from returning stdout (which is not in json format), from the module which is causing the failure status?
'Read the Ansible modules and boto docs and tried wrapping the boto3 response with json, but then got errors that the boto3 stdout “is not JSON serializable”
print json.dumps(response)
print json.dumps(error)
Below is my verbose stdout (omitting a lot of our vars/details)
`
ansible-playbook -i “localhost,” main.yml -vvv
fatal: [localhost]: FAILED! => {
“changed”: false,
“failed”: true,
“module_stderr”: “”,
“module_stdout”: "{u’DBInstance’: {u’PubliclyAccessible’: False, u’MasterUsername’…
‘Accept-Encoding’, ‘content-length’: ‘4847’, ‘content-type’: ‘text/xml’, ‘date’: ‘Wed, 07 Jun 2017 20:13:33 GMT’}}}\n",
“msg”: “MODULE FAILURE”,
“rc”: 0
}
`
For now, I have set ignore to true, but would be grateful for any pointers on how best to resolve this.
Thank you!
Chris