Debian Codegraph @

ansible_collections/community/general/tests/integration/targets/consul/tasks/consul_auth_method.yml

raw
1 ---
2 # Copyright (c) 2024, Florian Apolloner (@apollo13)
3 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
4 # SPDX-License-Identifier: GPL-3.0-or-later
5
6 - name: Create an auth method
7 community.general.consul_auth_method:
8 name: test
9 type: jwt
10 config:
11 jwt_validation_pubkeys:
12 - |
13 -----BEGIN PUBLIC KEY-----
14 MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAu1SU1LfVLPHCozMxH2Mo
15 4lgOEePzNm0tRgeLezV6ffAt0gunVTLw7onLRnrq0/IzW7yWR7QkrmBL7jTKEn5u
16 +qKhbwKfBstIs+bMY2Zkp18gnTxKLxoS2tFczGkPLPgizskuemMghRniWaoLcyeh
17 kd3qqGElvW/VDL5AaWTg0nLVkjRo9z+40RQzuVaE8AkAFmxZzow3x+VJYKdjykkJ
18 0iT9wCS0DRTXu269V264Vf/3jvredZiKRkgwlL9xNAwxXFg0x/XFw005UWVRIkdg
19 cKWTjpBP2dPwVZ4WWC+9aGVd+Gyn1o0CLelf4rEjGoXbAAEgAqeGUxrcIlbjXfbc
20 mwIDAQAB
21 -----END PUBLIC KEY-----
22 register: result
23
24 - assert:
25 that:
26 - result is changed
27 - result.auth_method.Type == 'jwt'
28 - result.operation == 'create'
29
30 - name: Update auth method
31 community.general.consul_auth_method:
32 name: test
33 max_token_ttl: 30m80s
34 register: result
35
36 - assert:
37 that:
38 - result is changed
39 - result.auth_method.Type == 'jwt'
40 - result.operation == 'update'
41
42 - name: Update auth method (noop)
43 community.general.consul_auth_method:
44 name: test
45 max_token_ttl: 30m80s
46 register: result
47
48 - assert:
49 that:
50 - result is not changed
51 - result.auth_method.Type == 'jwt'
52 - result.operation is not defined
53
54 - name: Delete auth method
55 community.general.consul_auth_method:
56 name: test
57 state: absent
58 register: result
59
60 - assert:
61 that:
62 - result is changed
63 - result.operation == 'remove'
64
65 - name: Delete auth method (noop)
66 community.general.consul_auth_method:
67 name: test
68 state: absent
69 register: result
70
71 - assert:
72 that:
73 - result is not changed
74 - result.operation is not defined