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, I(private_key) or I( key_file) must be provided.
37
37
options:
38
38
_terms:
39
39
description:
49
49
required: True
50
50
api_filter:
51
51
description:
52
- - The api_filter to use.
52
+ - The api_filter to use. Filters should be key value pairs separated by a space.
53
53
required: False
54
54
plugin:
55
55
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:
81
+ type: bool
77
82
description:
78
83
- Whether to return raw API data with the lookup/query or whether to return a key/value dict
79
84
required: False
@@ -303,6 +308,7 @@ def run(self, terms, variables=None, **kwargs):
303
308
or os .getenv ("NETBOX_URL" )
304
309
)
305
310
netbox_ssl_verify = kwargs .get ("validate_certs" , True )
311
+ netbox_private_key = kwargs .get ("private_key" )
306
312
netbox_private_key_file = kwargs .get ("key_file" )
307
313
netbox_api_filter = kwargs .get ("api_filter" )
308
314
netbox_raw_return = kwargs .get ("raw_data" )
@@ -318,6 +324,7 @@ def run(self, terms, variables=None, **kwargs):
318
324
netbox = pynetbox .api (
319
325
netbox_api_endpoint ,
320
326
token = netbox_api_token if netbox_api_token else None ,
327
+ private_key = netbox_private_key ,
321
328
private_key_file = netbox_private_key_file ,
322
329
)
323
330
netbox .http_session = session
0 commit comments