I'm thinking it might be better to be more explicit, and have something
like:

extra_yum_flags="--foo asdf --bar xyz"

?






On Fri, Nov 29, 2013 at 1:49 AM, Dmitry Makovey <[email protected]>wrote:

> Hi,
>
> I'm trying to extend yum module to allow passing some "extra" options to
> it that are provided by some of the yum plugins. I would rather avoid
> enumeration of all possible options (some I don't even know what they will
> be!) What is the best way to reflect "freestyle" options like that in
> module definition:
>
> module = AnsibleModule(
>     argument_spec = dict(
>         state     = dict(default='present', choices=['present', 'absent']),
>         name      = dict(required=True),
>         enabled   = dict(required=True, choices=BOOLEANS),
>         something = dict(aliases=['whatever'])
>
>         **freestyle = dict()....
>     ))
>
>
> see that "**freestyle"? Is there a construct I can use to say: if you 
> encounter any unknown arguments - just register them for later analysis? Then 
> in my code I can go through supplied arguments and transform them from 
> "foo=bar" into ['--foo','bar'] parameters I will add to yum_cmd.
>
>
> I realize that I can just forgo "magic" AnsibleModule piece and go "manual" 
> but I would rather retain most of yum module as-is since it's a good module 
> and no need to fork it if I don't have to.
>
>  --
> 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].
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Michael DeHaan <[email protected]>
CTO, AnsibleWorks, Inc.
http://www.ansibleworks.com/

-- 
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].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to