On Sat, May 09, 2020 at 09:21:34AM +0200, Stefan Hornburg (Racke) wrote:
> On 5/9/20 9:09 AM, Marc Haber wrote:
> > On Sat, May 09, 2020 at 08:53:37AM +0200, Stefan Hornburg (Racke) wrote:
> >> I don't have a custom module around which I could share here. Searching
> >> the web
> >> for "ansible custom module" should give you plenty of insights though.
> >
> > Are you trying to say that a plain custom module called from a task (a)
> > has access to the full inventory including all variables and (b) can
> > write to it with following tasks seeing the changes it did?
>
> That's a good question :-). But you can also write filter plugins which is
> probably a better
> idea.
>
> This would allow you do augment your data structure with
>
> "{{ data | augment }}"
>
> You can find an example here:
> https://blog.oddbit.com/post/2019-04-25-writing-ansible-filter-plugins/
I am not sure whether this is a better idea, making the augmentation
dependent to the actual task being in quesiton. An independent approach
would, for example, allow people to use generic apache, letsencrypt,
proxy and DNS modules from The Galaxy while just writing the URL and
other web site data in the host definition, with independent code taking
the job of converting the simple host definition into input data
structures the generic modules can grok.
Greetings
Marc
--
-----------------------------------------------------------------------------
Marc Haber | "I don't trust Computers. They | Mailadresse im Header
Leimen, Germany | lose things." Winona Ryder | Fon: *49 6224 1600402
Nordisch by Nature | How to make an American Quilt | Fax: *49 6224 1600421
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/20200509082849.GD18228%40torres.zugschlus.de.