rabbitmq: honour the console_interface fallback - #2579
Draft
ideaship wants to merge 1 commit into
Draft
Conversation
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>
This was referenced Aug 6, 2026
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