1
0
Fork 0
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:
L3D 2022-07-06 18:13:26 +02:00
parent 55a693da86
commit 7b3c17136a
Signed by: l3d
GPG key ID: CD08445BFF4313D1

View file

@ -10,7 +10,7 @@ import json
# create a dict to match hostnames to enviroments
env_dict = {
'work':
['workstation.local'],
['workstation.local', 'daringdoo.local'],
'private':
['derpy.local', 'applejack.local']
}
@ -19,7 +19,10 @@ def fqdn():
"""
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):
"""