mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fix extra newline at end of hostname for Fedora
This fixes a bug introduced by 138b45e3
.
The hostname has an additional newline at the end which leads to the
state always being 'changed: true' even if the hostname is unchanged.
This commit is contained in:
parent
d51e10a3f4
commit
e91c318327
1 changed files with 1 additions and 1 deletions
|
@ -259,7 +259,7 @@ class FedoraStrategy(GenericStrategy):
|
||||||
if rc != 0:
|
if rc != 0:
|
||||||
self.module.fail_json(msg="Command failed rc=%d, out=%s, err=%s" %
|
self.module.fail_json(msg="Command failed rc=%d, out=%s, err=%s" %
|
||||||
(rc, out, err))
|
(rc, out, err))
|
||||||
return out
|
return out.strip()
|
||||||
|
|
||||||
def set_permanent_hostname(self, name):
|
def set_permanent_hostname(self, name):
|
||||||
cmd = ['hostnamectl', '--pretty', 'set-hostname', name]
|
cmd = ['hostnamectl', '--pretty', 'set-hostname', name]
|
||||||
|
|
Loading…
Reference in a new issue