Re: [ansible-project] Dynamic types for module arguments

13 views
Skip to first unread message

Felix Fontein

unread,
Jan 12, 2022, 3:49:19 PM1/12/22
to ansible...@googlegroups.com
Hi Rhys,

> The original ssl_cert_reqs argument is a string. These string values
> map to the new boolean values.
>
> I basically want to map the strings as follows..
>
> CERT_NONE - True
> CERT_REQUIRED - False
>
> But also allow boolean values to be accepted.

maybe doing `type: raw` with `choices: [CET_NONE, CERT_REQUIRED, true,
false]` would work.

Alternatively, keep the old option, make the new and old option
mutually_exclusive, and eventually deprecate the old one. (While both
exist, none can have a default, so you need to document the actual default
manually in the documentation, and not with `default:`.)

I think having two separate options is probably the best way to handle
this particularly strange one :)

Cheers,
Felix


Reply all
Reply to author
Forward
0 new messages