Add update_etc_hosts as default module on *BSD#479
Conversation
|
Here is boot log ( Here is content of It match to template of |
|
Here's the current of FreeBSD's note the preference of IPv6 and IPv4 is now reversed. unrelatedly, what's up with those |
Yes, I will update source branch. I would like to point out that my knowledge of the FreeBSD environment is limited and I am asking for limited confidence.
Mount errors is regarding datasource discovery here: https://github.com/canonical/cloud-init/blob/master/cloudinit/sources/DataSourceRbxCloud.py#L81-L85 I works for RbxCloud and will be happy to optimize the process if you have suggestions. |
https://github.com/NetBSD/src/blob/HEAD/etc/hosts ← NetBSD is the same
nah, let's leave this for now |
I have no experience in NetBSD. I fully trust your comments. |
| - update_hostname | ||
| {% if variant not in ["freebsd", "netbsd"] %} | ||
| - update_etc_hosts | ||
| {% if variant.endswith("bsd") %} |
There was a problem hiding this comment.
I think the logic here needs inverting (to match its previous state); we should emit these lines only if we are not on BSD, right?
There was a problem hiding this comment.
@ad-m It was only this line that needed updating, to match the previous meaning. We are generalising variant not in [...] so this should be:
| {% if variant.endswith("bsd") %} | |
| {% if not variant.endswith("bsd") %} |
OddBloke
left a comment
There was a problem hiding this comment.
Thanks for looking at this! I have one inline comment.
Co-authored-by: Mina Galić (deprecated: Igor Galić) <me+github@igalic.co>
OddBloke
left a comment
There was a problem hiding this comment.
This still needs work; I've tried rephrasing my suggestion(s), let me know if you need further clarification!
| - update_hostname | ||
| {% if variant not in ["freebsd", "netbsd"] %} | ||
| - update_etc_hosts | ||
| {% if variant.endswith("bsd") %} |
There was a problem hiding this comment.
@ad-m It was only this line that needed updating, to match the previous meaning. We are generalising variant not in [...] so this should be:
| {% if variant.endswith("bsd") %} | |
| {% if not variant.endswith("bsd") %} |
| preserve_hostname: false | ||
|
|
||
| {% if variant.endswith("bsd") %} | ||
| {% if not variant.endswith("bsd") %} |
There was a problem hiding this comment.
This is incorrect; this stanza is only present to workaround issues seen on BSDs, so it should only be emitted under the condition that was already here.
(If the issue you were fixing was that RbxCloud wasn't being found on *BSD, then you'll want to add it to the datasource_list that this if clause guards.)
|
@OddBloke, Sorry, I corrected the wrong line quickly from the editor. When I saw error , you were able to publish post with new comments before I pushed the rebased changes. |
No worries, thanks for the updates! |
If I understand correctly, Cloud-init adopts the default configuration to run all supported modules on a given distro. For unknown reasons, the update_etc_hosts module does not run on FreeBSD and NetBSD, although:
update_etc_hostshas sense and retains functionality,update_etc_hostsis working on the platform, in accordance with its documentation and manual tests.In our environment, we assume that all images should have
/etc/hostsfile managed by default. FreeBSD is an exception due default Cloud-init config.According Git history @goneri provided recently support for NetBSD and follow that configuration, so I ask him for review.
This distinction has been made to this configuration file in a change 41d46bf but that patch follow earlier configuration file
https://github.com/canonical/cloud-init/blob/e7c95208451422cfd3da7edfbd67dd271e7aa337/config/cloud.cfg-freebsd which turned it off in the patch c36d755. However, assumptions behind disable this module no longer seem valid.