mirror of
https://github.com/DO1JLR/ansible_linux_desktop_setup.git
synced 2024-09-14 19:54:51 +02:00
update inventory creation
This commit is contained in:
parent
55a693da86
commit
7b3c17136a
1 changed files with 5 additions and 2 deletions
|
@ -10,7 +10,7 @@ import json
|
||||||
# create a dict to match hostnames to enviroments
|
# create a dict to match hostnames to enviroments
|
||||||
env_dict = {
|
env_dict = {
|
||||||
'work':
|
'work':
|
||||||
['workstation.local'],
|
['workstation.local', 'daringdoo.local'],
|
||||||
'private':
|
'private':
|
||||||
['derpy.local', 'applejack.local']
|
['derpy.local', 'applejack.local']
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,10 @@ def fqdn():
|
||||||
"""
|
"""
|
||||||
return fully qualified domain name
|
return fully qualified domain name
|
||||||
"""
|
"""
|
||||||
return socket.getfqdn()
|
hostname = socket.gethostname()
|
||||||
|
if '.' not in hostname:
|
||||||
|
hostname = f"{hostname}.local"
|
||||||
|
return str(hostname)
|
||||||
|
|
||||||
def env(domain):
|
def env(domain):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in a new issue