I the maintainer of netscaler.adc
ansible collection.
I am writing a module whose options have some dependency.
Let us take options – proxy, username, password, token
Only if proxy
is true
, username
, password
, token
is valid.
If username
, password
, token
is given, and proxy
is not given (defaults to false
, then Ansible should error out.
Using the Dependencies between module options in the Ansible documentation, I could not find a way to achieve this.
However, the contrary I could achieve, that is, if proxy
is present, and when username
, password
, token
are not provided, I made ansible to error out.
required_if=[
("proxy", True, ("username", "password", "token",), True),
],
Can anyone help me to achieve the above one (Only if proxy
is true
, username
, password
, token
is valid.
If username
, password
, token
is given, and proxy
is not given (defaults to false
, then Ansible should error out.)