Hi,

I am trying to write an action plugin that executes 2 core modules. 
I always get the error message that the plugin I'm trying to execute is 
missing the interpreter line (#/usr/bin/python) 

Certainly someone has done this before. I'd really appreaciate if someone 
could point me to my mistake: 

#!/usr/bin/python
#
# This file extends Ansible

from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

from ansible.plugins.action import ActionBase
from ansible.utils.boolean import boolean

class ActionModule(ActionBase):

    TRANSFERS_FILES = True

    def run(self, tmp=None, task_vars=None):
        ''' handler for fetch operations '''
        if task_vars is None:
            task_vars = dict()

        result = super(ActionModule, self).run(tmp, task_vars)

        source            = self._task.args.get('remote_src', None)
        dest              = self._task.args.get('dest', None)
        flat              = boolean(self._task.args.get('flat'))
        fail_on_missing   = boolean(self._task.args.get('fail_on_missing'))
        validate_checksum = boolean(self._task.args.get('validate_checksum', 
self._task.args.get('validate_md5')))

        fetch_args = dict(
            src=source,
            dest='/tmp/_template.j2'
        )

        template_args=self._task.args.copy()
        template_args.update(
            dict(
                src='/tmp/_template.j2',
                dest=dest
            )
        )

        module_return=self._execute_module(module_name='fetch', module_args=
fetch_args, task_vars=task_vars, tmp=tmp)
        result.update(module_return)
        #result.update(self._execute_module(module_name='template', 
module_args=template_args, task_vars=task_vars))
        #module_executed = True

        return result

result is 

fatal: [centos-72]: FAILED! => {"failed": true, "msg": "module (fetch) is 
missing interpreter line"}

many thanks in advance for your help.

Best,

Sirk

-- 
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/521fb3bd-abdc-4141-8db6-cbde1b8e4e13%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to