Hi Alex, are you breaking this command up over multiple lines by any
chance? With the current devel branch, the shell module will interpret
newlines as the start of a new command to execute, so doing this:
- shell: |
echo
$(cat /path/to/foo)
will result in the contents of the file "foo" being executed similar to
what you're seeing above.
On Tue, Sep 23, 2014 at 3:22 AM, Alex Dodson <[email protected]>
wrote:
> Hello All,
>
> I have a command to run. Here is a demo of it from the ceph doco
>
> sudo virsh secret-set-value --secret 457eb676-33da-42ec-9a8c-9293d545c337
> --base64 $(cat client.cinder.key)
>
> when I try to shell: the command below the cat command within the $() doesnt
> run. It outputs in a specific format I can't quite match with tr so catting
> it normally and removing tabs and new lines does not work for me.
>
> virsh secret-set-value --secret 457eb676-33da-42ec-9a8c-9293d545c337 --base64
> $(cat client.cinder.key)
>
>
> When I try to shell: the below to set it as a variable I get
>
> $(cat client.cinder.key)
>
> failed: [hostname] => {"changed": true, "cmd": "$(cat keyring)", "delta":
> "0:00:00.008503", "end": "2014-09-23 07:55:37.978874", "rc": 127, "start":
> "2014-09-23 07:55:37.970371"}
> stderr: /bin/sh: [client.cinder]: command not found
>
> [client.cinder] is the first line within the file I cat so for w/e reason
> it is trying to execute that it appears.
>
> Any ideas how to stop that occuring?
>
> thanks,
> Alex
>
>
>
>
> --
> 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/6106f348-5b54-4f7f-a33d-36cf7ab8dd94%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/6106f348-5b54-4f7f-a33d-36cf7ab8dd94%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
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/CAMFyvFjkn1bmGF2jjLtHcBx0rpip%3DPkL1tog_8AiSJQbpN0PUg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.