Ansible Copy module error - "Exec format error"

1 599 wyświetleń
Przejdź do pierwszej nieodczytanej wiadomości

Anfield

nieprzeczytany,
22 cze 2017, 10:51:4822.06.2017
do Ansible Project
I get the error below when trying to copy a directory (from local to local)

Anyone know why? (It doesn't work either with trailing slashes in src and destination, also destination does exist)

*
fatal: [127.0.0.1]: FAILED! => {"changed": false, "cmd": "/etc/ansible/facts.d/stuff.fact", "failed": true, "msg": "[Errno 8] Exec format error", "rc": 8}

---
- hosts: local
  tasks:
    - name: Copy etc/ansible/hosts file to home/ansible dir
      copy:
        src: /home/ansible/stuff
        dest: /tmp/hosts

Anfield

nieprzeczytany,
22 cze 2017, 11:01:2122.06.2017
do Ansible Project
Resolved this when I set gather_facts: no. Anyone know why that would be? ansible 2.3.0.0


Brian Coca

nieprzeczytany,
22 cze 2017, 11:05:0322.06.2017
do Ansible Project
file is executable, fact gathering will try to execute, but it does
not seem to be a proper executable.

a) fix file permissions (assuming its JSON data) b) fix file to
execute properly
----------
Brian Coca

Anfield

nieprzeczytany,
22 cze 2017, 11:15:0422.06.2017
do Ansible Project
I dont follow. Its not a file though, its a directory. Both are directories..


Anfield

nieprzeczytany,
22 cze 2017, 11:23:0522.06.2017
do Ansible Project
The src directory is executable




Kai Stian Olstad

nieprzeczytany,
22 cze 2017, 12:35:0522.06.2017
do ansible...@googlegroups.com
On 22. juni 2017 17:15, Anfield wrote:
> I dont follow. Its not a file though, its a directory. Both are
> directories..

Brian wrote about the error messages.

fatal: [127.0.0.1]: FAILED! => {"changed": false, "cmd":
"/etc/ansible/facts.d/stuff.fact", "failed": true, "msg": "[Errno 8]
Exec format error", "rc": 8}

The file "/etc/ansible/facts.d/stuff.fact" has the execution bit set but
is not a valid script.
When does files has the execution bit set Ansible will try to execute
them. Remove the bit and Ansible will read the content.

--
Kai Stian Olstad

Brian Coca

nieprzeczytany,
22 cze 2017, 13:40:4022.06.2017
do Ansible Project
Sorry, I should have been more specific, the copy task has nothing to
do with the error, it is all about the fact gathering (setup task)
that happens before it. That is what gives you the error and the
problem is this file /etc/ansible/facts.d/stuff.fact, which I
explained how to solve in the previous email.


----------
Brian Coca

Anfield

nieprzeczytany,
22 cze 2017, 15:11:1322.06.2017
do Ansible Project
Ok. Thanks. Once I update the stuff.fact file then the playbook runs fine.


Larry Bakun

nieprzeczytany,
17 sty 2018, 12:30:1217.01.2018
do Ansible Project
Can you please share your solution? I'm facing the same issue.

ritu...@gmail.com

nieprzeczytany,
31 sty 2018, 03:39:4531.01.2018
do Ansible Project
I am facing same error although using a command module - in the with_items.
snippet below.

I turned off gathering of facts. I do not see any file related to facts on Ubuntu 16.04 /etc/ansible. Please let me know what is the fix/workaround.

 - name: Install SSL
    command: chdir="/usr/local/downloads/openssl-1.0.2f" {{item}}
    with_items:
    - "./Configure linux-x86_64 --prefix=/usr"
    - "make"
    - "make install"


Error : failed: [localhost] (item=./Configure linux-x86_64 --prefix=/usr) => {"cmd": "./Configure linux-x86_64 --prefix=/usr", "failed": true, "item": "./Configure linux-x86_64 --prefix=/usr", "msg": "[Errno 8] Exec format error", "rc": 8}

The command works outside of ansible.
Odpowiedz wszystkim
Odpowiedz autorowi
Przekaż
Nowe wiadomości: 0