1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
|
.. _vyos.rest.vyos_httpapi:
**************
vyos.rest.vyos
**************
**VyOS REST API**
.. contents::
:local:
:depth: 1
Synopsis
--------
- HTTPAPI plugin for interacting with VyOS REST API.
- Supports multiple authentication methods against the VyOS REST API -- ``key`` (API key in the request body), ``header`` (API key as an ``X-API-Key`` header), ``bearer`` (a VyOS-issued bearer token, fetched and cached), ``mtls`` (mutual TLS, no application-level credential), and ``oidc`` (a bearer token obtained from an external OpenID Connect provider via the client_credentials grant, fetched and cached).
Parameters
----------
.. raw:: html
<table border=0 cellpadding=0 class="documentation-table">
<tr>
<th colspan="1">Parameter</th>
<th>Choices/<font color="blue">Defaults</font></th>
<th>Configuration</th>
<th width="100%">Comments</th>
</tr>
<tr>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>api_key</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">string</span>
</div>
</td>
<td>
</td>
<td>
<div> ini entries:
<p>[httpapi]<br>api_key = VALUE</p>
</div>
<div>env:ANSIBLE_HTTPAPI_API_KEY</div>
<div>env:VYOS_API_KEY</div>
<div>var: ansible_httpapi_api_key</div>
<div>var: ansible_vyos_api_key</div>
</td>
<td>
<div>VyOS API key. Required for auth_method <code>key</code>, <code>header</code>, and <code>bearer</code>.</div>
</td>
</tr>
<tr>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>auth_method</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">string</span>
</div>
</td>
<td>
<ul style="margin: 0; padding: 0"><b>Choices:</b>
<li><div style="color: blue"><b>key</b> ←</div></li>
<li>header</li>
<li>bearer</li>
<li>mtls</li>
<li>oidc</li>
</ul>
</td>
<td>
<div> ini entries:
<p>[httpapi]<br>auth_method = key</p>
</div>
<div>var: ansible_httpapi_auth_method</div>
</td>
<td>
<div>Authentication method to use against the VyOS REST API.</div>
</td>
</tr>
<tr>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>oidc_allow_insecure_http</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">boolean</span>
</div>
</td>
<td>
<ul style="margin: 0; padding: 0"><b>Choices:</b>
<li><div style="color: blue"><b>no</b> ←</div></li>
<li>yes</li>
</ul>
</td>
<td>
<div> ini entries:
<p>[httpapi]<br>oidc_allow_insecure_http = no</p>
</div>
<div>var: ansible_httpapi_oidc_allow_insecure_http</div>
</td>
<td>
<div>By default the OIDC token endpoint must use <code>https</code>, because the request carries the client secret and the response carries a bearer token. Set this to <code>true</code> to allow a plain <code>http</code> endpoint.</div>
<div>Intended for isolated lab setups only. With this enabled the client secret and the access token travel in cleartext and can be captured and replayed by anyone on the network path.</div>
</td>
</tr>
<tr>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>oidc_client_id</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">string</span>
</div>
</td>
<td>
</td>
<td>
<div> ini entries:
<p>[httpapi]<br>oidc_client_id = VALUE</p>
</div>
<div>var: ansible_httpapi_oidc_client_id</div>
</td>
<td>
<div>OIDC client ID for the client_credentials grant.</div>
</td>
</tr>
<tr>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>oidc_client_secret</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">string</span>
</div>
</td>
<td>
</td>
<td>
<div> ini entries:
<p>[httpapi]<br>oidc_client_secret = VALUE</p>
</div>
<div>var: ansible_httpapi_oidc_client_secret</div>
</td>
<td>
<div>OIDC client secret for the client_credentials grant.</div>
</td>
</tr>
<tr>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>oidc_timeout</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">integer</span>
</div>
</td>
<td>
<b>Default:</b><br/><div style="color: blue">10</div>
</td>
<td>
<div> ini entries:
<p>[httpapi]<br>oidc_timeout = 10</p>
</div>
<div>var: ansible_httpapi_oidc_timeout</div>
</td>
<td>
<div>Timeout, in seconds, for the token request made to the OIDC provider. An unavailable or stalled identity provider would otherwise hang the Ansible task indefinitely.</div>
</td>
</tr>
<tr>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>oidc_token_url</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">string</span>
</div>
</td>
<td>
</td>
<td>
<div> ini entries:
<p>[httpapi]<br>oidc_token_url = VALUE</p>
</div>
<div>var: ansible_httpapi_oidc_token_url</div>
</td>
<td>
<div>Token endpoint URL of the OIDC provider. Required for auth_method <code>oidc</code>.</div>
</td>
</tr>
<tr>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>oidc_validate_certs</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">boolean</span>
</div>
</td>
<td>
<ul style="margin: 0; padding: 0"><b>Choices:</b>
<li>no</li>
<li><div style="color: blue"><b>yes</b> ←</div></li>
</ul>
</td>
<td>
<div> ini entries:
<p>[httpapi]<br>oidc_validate_certs = yes</p>
</div>
<div>var: ansible_httpapi_oidc_validate_certs</div>
</td>
<td>
<div>Validate the TLS certificate of the OIDC token endpoint.</div>
<div>Set to <code>false</code> only for a lab identity provider that uses a self-signed certificate.</div>
</td>
</tr>
</table>
<br/>
Status
------
Authors
~~~~~~~
- VyOS Community (@vyos)
.. hint::
Configuration entries for each entry type have a low to high priority order. For example, a variable that is lower in the list will override a variable that is higher up.
|