Copy module can not run in coreos

111 views
Skip to first unread message

tao zhang

unread,
May 5, 2016, 9:35:32 AM5/5/16
to Ansible Project
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 <module> 
    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. 

Toshio Kuratomi

unread,
May 6, 2016, 11:37:08 AM5/6/16
to ansible...@googlegroups.com
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

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/f1a40bf6-a7f9-4897-baa2-927bf89f75cf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

tao zhang

unread,
May 9, 2016, 10:22:19 PM5/9/16
to Ansible Project
I modify executor/module_common.py. change
p = subprocess.Popen([%(interpreter)s, module], env=os.environ, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subp
rocess
.PIPE)

to
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写道:
Reply all
Reply to author
Forward
0 new messages