Skip to content

Container hostname change breaks unattended_url for external host registration #482

@pablomh

Description

@pablomh

Problem

Commit 4ef4632 ("use shorter internal hostnames for the pulp containers")
changed the Foreman container hostname from {{ ansible_facts['fqdn'] }} to
{{ ansible_facts['hostname'] }}.local for all containers, including the
Foreman application containers.

Foreman derives the unattended_url setting from the container's internal
hostname. After this change, unattended_url becomes http://satellite.local
instead of https://satellite.example.com, causing the Host initial configuration template to generate callbacks to an unreachable hostname.

Symptoms

All hosts register successfully via subscription-manager (POST /rhsm/consumers
works), but fail at the host init phase with:

ERROR: Host [hostname] configured, but failed to report status to Foreman.

The generated /root/registration_host_init.sh contains:

curl https://satellite.local/unattended/built?token=...

which is unreachable from external hosts.

Impact

  • All host registrations using the global registration template fail
    at the host init callback phase
  • CI does not catch this because it does not test the full registration
    flow with host init template execution
  • Workaround: hammer settings set --name unattended_url --value "https://$(hostname -f)"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions