Debian Codegraph @

ansible_collections/community/general/tests/integration/targets/module_helper/tasks/mstate.yml

raw
1 # Copyright (c) 2021, Alexei Znamensky
2 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
3 # SPDX-License-Identifier: GPL-3.0-or-later
4
5 - name: test mstate 1
6 mstate:
7 a: 80
8 b: banana
9 c: cashew
10 state: nop
11 register: state1
12
13 - name: assert state1
14 assert:
15 that:
16 - state1.a == 80
17 - state1.b == "banana"
18 - state1.c == "cashew"
19 - state1.result == "abc"
20 - state1 is not changed
21
22 - name: test mstate 2
23 mstate:
24 a: 80
25 b: banana
26 c: cashew
27 register: state2
28
29 - name: assert state2
30 assert:
31 that:
32 - state2.a == 80
33 - state2.b == "banana"
34 - state2.c == "cashew"
35 - state2.result == "80bananacashew"
36 - state2 is changed
37
38 - name: test mstate 3
39 mstate:
40 a: 3
41 b: banana
42 state: b_x_a
43 register: state3
44
45 - name: assert state3
46 assert:
47 that:
48 - state3.a == 3
49 - state3.b == "banana"
50 - state3.result == "bananabananabanana"
51 - state3 is changed
52
53 - name: test mstate 4
54 mstate:
55 a: 4
56 c: cashew
57 state: c_x_a
58 register: state4
59
60 - name: assert state4
61 assert:
62 that:
63 - state4.a == 4
64 - state4.c == "cashew"
65 - state4.result == "cashewcashewcashewcashew"
66 - state4 is changed
67
68 - name: test mstate 5
69 mstate:
70 a: 5
71 b: foo
72 c: bar
73 state: both_x_a
74 register: state5
75
76 - name: assert state5
77 assert:
78 that:
79 - state5.a == 5
80 - state5.b == "foo"
81 - state5.c == "bar"
82 - state5.result == "foobarfoobarfoobarfoobarfoobar"
83 - state5 is changed