This is technically feasible now, but it isn't specifically ansible
functionality, instead it is YAML functionality. Here is an example
playbook that displays how this works:
---
- hosts: all
gather_facts: false
vars:
- uri_defaults: &URI_DEFAULTS
url: "http://httpbin.org/get"
method: GET
tasks:
- uri:
<< : *URI_DEFAULTS
status_code: 200
- uri:
<< : *URI_DEFAULTS
status_code: 201
ignore_errors: true
- uri:
<< : *URI_DEFAULTS
url: "http://httpbin.org/status/201"
status_code: 201
This uses YAML aliases, anchors, and merge functionality.
On Tue, Nov 17, 2015 at 7:46 AM, <[email protected]> wrote:
> Hello List,
>
> is it possible to set defaults for the parameters of a module? Or create a
> shortcut/alias?
>
> For example if I have to execute several uri calls with the same url. In
> case they are next
> to each other you can use a loop but otherwise you have to specify the
> same parameters
> again and again.
>
>
> Thanks,
> Dennis Benzinger | hybris
>
> --
> 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/2988e835-8764-49e7-8779-dc96fee401e0%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/2988e835-8764-49e7-8779-dc96fee401e0%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
Matt Martz
@sivel
sivel.net
--
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/CAD8N0v8LBJQU_uUQFxh%2B6PA%2BGar-bC4N7LPcu0STVebcryTSJQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.