Settings for ansible_shell_type in inventory file not work

76 views
Skip to first unread message

WD Wang

unread,
Apr 21, 2016, 11:01:44 AM4/21/16
to Ansible Project
hi,

I can use the command below to send some files to remote:

$ ansible -e 'ansible_shell_type=sh' -i hosts -m synchronize -a "src=node_modules/ dest=/tmp/node_modules/"  dev
host1 | SUCCESS => {
    "changed": false,
    "cmd": "/usr/bin/rsync --delay-updates -F --compress --archive --rsh '/usr/bin/ssh  -S none -o StrictHostKeyChecking=no' --out-format='<<CHANGED>>%i %n%L' \"/Users/wd/work/vata_nodejs/node_modules/\" \"host1:/tmp/node_modules/\"",
    "msg": "",
    "rc": 0,
    "stdout_lines": []
}

But if I set 'ansible_shell_type=sh' as blow in inventory file:

[dev]
host1

[dev:vars]
ansible_shell_type=sh

And then use command below to test:

$ ansible -i dev -m synchronize -a "src=node_modules/ dest=/tmp/node_modules/"  dev
host1 | FAILED! => {
    "failed": true,
    "msg": "Invalid shell type specified (zsh), or the plugin for that shell type is missing."
}

It seems the settings I added not work, am I made some misunderstand about the host vars ?

Johannes Kastl

unread,
May 3, 2016, 3:45:17 PM5/3/16
to ansible...@googlegroups.com
On 21.04.16 11:02 WD Wang wrote:

> $ ansible -i dev -m synchronize -a "src=node_modules/
^^^^^^^

Is this just a typo in your mail? Before you use '... -i hosts ...',
maybe this leads to your error?

Johannes

signature.asc
Reply all
Reply to author
Forward
0 new messages