This sounds like some sort of bug or misconfiguration.   Ansible modules
are short code files.  All of the modules that come with ansible (copy
comes with ansible) are written in python and have certain substitutions
performed on them.  One of those substitutions is changing the shebang line
to point to the python interpreter on the remote machine.  To do this
ansible must find an existing shebang line in the module.

The error you're getting is because ansible was unable to find a shebang
line to substitute in the file that it thinks is the copy module.

I've just double checked and the copy module does have the required shebang
line:
https://github.com/ansible/ansible-modules-core/blob/devel/files/copy.py

Some things to try:

- what version of ansible are you running? We can check to make sure the
error isn't present there.

- does this also happen with ad hoc tasks using /usr/bin/ansible?
  ansible -I "linux.cloudapp.net," '*' -m copy -a "src=waagent
dest=/etc/sudoers.d/waagent owner=root group=root mode=0644" -u root

- does this also happen if you try running ansible from another directory?
cd / && ansible[...]

-Toshio
On Mar 12, 2015 2:18 PM, "satheesh kumar" <[email protected]>
wrote:

> I am trying to copy a file from local to the remote VM using ansible, but
> got below error.
>
> My Playbook:
>
> ---
> - hosts: linux
>   remote_user: root
>   tasks:
>       - name: remove sudo password for Suse and RedHat OS family
>         copy: src=waagent dest=/etc/sudoers.d/waagent owner=root
> group=root mode=0644
>         sudo: true
>         when: ansible_os_family == 'Suse' or ansible_os_family == 'RedHat'
>
>
> Error:
> TASK: [remove sudo password for Suse and RedHat OS family]
> ********************
> fatal: [linux.cloudapp.net] => module is missing interpreter line
>
> FATAL: all hosts have already failed -- aborting
>
>
> My waagent file content is:
> azureuser ALL = (ALL) NOPASSWD:ALL
>
> When tried googling, it mentioned to add bash interpreter for these type
> of errors. In my case, I can't include the bash interpreter here as it is a
> sudo entry. can you help here
>
>  --
> 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 [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/ab9ed7d3-0c86-43ca-a8c0-c47a1d77e4c1%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/ab9ed7d3-0c86-43ca-a8c0-c47a1d77e4c1%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAG9juEojPMMJbJ_tG-M%2BedWVnKHdQkE-_GOxcQHD9RZ8YOuSig%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to