1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Add domainname to ansible facts

This commit is contained in:
Serge van Ginderachter 2012-10-28 12:02:35 +01:00 committed by Michael DeHaan
parent f0000a89b0
commit 1db563e064

View file

@ -107,6 +107,7 @@ class Facts(object):
self.facts['python_version'] = platform.python_version() self.facts['python_version'] = platform.python_version()
self.facts['fqdn'] = socket.getfqdn() self.facts['fqdn'] = socket.getfqdn()
self.facts['hostname'] = self.facts['fqdn'].split('.')[0] self.facts['hostname'] = self.facts['fqdn'].split('.')[0]
self.facts['domainname'] = '.'.join(self.facts['fqdn'].split('.')[1:])
if self.facts['machine'] == 'x86_64': if self.facts['machine'] == 'x86_64':
self.facts['architecture'] = self.facts['machine'] self.facts['architecture'] = self.facts['machine']
elif Facts._I386RE.search(self.facts['machine']): elif Facts._I386RE.search(self.facts['machine']):