# ActionModule parameters

**URL:** <https://forum.ansible.com/t/actionmodule-parameters/16891>\
**Category:** Ansible Developer\
**Created:** [November 26, 2014, 9:38am UTC](https://forum.ansible.com/t/actionmodule-parameters/16891 "2014-11-26T09:38:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pawel\_Rozlach](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@Pawel\_Rozlach](https://forum.ansible.com/u/Pawel_Rozlach)\
**Post date:** [November 26, 2014, 9:38am UTC](https://forum.ansible.com/t/actionmodule-parameters/16891/1 "2014-11-26T09:38:37Z")

</div>

Hi!

I am automating some DNS stuff and decided to implement some of the logic inside a module. I need to:

- load a file in YAML format (just like include\_vars module does)
- merge the contents of the loaded files with host variables from dynamic inventory
- filter out data that does not belong to host defined using module’s parameters
- make resulting hash available to Ansible just like include\_vars does
- each host will have different data, depending on the module parameters

So basically I need to modify the include\_vars module. I did some research and I cannot do it using plain module - only ActionModule, because:

- in needs to modify ansible vars
- it uses host vars
- in needs to be executed locally

I have few questions though - is there a way to call it like every other module (== splitting arguments into multiple lines) ? Plain module has some boilerplate that parses arguments for me, but ActionModue seams to miss such functionality. So, instead of calling it like this:

```auto
- name: Some description goes here
local_action: data_merge input_file=/path/to/file zone_host={{ inventory hostname }}

```

I would like to be able to call it like this:

```auto
- name: Some description goes here
data_merge
args:
input_file=/path/to/file
zone_host={{ inventory hostname }}

```

How do I parse keyword arguments in a way that permits both form (single line and “args”) ? The include\_vars module assumes that everything will be on single line, not sure how I can get rid of “local\_action” keyword either.

Thanks in advance  
Paweł Rozlach
