Skip to content

docs: add how to configure the correct etc hosts file with cloudinit CRD#1062

Open
Yu-Jack wants to merge 1 commit into
harvester:mainfrom
Yu-Jack:HARV-9496
Open

docs: add how to configure the correct etc hosts file with cloudinit CRD#1062
Yu-Jack wants to merge 1 commit into
harvester:mainfrom
Yu-Jack:HARV-9496

Conversation

@Yu-Jack

@Yu-Jack Yu-Jack commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

@Yu-Jack Yu-Jack self-assigned this Jun 18, 2026
@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown
Name Link
🔨 Latest commit b7ef9cb
😎 Deploy Preview https://6a3900dc78fb9946be253e0a--harvester-preview.netlify.app

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds documentation to help Harvester users correct /etc/hosts entries when using FQDN-based hostnames, using a CloudInit CRD to persist the change across reboots (per harvester/harvester#9496).

Changes:

  • Document a CloudInit-based template that rewrites the default 127.0.0.1 localhost {hostname} entry and adds a {node IP} {FQDN} {short hostname} mapping.
  • Add guidance on CloudInit execution stages (network.after vs alternatives) and filename ordering behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/host/host.md Outdated
NODE_IP=$(ip addr show mgmt-br 2>/dev/null | awk '/inet /{print $2}' | cut -d/ -f1 | head -1)
[ -z "$NODE_IP" ] && exit 0
sed -i 's/^127\.0\.0\.1.*/127.0.0.1 localhost/' /etc/hosts
grep -v "^[0-9a-f:.]\+[[:space:]]\+${FQDN}" /etc/hosts > /tmp/hosts.tmp && mv /tmp/hosts.tmp /etc/hosts
Comment thread docs/host/host.md

:::note

This template uses the `network.after` stage, which requires a reboot. If you have other custom CloudInit resources using the same stage, ensure they don't conflict. CloudInit files are executed in alphabetical order by filename.
@Yu-Jack Yu-Jack requested a review from a team June 22, 2026 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants