# Copy module can not run in coreos

**URL:** <https://forum.ansible.com/t/copy-module-can-not-run-in-coreos/21356>\
**Category:** Ansible Project\
**Created:** [May 5, 2016, 2:14am UTC](https://forum.ansible.com/t/copy-module-can-not-run-in-coreos/21356 "2016-05-05T02:14:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tao\_zhang](https://avatars.discourse-cdn.com/v4/letter/t/838e76/32.png) [@tao\_zhang](https://forum.ansible.com/u/tao_zhang)\
**Post date:** [May 5, 2016, 2:14am UTC](https://forum.ansible.com/t/copy-module-can-not-run-in-coreos/21356/1 "2016-05-05T02:14:56Z")

</div>

Hi guys,

Has anyone meet the below issue?

Copy module can not run in coreos. I got the below error message:

/bin/bash: warning: setlocale: LC\_ALL: cannot change locale (en\_US.UTF-8)  
/bin/bash: warning: setlocale: LC\_ALL: cannot change locale (en\_US.UTF-8)  
/etc/localtime is not a symlink, not updating container timezone.  
Traceback (most recent call last):  
File "/home/core/.ansible/tmp/ansible-tmp-1462413293.33-173671562381843/file", line 114, in   
exitcode = invoke\_module(module, zipped\_mod, ZIPLOADER\_PARAMS)  
File "/home/core/.ansible/tmp/ansible-tmp-1462413293.33-173671562381843/file", line 28, in invoke\_module  
p = subprocess.Popen([‘/opt/bin/python’, module], env=os.environ, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)  
File "/usr/lib/python2.7/subprocess.py", line 710, in **init**  
errread, errwrite)  
File "/usr/lib/python2.7/subprocess.py", line 1335, in \_execute\_child  
raise child\_exception  
OSError: [Errno 2] No such file or directory

But synchronize, raw modules works fine.

---

<div class="post-metadata">

**Author:** ![Toshio\_Kuratomi](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@Toshio\_Kuratomi](https://forum.ansible.com/u/Toshio_Kuratomi)\
**Post date:** [May 6, 2016, 3:37pm UTC](https://forum.ansible.com/t/copy-module-can-not-run-in-coreos/21356/2 "2016-05-06T15:37:01Z")

</div>

I’m not seeing that issue, no. Might be something about how you have your remote system setup. Here’s what I tested:

Terminal1:  
$ docker run -it --name test\_coreos ianbytchek/coreos-ansible-toolbox /bin/sh

Terminal2:  
$ ansible -i ‘test\_coreos,’ ‘\*’ -c docker -m copy -a ‘src=/etc/passwd dest=/tmp/’  
clever\_brown | SUCCESS =\> {  
“changed”: true,  
“checksum”: “6b98197c1742baf15158e3964ade0f867903b578”,  
“dest”: “/tmp/passwd”,  
“gid”: 0,  
“group”: “root”,  
“md5sum”: “0286278a2fd3f46b9101e8cbd4400c8b”,  
“mode”: “0644”,  
“owner”: “root”,  
“size”: 5111,  
“src”: “/root/.ansible/tmp/ansible-tmp-1462548844.23-248426584823267/source”,  
“state”: “file”,  
“uid”: 0  
}  
$ docker exec -it test\_coreos ‘/bin/ls’ ‘/tmp/’  
passwd  
$ ansible --version [stable-2.1] (08:35:39)  
ansible 2.2.0 (devel 0a5831e654) last updated 2016/05/06 08:13:57 (GMT -700)  
lib/ansible/modules/core: (devel 1f5cf669dd) last updated 2016/05/06 08:13:32 (GMT -700)  
lib/ansible/modules/extras: (devel d1b16cd007) last updated 2016/05/06 08:13:42 (GMT -700)  
config file = /etc/ansible/ansible.cfg  
configured module search path = Default w/o overrides

-Toshio

---

<div class="post-metadata">

**Author:** ![tao\_zhang](https://avatars.discourse-cdn.com/v4/letter/t/838e76/32.png) [@tao\_zhang](https://forum.ansible.com/u/tao_zhang)\
**Post date:** [May 10, 2016, 2:22am UTC](https://forum.ansible.com/t/copy-module-can-not-run-in-coreos/21356/3 "2016-05-10T02:22:18Z")

</div>

I modify executor/module\_common.py. change

`

```auto
p = subprocess.Popen([%(interpreter)s, module], env=os.environ, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subp
rocess.PIPE)

```

`

to

`

```auto
p = subprocess.Popen([%(interpreter)s, module], env=os.environ, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subp
rocess.PIPE)

```

`

I am not sure wether it is a bug of ansible 2.1.0. But it works for me.

在 2016年5月6日星期五 UTC+8下午11:37:08，tkuratomi写道：
