Just by making the following changes, we will be able to add apikey as an argument:
- First, we add this to the module_args dictionary on lines 76-78: apikey=dict(type='str',required=False,default=None)
- Then we check whether module.params['apikey'] is set to a value of None
- If it is not, set it to apikey = module.params['apikey']
- Now, if the module is used with the Ansible command-line tool, pass it along with the target and host, and if it is used in the playbook, pass it there