Skip to content

Commit 25aa07d

Browse files
authored
Merge pull request #250 from RanabirChakraborty/AMW--408
AMW--408 Error XMLSchemaParseError with Ansible collection 2.3.2 for AMQ 7.13
2 parents 656c08f + aabd295 commit 25aa07d

File tree

7 files changed

+356
-15
lines changed

7 files changed

+356
-15
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ jobs:
2121
fqcn: 'middleware_automation/amq'
2222
debug_verbosity: "${{ github.event.inputs.debug_verbosity }}"
2323
podman_tests_current: >-
24-
[ "default", "amq_upgrade", "static_cluster", "replication", "live_only", "mirroring", "custom_xml", "federation", "mask_passwords", "uninstall", "console_access" ]
24+
[ "default", "amq_upgrade", "static_cluster", "replication", "schema_validation", "live_only", "mirroring", "custom_xml", "federation", "mask_passwords", "uninstall", "console_access" ]
2525
podman_tests_next: >-
26-
[ "default", "amq_upgrade", "static_cluster", "replication", "live_only", "mirroring", "custom_xml", "federation", "mask_passwords", "uninstall", "console_access" ]
26+
[ "default", "amq_upgrade", "static_cluster", "replication", "schema_validation", "live_only", "mirroring", "custom_xml", "federation", "mask_passwords", "uninstall", "console_access" ]
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
- name: Converge
3+
hosts: all
4+
gather_facts: yes
5+
environment:
6+
http_proxy: "{{ lookup('env', 'PROXY') }}"
7+
https_proxy: "{{ lookup('env', 'PROXY') }}"
8+
no_proxy: "{{ lookup('env', 'NO_PROXY') }}"
9+
module_defaults:
10+
ansible.builtin.get_url:
11+
validate_certs: "{{ not lookup('env', 'PROXY') != '' }}"
12+
vars:
13+
activemq_version: 2.36.0
14+
activemq_schema_src: "/tmp/amq_test/schema/activemq.xsd"
15+
roles:
16+
- middleware_automation.amq.activemq
Lines changed: 265 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,265 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2+
<xs:schema elementFormDefault="qualified" version="1.0" targetNamespace="http://activemq.apache.org/schema" xmlns:tns="http://activemq.apache.org/schema" xmlns:xs="http://www.w3.org/2001/XMLSchema">
3+
4+
<xs:element name="access" type="tns:accessDTO"/>
5+
6+
<xs:element name="allowlist" type="tns:allowListDTO"/>
7+
8+
<xs:element name="app" type="tns:appDTO"/>
9+
10+
<xs:element name="authorisation" type="tns:authorisationDTO"/>
11+
12+
<xs:element name="binding" type="tns:bindingDTO"/>
13+
14+
<xs:element name="broker" type="tns:brokerDTO"/>
15+
16+
<xs:element name="component" type="tns:componentDTO"/>
17+
18+
<xs:element name="connector" type="tns:jmxConnectorDTO"/>
19+
20+
<xs:element name="default-access" type="tns:defaultAccessDTO"/>
21+
22+
<xs:element name="entry" type="tns:entryDTO"/>
23+
24+
<xs:element name="jaas-security" type="tns:jaasSecurityDTO"/>
25+
26+
<xs:element name="management-context" type="tns:managementContextDTO"/>
27+
28+
<xs:element name="match" type="tns:matchDTO"/>
29+
30+
<xs:element name="property" type="tns:propertyDTO"/>
31+
32+
<xs:element name="request-log" type="tns:requestLogDTO"/>
33+
34+
<xs:element name="role-access" type="tns:roleAccessDTO"/>
35+
36+
<xs:element name="security-manager" type="tns:securityManagerDTO"/>
37+
38+
<xs:element name="server" type="tns:serverDTO"/>
39+
40+
<xs:element name="web" type="tns:webServerDTO"/>
41+
42+
<xs:element name="whitelist" type="tns:whiteListDTO"/>
43+
44+
<xs:complexType name="accessDTO">
45+
<xs:sequence/>
46+
<xs:attribute name="method" type="xs:string"/>
47+
<xs:attribute name="roles" type="xs:string"/>
48+
</xs:complexType>
49+
50+
<xs:complexType name="allowListDTO">
51+
<xs:sequence>
52+
<xs:element ref="tns:entry" minOccurs="0" maxOccurs="unbounded"/>
53+
</xs:sequence>
54+
</xs:complexType>
55+
56+
<xs:complexType name="entryDTO">
57+
<xs:sequence/>
58+
<xs:attribute name="domain" type="xs:string"/>
59+
<xs:attribute name="key" type="xs:string"/>
60+
</xs:complexType>
61+
62+
<xs:complexType name="appDTO">
63+
<xs:sequence/>
64+
<xs:attribute name="name" type="xs:string"/>
65+
<xs:attribute name="url" type="xs:string"/>
66+
<xs:attribute name="war" type="xs:string"/>
67+
</xs:complexType>
68+
69+
<xs:complexType name="authorisationDTO">
70+
<xs:sequence>
71+
<xs:element ref="tns:whitelist" minOccurs="0"/>
72+
<xs:element ref="tns:allowlist" minOccurs="0"/>
73+
<xs:element ref="tns:default-access"/>
74+
<xs:element ref="tns:role-access"/>
75+
</xs:sequence>
76+
</xs:complexType>
77+
78+
<xs:complexType name="whiteListDTO">
79+
<xs:sequence>
80+
<xs:element ref="tns:entry" minOccurs="0" maxOccurs="unbounded"/>
81+
</xs:sequence>
82+
</xs:complexType>
83+
84+
<xs:complexType name="defaultAccessDTO">
85+
<xs:sequence>
86+
<xs:element ref="tns:access" minOccurs="0" maxOccurs="unbounded"/>
87+
</xs:sequence>
88+
</xs:complexType>
89+
90+
<xs:complexType name="roleAccessDTO">
91+
<xs:sequence>
92+
<xs:element ref="tns:match" minOccurs="0" maxOccurs="unbounded"/>
93+
</xs:sequence>
94+
</xs:complexType>
95+
96+
<xs:complexType name="matchDTO">
97+
<xs:sequence>
98+
<xs:element ref="tns:access" minOccurs="0" maxOccurs="unbounded"/>
99+
</xs:sequence>
100+
<xs:attribute name="domain" type="xs:string"/>
101+
<xs:attribute name="key" type="xs:string"/>
102+
</xs:complexType>
103+
104+
<xs:complexType name="bindingDTO">
105+
<xs:sequence>
106+
<xs:element ref="tns:app" minOccurs="0" maxOccurs="unbounded"/>
107+
</xs:sequence>
108+
<xs:attribute name="name" type="xs:string"/>
109+
<xs:attribute name="uri" type="xs:string"/>
110+
<xs:attribute name="clientAuth" type="xs:boolean"/>
111+
<xs:attribute name="passwordCodec" type="xs:string"/>
112+
<xs:attribute name="keyStorePath" type="xs:string"/>
113+
<xs:attribute name="keyStoreType" type="xs:string"/>
114+
<xs:attribute name="trustStorePath" type="xs:string"/>
115+
<xs:attribute name="trustStoreType" type="xs:string"/>
116+
<xs:attribute name="includedTLSProtocols" type="xs:string"/>
117+
<xs:attribute name="excludedTLSProtocols" type="xs:string"/>
118+
<xs:attribute name="includedCipherSuites" type="xs:string"/>
119+
<xs:attribute name="excludedCipherSuites" type="xs:string"/>
120+
<xs:attribute name="keyStorePassword" type="xs:string"/>
121+
<xs:attribute name="trustStorePassword" type="xs:string"/>
122+
<xs:attribute name="sniHostCheck" type="xs:boolean"/>
123+
<xs:attribute name="sniRequired" type="xs:boolean"/>
124+
<xs:attribute name="sslAutoReload" type="xs:boolean"/>
125+
</xs:complexType>
126+
127+
<xs:complexType name="brokerDTO">
128+
<xs:sequence>
129+
<xs:choice>
130+
<xs:element ref="tns:jaas-security"/>
131+
<xs:element ref="tns:security-manager"/>
132+
</xs:choice>
133+
<xs:element ref="tns:server"/>
134+
<xs:element ref="tns:web" minOccurs="0"/>
135+
<xs:choice minOccurs="0" maxOccurs="unbounded">
136+
<xs:element ref="tns:component"/>
137+
<xs:element ref="tns:web"/>
138+
</xs:choice>
139+
</xs:sequence>
140+
</xs:complexType>
141+
142+
<xs:complexType name="security">
143+
<xs:sequence/>
144+
</xs:complexType>
145+
146+
<xs:complexType name="serverDTO">
147+
<xs:sequence>
148+
<xs:element name="configurationFile" type="xs:string" minOccurs="0"/>
149+
<xs:element name="configurationURI" type="xs:string" minOccurs="0"/>
150+
</xs:sequence>
151+
<xs:attribute name="configuration" type="xs:string"/>
152+
</xs:complexType>
153+
154+
<xs:complexType name="webServerDTO">
155+
<xs:complexContent>
156+
<xs:extension base="tns:componentDTO">
157+
<xs:sequence>
158+
<xs:element ref="tns:binding" minOccurs="0" maxOccurs="unbounded"/>
159+
<xs:element ref="tns:app" minOccurs="0" maxOccurs="unbounded"/>
160+
<xs:element ref="tns:request-log" minOccurs="0"/>
161+
</xs:sequence>
162+
<xs:attribute name="bind" type="xs:string"/>
163+
<xs:attribute name="path" type="xs:string" use="required"/>
164+
<xs:attribute name="clientAuth" type="xs:boolean"/>
165+
<xs:attribute name="passwordCodec" type="xs:string"/>
166+
<xs:attribute name="keyStorePath" type="xs:string"/>
167+
<xs:attribute name="trustStorePath" type="xs:string"/>
168+
<xs:attribute name="customizer" type="xs:string"/>
169+
<xs:attribute name="keyStorePassword" type="xs:string"/>
170+
<xs:attribute name="trustStorePassword" type="xs:string"/>
171+
<xs:attribute name="includedTLSProtocols" type="xs:string"/>
172+
<xs:attribute name="excludedTLSProtocols" type="xs:string"/>
173+
<xs:attribute name="includedCipherSuites" type="xs:string"/>
174+
<xs:attribute name="excludedCipherSuites" type="xs:string"/>
175+
<xs:attribute name="rootRedirectLocation" type="xs:string"/>
176+
<xs:attribute name="webContentEnabled" type="xs:boolean"/>
177+
<xs:attribute name="maxThreads" type="xs:int"/>
178+
<xs:attribute name="minThreads" type="xs:int"/>
179+
<xs:attribute name="idleThreadTimeout" type="xs:int"/>
180+
<xs:attribute name="scanPeriod" type="xs:int"/>
181+
<xs:attribute name="maxRequestHeaderSize" type="xs:int"/>
182+
<xs:attribute name="maxResponseHeaderSize" type="xs:int"/>
183+
</xs:extension>
184+
</xs:complexContent>
185+
</xs:complexType>
186+
187+
<xs:complexType name="componentDTO">
188+
<xs:sequence/>
189+
<xs:attribute name="componentClassName" type="xs:string"/>
190+
</xs:complexType>
191+
192+
<xs:complexType name="requestLogDTO">
193+
<xs:sequence/>
194+
<xs:attribute name="filename" type="xs:string" use="required"/>
195+
<xs:attribute name="append" type="xs:boolean"/>
196+
<xs:attribute name="extended" type="xs:boolean"/>
197+
<xs:attribute name="logCookies" type="xs:boolean"/>
198+
<xs:attribute name="logTimeZone" type="xs:string"/>
199+
<xs:attribute name="filenameDateFormat" type="xs:string"/>
200+
<xs:attribute name="retainDays" type="xs:int"/>
201+
<xs:attribute name="ignorePaths" type="xs:string"/>
202+
<xs:attribute name="logDateFormat" type="xs:string"/>
203+
<xs:attribute name="logLocale" type="xs:string"/>
204+
<xs:attribute name="logLatency" type="xs:boolean"/>
205+
<xs:attribute name="logServer" type="xs:boolean"/>
206+
<xs:attribute name="preferProxiedForAddress" type="xs:boolean"/>
207+
<xs:attribute name="format" type="xs:string"/>
208+
</xs:complexType>
209+
210+
<xs:complexType name="jmxConnectorDTO">
211+
<xs:sequence/>
212+
<xs:attribute name="connector-host" type="xs:string"/>
213+
<xs:attribute name="connector-port" type="xs:int" use="required"/>
214+
<xs:attribute name="rmi-registry-port" type="xs:int"/>
215+
<xs:attribute name="jmx-realm" type="xs:string"/>
216+
<xs:attribute name="object-name" type="xs:string"/>
217+
<xs:attribute name="authenticator-type" type="xs:string"/>
218+
<xs:attribute name="secured" type="xs:boolean"/>
219+
<xs:attribute name="key-store-provider" type="xs:string"/>
220+
<xs:attribute name="key-store-type" type="xs:string"/>
221+
<xs:attribute name="key-store-path" type="xs:string"/>
222+
<xs:attribute name="key-store-password" type="xs:string"/>
223+
<xs:attribute name="trust-store-provider" type="xs:string"/>
224+
<xs:attribute name="trust-store-type" type="xs:string"/>
225+
<xs:attribute name="trust-store-path" type="xs:string"/>
226+
<xs:attribute name="trust-store-password" type="xs:string"/>
227+
<xs:attribute name="password-codec" type="xs:string"/>
228+
</xs:complexType>
229+
230+
<xs:complexType name="jaasSecurityDTO">
231+
<xs:complexContent>
232+
<xs:extension base="tns:security">
233+
<xs:sequence/>
234+
<xs:attribute name="domain" type="xs:string" use="required"/>
235+
<xs:attribute name="certificate-domain" type="xs:string"/>
236+
</xs:extension>
237+
</xs:complexContent>
238+
</xs:complexType>
239+
240+
<xs:complexType name="managementContextDTO">
241+
<xs:sequence>
242+
<xs:element ref="tns:connector" minOccurs="0"/>
243+
<xs:element ref="tns:authorisation" minOccurs="0"/>
244+
</xs:sequence>
245+
</xs:complexType>
246+
247+
<xs:complexType name="propertyDTO">
248+
<xs:sequence/>
249+
<xs:attribute name="key" type="xs:string"/>
250+
<xs:attribute name="value" type="xs:string"/>
251+
</xs:complexType>
252+
253+
<xs:complexType name="securityManagerDTO">
254+
<xs:complexContent>
255+
<xs:extension base="tns:security">
256+
<xs:sequence>
257+
<xs:element ref="tns:property" minOccurs="0" maxOccurs="unbounded"/>
258+
</xs:sequence>
259+
<xs:attribute name="class-name" type="xs:string" use="required"/>
260+
</xs:extension>
261+
</xs:complexContent>
262+
</xs:complexType>
263+
</xs:schema>
264+
265+
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
driver:
3+
name: podman
4+
platforms:
5+
- name: amq_custom_xml
6+
image: registry.access.redhat.com/ubi9/ubi-init:latest
7+
pre_build_image: true
8+
privileged: true
9+
command: "/usr/sbin/init"
10+
systemd: always
11+
tmpfs:
12+
"/tmp": "exec"
13+
"/run": "rw,noexec,nosuid,nodev"
14+
provisioner:
15+
name: ansible
16+
config_options:
17+
defaults:
18+
interpreter_python: auto_silent
19+
ssh_connection:
20+
pipelining: false
21+
playbooks:
22+
prepare: prepare.yml
23+
converge: converge.yml
24+
verify: verify.yml
25+
inventory:
26+
host_vars:
27+
localhost:
28+
ansible_python_interpreter: "{{ ansible_playbook_python }}"
29+
env:
30+
ANSIBLE_FORCE_COLOR: "true"
31+
PROXY: "${PROXY}"
32+
NO_PROXY: "${NO_PROXY}"
33+
verifier:
34+
name: ansible
35+
scenario:
36+
test_sequence:
37+
- cleanup
38+
- destroy
39+
- create
40+
- prepare
41+
- converge
42+
- idempotence
43+
- side_effect
44+
- cleanup
45+
- destroy
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
- name: Prepare
3+
hosts: all
4+
vars:
5+
temp_dir: "/tmp/amq_test"
6+
7+
tasks:
8+
- name: "Run preparation common to all scenario"
9+
ansible.builtin.include_tasks: ../prepare.yml
10+
11+
- name: "Setup: Create a fake installation directory"
12+
ansible.builtin.file:
13+
path: "{{ temp_dir }}/schema"
14+
state: directory
15+
mode: '0755'
16+
17+
- name: "Setup: Place the broken XSD file"
18+
ansible.builtin.copy:
19+
src: "activemq.xsd"
20+
dest: "{{ temp_dir }}/schema/activemq.xsd"
21+
owner: root
22+
group: root
23+
mode: '0644'

roles/activemq/defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ activemq_name: 'Apache ActiveMQ'
5252
activemq_service_name: activemq
5353
activemq_service_override_template: ''
5454
activemq_modular_configuration: false
55+
activemq_schema_src: "{{ activemq_installdir }}/schema/activemq.xsd"
5556

5657
### Enable configuration for clustering / high availability
5758
activemq_ha_enabled: false

0 commit comments

Comments
 (0)