Debian Codegraph @

ansible_collections/community/aws/tests/integration/targets/mq/tasks/broker_config_tests.yml

raw
1 - name: get broker details
2 mq_broker_info:
3 broker_id: "{{ broker_id }}"
4 register: result
5 - name: verify test broker is running
6 assert:
7 fail_msg: "broker with id {{ broker_id }} is not in RUNNING state"
8 that:
9 - result.broker['broker_state'] == 'RUNNING'
10 when: not ansible_check_mode
11 - name: test 1 - send update to broker config
12 mq_broker_config:
13 broker_id: "{{ broker_id }}"
14 config_xml: "{{ lookup('file', '../files/broker_cfg.1.xml')}}"
15 register: result
16 - name: verify test1
17 assert:
18 fail_msg: test1 failed
19 that:
20 - result.changed | bool
21 - result.broker['broker_id'] == broker_id
22 - result.configuration['id'] == result.broker['configurations']['pending']['id']
23 - result.configuration['revision'] == result.broker['configurations']['pending']['revision']
24 when: not ansible_check_mode
25 - name: test 1a - send same config again
26 mq_broker_config:
27 broker_id: "{{ broker_id }}"
28 config_xml: "{{ lookup('file', '../files/broker_cfg.1.xml')}}"
29 register: result
30 - name: verify test1a
31 assert:
32 fail_msg: test1a failed
33 that:
34 - not (result.changed | bool )
35 when: not ansible_check_mode
36 - name: test 2 - send (almost) same config again - differs by whitespace
37 mq_broker_config:
38 broker_id: "{{ broker_id }}"
39 config_xml: "{{ lookup('file', '../files/broker_cfg.1a.xml')}}"
40 register: result
41 - name: verify test2
42 assert:
43 fail_msg: test2 failed
44 that:
45 - not (result.changed | bool )
46 when: not ansible_check_mode
47 - name: test 3 - send new config with custom description and request reboot
48 mq_broker_config:
49 broker_id: "{{ broker_id }}"
50 config_xml: "{{ lookup('file', '../files/broker_cfg.2.xml')}}"
51 config_description: "test 3 used custom description"
52 reboot: true
53 register: result
54 - name: verify test3
55 assert:
56 fail_msg: test3 failed
57 that:
58 - result.changed | bool
59 - result.broker['broker_state'] == 'REBOOT_IN_PROGRESS'
60 when: not ansible_check_mode
61 - name: wait for reboot
62 mq_broker_info:
63 broker_id: "{{ broker_id }}"
64 register: result
65 until: result.broker['broker_state'] == 'RUNNING'
66 retries: 15
67 delay: 60
68 when: not ansible_check_mode
69 - name: test 3a - send new config again
70 mq_broker_config:
71 broker_id: "{{ broker_id }}"
72 config_xml: "{{ lookup('file', '../files/broker_cfg.2.xml')}}"
73 config_description: "test 3 used custom description"
74 reboot: true
75 register: result
76 - name: verify test3a
77 assert:
78 fail_msg: test3a failed
79 that:
80 - not (result.changed | bool )
81 when: not ansible_check_mode
82 # Note: currently there's no way to delete a broker configuration (version)