How can I tell to ansible to execute this command in shell without double quote escaping?
`
- name: Configure S3 bucket for website
shell: aws s3api put-bucket-website --bucket {{ item }} --website-configuration “$(< /tmp/s3_config_{{ item }}.json)”
with_items: frontend_s3_buckets
environment:
AWS_ACCESS_KEY_ID: “{{ ansible_aws_access_key_id }}”
AWS_SECRET_ACCESS_KEY: “{{ ansible_aws_secret_access_key }}”
tags: - frontend_s3
`
My problem is: when the command is executed, it is sent to shell with double quotes escaped:
`
TASK: [frontend_s3 | Configure S3 bucket for website] *************************
failed: [54.94.253.5] => (item=teste.socialbase.com.br) => {“changed”: true, “cmd”: “aws s3api put-bucket-website --bucket teste.socialbase.com.br --website-configuration "$(< /tmp/s3_config_test.json)"”, “delta”: “0:00:00.199463”, “end”: “2015-06-07 13:54:28.956900”, “item”: “teste.socialbase.com.br”, “rc”: 255, “start”: “2015-06-07 13:54:28.757437”, “warnings”: }
stderr:
string index out of range
FATAL: all hosts have already failed – aborting
`
It is executing as follows:
aws s3api put-bucket-website --bucket {{ item }} --website-configuration "$(< /tmp/s3_config_test.json)"
But I need that it execute the command without double quote escaping, as follows:
`
aws s3api put-bucket-website --bucket {{ item }} --website-configuration “$(< /tmp/s3_config_test.json)”
`