I am writing netscaler.adc collection for NetScaler devices.
After instantiating AnsibleModule class, we get a module object.
In the module object, there is a params member – module.params
from ansible.module_utils.basic import AnsibleModule
module = AnsibleModule()
module.params has all the parameters for the resource. For example, if a resource has four attributes – a, b, c, d, and if the user provides only two attributes a and b, I am getting all the four attributes (c and d with their default values.
I do not want to get the non-playbook attributes.
How to achieve this.
My code is below – So far, I was of the assumption that module.params has only the playbook-attributes.
Can someone please help me a way to get only playbook-attributes?
Not that I’ve developed many collection modules myself, but on the ones I did (pretty simple ones actually) I use to get the arguments independently as dict elements instead of getting the whole params dict. For example, if I have these arguments;