Skip to content

Commit ba67d9d

Browse files
Enhancement: Added validate_certs option for lookup plugin (#217)
1 parent 398ba8a commit ba67d9d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

plugins/lookup/nb_lookup.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@
4949
- The API token created through Netbox
5050
- This may not be required depending on the Netbox setup.
5151
required: False
52+
validate_certs:
53+
description:
54+
- Whether or not to validate SSL of the NetBox instance
55+
required: False
56+
default: True
5257
key_file:
5358
description:
5459
- The location of the private key tied to user account.
@@ -97,7 +102,7 @@
97102
RETURN = """
98103
_list:
99104
description:
100-
- list of composed dictonaries with key and value
105+
- list of composed dictionaries with key and value
101106
type: list
102107
"""
103108

@@ -190,6 +195,7 @@ def run(self, terms, variables=None, **kwargs):
190195

191196
netbox_api_token = kwargs.get("token")
192197
netbox_api_endpoint = kwargs.get("api_endpoint")
198+
netbox_ssl_verify = kwargs.get("validate_certs")
193199
netbox_private_key_file = kwargs.get("key_file")
194200
netbox_api_filter = kwargs.get("api_filter")
195201
netbox_raw_return = kwargs.get("raw_data")
@@ -201,6 +207,7 @@ def run(self, terms, variables=None, **kwargs):
201207
netbox = pynetbox.api(
202208
netbox_api_endpoint,
203209
token=netbox_api_token if netbox_api_token else None,
210+
ssl_verify=netbox_ssl_verify,
204211
private_key_file=netbox_private_key_file,
205212
)
206213
except FileNotFoundError:

0 commit comments

Comments
 (0)