Commit 3cb4c1b
Fix port conflict when deploying multiple IOCs in a single run
set_fact has higher precedence than include_vars in Ansible, so the
include_vars reset of deploy_ioc_nextport at the start of each loop
iteration was silently ignored after the first iteration's set_fact.
This caused all IOCs after the first to reuse the same port number.
The same precedence issue affects deploy_ioc_executable,
deploy_ioc_template_root_path, and deploy_ioc_dbpf_list, which could
carry over between IOCs in a multi-IOC deployment.
Fix by:
- Loading defaults into a namespaced dict and resetting all affected
per-IOC variables via set_fact each iteration, sourced from that
dict so there is a single source of truth for default values.
- Changing the port comparison from > to >= to handle the edge case
where max port equals the default.
- Removing deploy_ioc_loop_index from the port calculation, since
the deployment is sequential and each iteration's config file is
visible to the next via the find command. The index was causing
ports to skip ahead unnecessarily.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 3ba48a9 commit 3cb4c1b
2 files changed
Lines changed: 14 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
7 | 19 | | |
8 | 20 | | |
9 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
0 commit comments