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

Hosts file update in mod_hostname. #29767

Merged
merged 1 commit into from Dec 17, 2015

Conversation

Projects
None yet
2 participants
@abednarik
Contributor

abednarik commented Dec 16, 2015

In system with systemd now you can use hostnamectl to set hostname. In this case
if hostnamectl exists mod_hostname will use it and return, leaving hosts file code
outside the scope and hosts file not properly configured.

Fixes #29751

@abednarik

This comment has been minimized.

Show comment
Hide comment
@abednarik

abednarik Dec 16, 2015

Contributor

My bad. Please let me re think this, since else condition will run even in systems with hostnamectl and we don't want to setup hostname 2 times.

Contributor

abednarik commented Dec 16, 2015

My bad. Please let me re think this, since else condition will run even in systems with hostnamectl and we don't want to setup hostname 2 times.

@abednarik

This comment has been minimized.

Show comment
Hide comment
@abednarik

abednarik Dec 16, 2015

Contributor

Now looks better. Setting hostname is done in a single block and hosts file update should be executed even in systems with systemd.

Contributor

abednarik commented Dec 16, 2015

Now looks better. Setting hostname is done in a single block and hosts file update should be executed even in systems with systemd.

@abednarik

This comment has been minimized.

Show comment
Hide comment
@abednarik

abednarik Dec 16, 2015

Contributor

Ouch, I don't understand why my commit breaks that test.

Contributor

abednarik commented Dec 16, 2015

Ouch, I don't understand why my commit breaks that test.

Hosts file update in mod_hostname.
In systems with systemd now you can use hostnamectl to set hostname. In this case
if hostnamectl exists mod_hostname will use it and return, leaving hosts file as it is,
which is a not expected behavior.
Also now setting the hostname based on commands avaiables or os are
grouped in a single block, which is cleaner I think.
Also update the way to get the current hostname using hostnamectl

Fixes #29751

cachedout added a commit that referenced this pull request Dec 17, 2015

Merge pull request #29767 from abednarik/network_mod_hpstname_fix
Hosts file update in mod_hostname.

@cachedout cachedout merged commit 9b4c219 into saltstack:2015.8 Dec 17, 2015

4 of 5 checks passed

default Merged build finished.
Details
jenkins/salt-pr-clone Salt PR - Clone Repository #12112 — SUCCESS
Details
jenkins/salt-pr-linode-ubuntu14.04-n Salt PR - Linode Ubuntu 14.04 #3176 — SUCCESS
Details
jenkins/salt-pr-lint-n Salt PR - Code Lint #11814 — SUCCESS
Details
jenkins/salt-pr-rs-cent7-n Salt PR - RS CentOS 7 #10684 — SUCCESS
Details
@cachedout

This comment has been minimized.

Show comment
Hide comment
@cachedout

cachedout Dec 17, 2015

Contributor

Thanks @abednarik

Contributor

cachedout commented Dec 17, 2015

Thanks @abednarik

@abednarik abednarik deleted the abednarik:network_mod_hpstname_fix branch Dec 17, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment