Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update_etc_hosts broken for all distros but ubuntu #2347

Closed
ubuntu-server-builder opened this issue May 9, 2023 · 4 comments
Closed

update_etc_hosts broken for all distros but ubuntu #2347

ubuntu-server-builder opened this issue May 9, 2023 · 4 comments
Labels
launchpad Migrated from Launchpad

Comments

@ubuntu-server-builder
Copy link
Collaborator

This bug was originally filed in Launchpad as LP: #1100036

Launchpad details
affected_projects = []
assignee = craigtracey
assignee_name = Craig Tracey
date_closed = 2013-05-15T20:02:47.437080+00:00
date_created = 2013-01-15T21:34:43.536208+00:00
date_fix_committed = 2013-01-31T13:21:51.753007+00:00
date_fix_released = 2013-05-15T20:02:47.437080+00:00
id = 1100036
importance = medium
is_complete = True
lp_url = https://bugs.launchpad.net/cloud-init/+bug/1100036
milestone = None
owner = craigtracey
owner_name = Craig Tracey
private = False
status = fix_released
submitter = craigtracey
submitter_name = Craig Tracey
tags = []
duplicates = []

Launchpad user Craig Tracey(craigtracey) wrote on 2013-01-15T21:34:43.536208+00:00

Right now hosts templates are named:

  • hosts.redhat.tmpl
  • hosts.ubuntu.tmpl

As the code is written such that it calls:
tpl_fn_name = cloud.get_template_filename("hosts.%s" %
(cloud.distro.name))

This will only work for the 'ubuntu' distro.

@ubuntu-server-builder ubuntu-server-builder added the launchpad Migrated from Launchpad label May 9, 2023
@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Tomas Karasek(tomas-karasek) wrote on 2013-01-24T15:36:47.746821+00:00

Hi, I am not sure if this is alrady addressed in the fix, but if you mark distro as "rhel" in /etc/cloud/cloud.cfg:
[...]
system_info:
distro: rhel
[...]

and enable update_etc_hosts module (which is enabled by default), you get:

2013-01-24 16:15:37,362 - cloud.py[WARNING]: No template found at /etc/cloud/templates/hosts.rhel.tmpl for template named hosts.rhel
2013-01-24 16:15:37,362 - util.py[WARNING]: Running update_etc_hosts (<module 'cloudinit.config.cc_update_etc_hosts' from '/usr/lib/python2.6/site-packages/cloudinit/config/cc_update_etc_hosts.pyc'>) failed

as there is no hosts.redhat.tmpl.

When I do
ln -s /etc/cloud/templates/hosts.redhat.tmpl /etc/cloud/templates/hosts.rhel.tmpl

and re-run update_etc_hosts, then it works properly

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Craig Tracey(craigtracey) wrote on 2013-01-24T16:12:19.200270+00:00

Yes Tomas, that is correct. This fix addresses that specific problem.

Your workaround is the appropriate workaround until this fix is released.

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Scott Moser(smoser) wrote on 2013-01-31T13:21:51.300316+00:00

fixed in trunk at revno 775.

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Scott Moser(smoser) wrote on 2013-05-15T20:02:46.764865+00:00

fixed in 0.7.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
launchpad Migrated from Launchpad
Projects
None yet
Development

No branches or pull requests

1 participant