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)"
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/6e97d8fb-7ab8-4923-bb42-76acc7cd2a74%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.