mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Merge branch 'obsd-network' of https://github.com/ajacoutot/salt into ajacoutot-obsd-network
This commit is contained in:
commit
78705f339c
@ -418,7 +418,12 @@ def arp():
|
|||||||
comps = line.split()
|
comps = line.split()
|
||||||
if len(comps) < 4:
|
if len(comps) < 4:
|
||||||
continue
|
continue
|
||||||
ret[comps[3]] = comps[1].strip('(').strip(')')
|
if not __grains__['kernel'] == 'OpenBSD':
|
||||||
|
ret[comps[3]] = comps[1].strip('(').strip(')')
|
||||||
|
else:
|
||||||
|
if comps[0] == 'Host' or comps[1] == '(incomplete)':
|
||||||
|
continue
|
||||||
|
ret[comps[1]] = comps[0]
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
||||||
@ -611,6 +616,9 @@ def mod_hostname(hostname):
|
|||||||
elif __grains__['os_family'] == 'Debian':
|
elif __grains__['os_family'] == 'Debian':
|
||||||
with salt.utils.fopen('/etc/hostname', 'w') as fh:
|
with salt.utils.fopen('/etc/hostname', 'w') as fh:
|
||||||
fh.write(hostname + '\n')
|
fh.write(hostname + '\n')
|
||||||
|
elif __grains__['os_family'] == 'OpenBSD':
|
||||||
|
with salt.utils.fopen('/etc/myname', 'w') as fh:
|
||||||
|
fh.write(hostname + '\n')
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user