Assemble module - local src file not found

136 views
Skip to first unread message

Arthur Francis

unread,
Feb 1, 2016, 11:41:33 AM2/1/16
to Ansible Project
Hi All,

I am experimenting with the Assemble module to join two files together but not having much luck:

---
- hosts: testhosts2
  sudo
: yes
  tasks
:
   
- name: Test Task
      assemble
: src=common/new.file
                dest
=/etc/test.file
                remote_src
=false

I added the remote_src=false after reading some suggestions in various forums but it still not working. Both files definitely exist. Its strange because other modules work fine with the local src and remote dest parameters like "copy"

Output with remote_source=false


An exception occurred during task execution. The full traceback is:
Traceback (most recent call last):
 
File "/usr/lib/python2.7/site-packages/ansible-2.0.0-py2.7.egg/ansible/executor/process/worker.py", line 118, in run
    executor_result
= TaskExecutor(host, task, job_vars, new_connection_info, self._new_stdin, self._loader, shared_loader_obj).run()
 
File "/usr/lib/python2.7/site-packages/ansible-2.0.0-py2.7.egg/ansible/executor/task_executor.py", line 111, in run
    res
= self._execute()
 
File "/usr/lib/python2.7/site-packages/ansible-2.0.0-py2.7.egg/ansible/executor/task_executor.py", line 281, in _execute
    result
= self._handler.run(task_vars=variables)
 
File "/usr/lib/python2.7/site-packages/ansible-2.0.0-py2.7.egg/ansible/plugins/action/assemble.py", line 104, in run
    path
= self._assemble_from_fragments(src, delimiter, _re, ignore_hidden)
 
File "/usr/lib/python2.7/site-packages/ansible-2.0.0-py2.7.egg/ansible/plugins/action/assemble.py", line 45, in _assemble_from_fragments
   
for f in sorted(os.listdir(src_path)):
OSError: [Errno 20] Not a directory: '/root/ansible/common/new.file'


fatal
: [10.1.1.12]: FAILED! => {"failed": true, "stdout": ""}

Output without remote_src=false

fatal: [10.1.1.12]: FAILED! => {"msg": "Source (common/new.file) does not exist", "failed": true, "changed": false, "invocation": {"module_name": "assemble", "module_args": {"dest": "/etc/test.file", "src": "common/new.file"}}}

local file

[root@10.1.1.12 ansible]# ls -l common/
total
12
-rw-r--r--. 1 root root   39 Jan 27 16:39 new.file
-rw-r--r--. 1 root root  120 Jan 27 10:08 vmware-tools.repo



Reply all
Reply to author
Forward
0 new messages