Commit b5916f2
[multiple] Fix host filtering and MAC address handling
Two issues in the `deploy_bmh` role:
**1. Host filter misses numbered suffixes**
The host filter used exact string matching (`in` test) to exclude
infrastructure hosts. This missed hosts like `controller-0`, causing
BMH CRs to be created for the Ansible controller VM.
Switch to regex prefix matching (`match`) so `controller-0`, `crc-0`,
`ocp-worker-0`, etc. are all properly excluded. Apply the same fix in
`cleanup_openstack` for consistency.
**2. MAC addresses corrupted by `jinja2_native`**
MAC addresses containing only decimal digits (e.g. `52:54:05:00:32:17`)
are silently converted to integers by Ansible's `jinja2_native` mode
(YAML 1.1 sexagesimal parsing). When `cifmw_baremetal_hosts` is set
via extra vars (`-e @reproducer-variables.yml`), the MAC string passes
through Jinja2 native evaluation and becomes an integer (`41136121937`).
Load `baremetal-info.yml` into a namespaced variable via `include_vars`
(which uses `yaml.safe_load` and preserves string types) and prefer it
as the data source. Also quote `bootMACAddress` in the BMH template
for defensive output.
Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Roberto Alfieri <ralfieri@redhat.com>1 parent 4e1b598 commit b5916f2
3 files changed
Lines changed: 13 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
25 | 33 | | |
26 | 34 | | |
27 | 35 | | |
28 | | - | |
29 | | - | |
| 36 | + | |
| 37 | + | |
30 | 38 | | |
31 | 39 | | |
32 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
0 commit comments