-
Notifications
You must be signed in to change notification settings - Fork 20
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
Hostname doesn't persist after reboot on EC2 rhel7 #47
Comments
The search_file_replace_line for
edit: Nevermind...it seems to skip that |
@fletchowns DHCP could generally still be a problem in terms of persisting a hostname. I think the main problem here though is Red Hat's lack of documentation for |
Right on, makes sense. For now I just wanted to get it working so I tried: file "/etc/sysconfig/network" do
mode "0644"
content "NETWORKING=yes\nNOZEROCONF=yes\nHOSTNAME=#{Chef::Config[:node_name]}.#{node["system"]["domain_name"]}"
end I could see it make the change in my converge log:
I didn't see anything else touching |
I would not be surprised if that is a DHCP renew doing that. As far as I can see The other general issue here is overlap with
|
As far as I can see, cloud-init only does
|
Not exactly having much like. Trying everything and still not persisting. This includes:
|
Ok it does look like cloud-init's |
Thank you for looking at this, really appreciate it! |
@fletchowns no worries - would you be around next couple of hours to test new provider file before I commit and push? |
@flaccid yup definitely, I'll be online and available for the next 8 hours or so |
Ok great! I have emailed you this working copy I'm playing with atm. I'm also on freenode IRC as flaccid. Let's see if we can get it nice for a merge and then new release. |
- always set HOSTNAME in /etc/sysconfig/network if the config file exists - do not run domainname if the domainname is already as desired - configure preserve_hostname with cloud-init if cloud-init is installed - update hostname with nmcli if installed - restart systemd-hostnamed if enabled
Patch release unleashed, https://github.com/xhost-cookbooks/system/releases/tag/v0.11.1. |
This was with the Redhat 7.2 AMI on AWS. Seems as though there might be some special considerations for rhel7 on EC2: https://aws.amazon.com/premiumsupport/knowledge-center/linux-static-hostname-rhel7-centos7/
The text was updated successfully, but these errors were encountered: