rabbitmq: honour the console_interface fallback - #2579
Merged
Conversation
This was referenced Aug 6, 2026
berendt
force-pushed
the
stack/5-console-interface-fallback
branch
from
August 7, 2026 05:33
4158b40 to
9dfeec8
Compare
ideaship
force-pushed
the
stack/5-console-interface-fallback
branch
from
August 7, 2026 05:59
9dfeec8 to
4c6b6d6
Compare
ideaship
force-pushed
the
stack/5-console-interface-fallback
branch
from
August 7, 2026 06:54
4c6b6d6 to
343c470
Compare
berendt
force-pushed
the
stack/5-console-interface-fallback
branch
from
August 7, 2026 07:12
343c470 to
f8d63e8
Compare
berendt
force-pushed
the
stack/5-console-interface-fallback
branch
from
August 7, 2026 08:59
f8d63e8 to
90aff88
Compare
ideaship
force-pushed
the
stack/5-console-interface-fallback
branch
from
August 7, 2026 10:27
90aff88 to
4551d49
Compare
osism/defaults resolves a node's internal address as
{{ hostvars[inventory_hostname]['ansible_' +
internal_interface|default(console_interface)]['ipv4']['address'] }}
(defaults/manager/000-defaults.yml). The expression used here left the
fallback out and referenced internal_interface directly, so a host that
sets console_interface explicitly and leaves internal_interface unset --
a configuration that resolves in the deployment -- did not resolve here.
Add the fallback so the two agree.
Where neither variable is set this still fails, and loudly:
defaults/all/099-interfaces.yml defines
console_interface: "{{ internal_interface|default(loopback0) }}"
and "loopback0" is not defined as a variable anywhere in osism/defaults
(the name occurs only as an interface key in netplan and cloud-init
files), so the lookup raises "'loopback0' is undefined" rather than
returning an address that was never configured. Verified on ansible-core
2.19.11, together with the case this commit fixes: console_interface set
to a real interface and internal_interface absent now resolves to that
interface's address.
The integration suite gains the case: a host with console_interface set and
internal_interface absent, resolved against real Ansible.
Note this widens what resolves rather than narrowing it. The code that
preceded this series required internal_interface outright and skipped the
host without it.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Roger Luethi <luethi@osism.tech>
berendt
force-pushed
the
stack/5-console-interface-fallback
branch
from
August 7, 2026 11:24
4551d49 to
17fa97b
Compare
ideaship
marked this pull request as ready for review
August 7, 2026 11:40
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The unit test that asserts
internal_interface | default(console_interface)is present inINTERNAL_ADDRESS_EXPRESSIONis somewhat brittle; consider instead validating the behavior via a small evaluation of the expression (or via the helper that uses it) so refactors of the string layout don’t break the test while preserving behavior. - The Jinja expression string for
INTERNAL_ADDRESS_EXPRESSIONis now quite long and split across concatenated literals; you might consider using a single multi-line string or a helper builder function to improve readability and reduce the chance of subtle formatting mistakes in future changes.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The unit test that asserts `internal_interface | default(console_interface)` is present in `INTERNAL_ADDRESS_EXPRESSION` is somewhat brittle; consider instead validating the behavior via a small evaluation of the expression (or via the helper that uses it) so refactors of the string layout don’t break the test while preserving behavior.
- The Jinja expression string for `INTERNAL_ADDRESS_EXPRESSION` is now quite long and split across concatenated literals; you might consider using a single multi-line string or a helper builder function to improve readability and reduce the chance of subtle formatting mistakes in future changes.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
osism/defaultsresolves a node's internal address as{{ hostvars[inventory_hostname]['ansible_' + internal_interface|default(console_interface)]['ipv4']['address'] }}(
defaults/manager/000-defaults.yml). The expression used here left the fallback out and referencedinternal_interfacedirectly, so a host that setsconsole_interfaceexplicitly and leavesinternal_interfaceunset — a configuration that resolves in the deployment — did not resolve here.This adds the fallback so the two agree.
Where neither variable is set it still fails, and loudly:
defaults/all/099-interfaces.ymldefinesconsole_interface: "{{ internal_interface|default(loopback0) }}", andloopback0is not defined as a variable anywhere inosism/defaults(the name occurs only as an interface key in netplan and cloud-init files), so the lookup raises'loopback0' is undefinedrather than returning an address that was never configured.Verification. On ansible-core 2.19.11, both the case this fixes (
console_interfaceset to a real interface,internal_interfaceabsent → resolves to that interface's address) and the case it must not paper over (neither set → raises).Note this widens what resolves rather than narrowing it: the code preceding this stack required
internal_interfaceoutright and skipped the host without it.Separable — this is not needed to fix osism/issues#1425, and can be deferred or dropped without affecting the rest of the stack.
🤖 Generated with Claude Code