Reputation: 187
I have installed ansible on one machine and trying to execute commands on another (remote) machinge.
Cannot find the reason why?
Upvotes: 1
Views: 746
Reputation: 12173
Executing a command via ansible -a
is equivalent to the command module, see
command module.
It is not processed via shell, therefore, >>
(as well as other redirection operators) and $HOME
are not available
In your case I would use
ansible -m 'shell' --args 'echo "hello world">>/home/ansibleremoteuser/test' all
In this case you would use the shell module which allows redirections.
Upvotes: 4