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=‘<>%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 ?