33
33
description:
34
34
- Queries Netbox via its API to return virtually any information
35
35
capable of being held in Netbox.
36
- - If wanting to obtain the plaintext attribute of a secret, key_file must be provided.
36
+ - If wanting to obtain the plaintext attribute of a secret, private_key or key_file must be provided.
37
37
options:
38
38
_terms:
39
39
description:
69
69
- Whether or not to validate SSL of the NetBox instance
70
70
required: False
71
71
default: True
72
+ private_key:
73
+ description:
74
+ - The private key as a string. Mutually exclusive with I(key_file).
75
+ required: False
72
76
key_file:
73
77
description:
74
- - The location of the private key tied to user account.
78
+ - The location of the private key tied to user account. Mutually exclusive with I(private_key).
75
79
required: False
76
80
raw_data:
77
81
description:
@@ -303,6 +307,7 @@ def run(self, terms, variables=None, **kwargs):
303
307
or os .getenv ("NETBOX_URL" )
304
308
)
305
309
netbox_ssl_verify = kwargs .get ("validate_certs" , True )
310
+ netbox_private_key = kwargs .get ("private_key" )
306
311
netbox_private_key_file = kwargs .get ("key_file" )
307
312
netbox_api_filter = kwargs .get ("api_filter" )
308
313
netbox_raw_return = kwargs .get ("raw_data" )
@@ -318,6 +323,7 @@ def run(self, terms, variables=None, **kwargs):
318
323
netbox = pynetbox .api (
319
324
netbox_api_endpoint ,
320
325
token = netbox_api_token if netbox_api_token else None ,
326
+ private_key = netbox_private_key ,
321
327
private_key_file = netbox_private_key_file ,
322
328
)
323
329
netbox .http_session = session
0 commit comments