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

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!

James Cammarata
Director, Ansible Core Engineering
github: jimi-c

On Wed, May 13, 2015 at 4:04 AM, GrĂ©goire Pineau <[email protected]> wrote:

> 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
>
> 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
>
> 2. I would like to be able to notify a service
>
> What do you thing ?
>
>
>  --
> 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/72172e25-4d78-4f8b-af01-ac5159173254%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/72172e25-4d78-4f8b-af01-ac5159173254%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/CAMFyvFgv2TzgSoBB44qDecw4x5MYM8kirM%2BxEpO4Qt5A91JN0Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to