# \[FeatureRequest\] Be able to get the resolved parameters in a module

**URL:** <https://forum.ansible.com/t/featurerequest-be-able-to-get-the-resolved-parameters-in-a-module/18222>\
**Category:** Ansible Project\
**Created:** [May 13, 2015, 9:04am UTC](https://forum.ansible.com/t/featurerequest-be-able-to-get-the-resolved-parameters-in-a-module/18222 "2015-05-13T09:04:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gregoire\_Pineau](https://avatars.discourse-cdn.com/v4/letter/g/ac8455/32.png) [@Gregoire\_Pineau](https://forum.ansible.com/u/Gregoire_Pineau)\
**Post date:** [May 13, 2015, 9:04am UTC](https://forum.ansible.com/t/featurerequest-be-able-to-get-the-resolved-parameters-in-a-module/18222/1 "2015-05-13T09:04:03Z")

</div>

Hello

This mail follow-up an issue I opened on [GH](https://github.com/ansible/ansible/issues/10961).

I will summary (on update) my issue here.

In my company we have many different kind of server (applicationA, applicationB, rabbitmq, postgres, …)  
So have many roles and many playbook.

We have “basic” role that we ship in every single playbook, like machine configuration, user management,  
and obvisouly monitoring.

We are also using diamond (like collectd) for telemetry. So I started looking for a diamond role and found this one:  
[https://github.com/pythianliappis/ansiblediamond](https://github.com/pythianliappis/ansiblediamond)

I quite nice, but It does not play very nice in our kind of architecture, because I’m not able to add with ease  
a new collector in the “applicationA” role.

Why? Because the only (clean) way to configure new collector is to feed a special var “diamond\_collector\_extra\_defs”.

So it’s not possible to add a collector from another role.

As a side node, I’m coming from chef community (yeah, ansible is just 10 times more fun/simple/easy/hackable than chef.

So I decided to create a module to be able to register a new collector from any task in any role.

You can see the implementation [here](https://github.com/pythianliappis/ansiblediamond/commit/b1ff5d3b3ffb4443fea53443e97b2c5cf844d6db)

It works well, but I’m not really happy with it for two reasons:

1. I had to hardcode the path (DEFAULT\_COLLECTOR\_DIR) to the default collector dir

I would like to be able to get the _resolved_ variables

1. I would like to be able to notify a service

What do you thing ?

---

<div class="post-metadata">

**Author:** ![James\_Cammarata](https://avatars.discourse-cdn.com/v4/letter/j/7c8e57/32.png) [@James\_Cammarata](https://forum.ansible.com/u/James_Cammarata)\
**Post date:** [May 14, 2015, 6:59pm UTC](https://forum.ansible.com/t/featurerequest-be-able-to-get-the-resolved-parameters-in-a-module/18222/2 "2015-05-14T18:59:31Z")

</div>

Hi Gregoire.

I’m not sure why you had to hardcode things - typically modules that may have file paths at differing locations (because of distro packaging, custom installs, etc.) usually try to auto-detect the path, or failing that will have a param to the module that defaults to the most common location.

As for notifying a service, Ansible has always supported that:

[https://docs.ansible.com/playbooks\_intro.html#handlers-running-operations-on-change](https://docs.ansible.com/playbooks_intro.html#handlers-running-operations-on-change)

Any custom module you write should simply returned changed=True in the JSON return, which is what the ‘notify’ action relies on to send the notification to the handler.

Hope that helps!
