# Synchronize from control machine to remote host not working

**URL:** <https://forum.ansible.com/t/synchronize-from-control-machine-to-remote-host-not-working/30666>\
**Category:** Ansible Project\
**Created:** [June 27, 2019, 6:14am UTC](https://forum.ansible.com/t/synchronize-from-control-machine-to-remote-host-not-working/30666 "2019-06-27T06:14:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![furstenheim](https://avatars.discourse-cdn.com/v4/letter/f/50afbb/32.png) [@furstenheim](https://forum.ansible.com/u/furstenheim)\
**Post date:** [June 27, 2019, 6:14am UTC](https://forum.ansible.com/t/synchronize-from-control-machine-to-remote-host-not-working/30666/1 "2019-06-27T06:14:38Z")

</div>

##### SUMMARY

##### ISSUE TYPE

- Bug Report / Issue workaround

```auto
- hosts: somehost
tasks:
- name: Synchronize
synchronize:
src: README.md
dest: /tmp/

```

##### COMPONENT NAME

synchronize

##### ANSIBLE VERSION

```auto

ansible 2.7.10

```

##### CONFIGURATION

```paste

```

##### OS / ENVIRONMENT

Linux

##### STEPS TO REPRODUCE

```yaml

- hosts: somehost
tasks:
- name: Synchronize
synchronize:
src: README.md
dest: /tmp/

```

##### EXPECTED RESULTS

I’d file to be syncrhonize. If I execute any command on the remote host it works

##### ACTUAL RESULTS

```TASK

task path: xxx.yml:10
fatal: [somehost]: FAILED! => {}

MSG:

Invalid shell type specified (bash), or the plugin for that shell type is missing.

```

I’d like to be able to synchronize from the control machine to the host, but I’m getting the aforementioned error. One thing that “works” is modifying the global ansible.cfg not to use shell, but this is not an option since it directly impacts _all_ my existing scripts. Is there a way to either execute synchronize from controller to remote using bash or to specify the shell for that particular command? Somthing like shell: ‘sh’.

Also, I’m curious as to why the error. It only happens when synchronizing between controller and host. Between remote hosts it does not fail.

Thanks

---

<div class="post-metadata">

**Author:** ![sdoran](https://avatars.discourse-cdn.com/v4/letter/s/47e85d/32.png) [@sdoran](https://forum.ansible.com/u/sdoran)\
**Post date:** [June 28, 2019, 4:55pm UTC](https://forum.ansible.com/t/synchronize-from-control-machine-to-remote-host-not-working/30666/2 "2019-06-28T16:55:04Z")

</div>

It looks like DEFAULT\_EXECUTABLE is set to bash. Since there is no bash shell plugin, this fails. Valid shell plugins are listed [here.](https://docs.ansible.com/ansible/latest/plugins/shell.html#using-shell-plugins)

The [DEFAULT\_EXECUTABLE](https://docs.ansible.com/ansible/latest/reference_appendices/config.html#default-executable) setting controls the shell environment Ansible’s command is run under on the remote host. It does not affect scripts run via the script module.

---

<div class="post-metadata">

**Author:** ![furstenheim](https://avatars.discourse-cdn.com/v4/letter/f/50afbb/32.png) [@furstenheim](https://forum.ansible.com/u/furstenheim)\
**Post date:** [July 1, 2019, 6:17am UTC](https://forum.ansible.com/t/synchronize-from-control-machine-to-remote-host-not-working/30666/3 "2019-07-01T06:17:43Z")

</div>

@Sam Still, why is it that only synchronize from controller to host is failing? Same command between hosts works perfectly, as well as other commands: copy, shell…

Is there a workaround that does not involve changing a global variable for Ansible, which could affect preexisting scripts?

---

<div class="post-metadata">

**Author:** ![sdoran](https://avatars.discourse-cdn.com/v4/letter/s/47e85d/32.png) [@sdoran](https://forum.ansible.com/u/sdoran)\
**Post date:** [July 1, 2019, 7:22pm UTC](https://forum.ansible.com/t/synchronize-from-control-machine-to-remote-host-not-working/30666/4 "2019-07-01T19:22:48Z")

</div>

Things should work properly with the default config options. Has DEFAULT\_EXECUTABLE been changed? What’s the output of ansible-config dump --only-changed?

synchronize does a lot of things in the action plugin that are very atypical.

---

<div class="post-metadata">

**Author:** ![furstenheim](https://avatars.discourse-cdn.com/v4/letter/f/50afbb/32.png) [@furstenheim](https://forum.ansible.com/u/furstenheim)\
**Post date:** [July 2, 2019, 6:07am UTC](https://forum.ansible.com/t/synchronize-from-control-machine-to-remote-host-not-working/30666/5 "2019-07-02T06:07:36Z")

</div>

DEFAULT\_EXECUTABLE is only changed with the ansible.cfg to /bin/bash, but again this cannot be reverted since it affects the rest of the scripts
