about summary refs log tree commit diff
diff options
context:
space:
mode:
authoraward <award@rentpath.com>2014-07-10 16:19:56 -0400
committeraward <award@rentpath.com>2014-07-10 16:19:56 -0400
commit2374853e226d43aa14d997e40a73853798634ccd (patch)
tree2aec5068f5fa0cb13cdfdf62457e1f6fab2dd600
parentAdd support for child hostgroups (diff)
downloadansible-foreman-inventory-2374853e226d43aa14d997e40a73853798634ccd.tar.gz
Add hostgroup to the host description output
-rwxr-xr-xtheforeman.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/theforeman.py b/theforeman.py
index 809bf3f..8bbd816 100755
--- a/theforeman.py
+++ b/theforeman.py
@@ -43,6 +43,7 @@ based on the data obtained from Foreman:
  - created
  - updated
  - status
+ - hostgroup
  - ansible_ssh_host
 
 When run in --list mode, instances are grouped by the following categories:
@@ -146,6 +147,7 @@ They must be specified via ini file.'''
             'created': meta.get('created_at'),
             'updated': meta.get('updated_at'),
             'status': meta.get('status'),
+            'hostgroup': self._get_hostgroup_from_id(meta.get('hostgroup_id')),
             # to ssh from ansible
             'ansible_ssh_host': meta.get('ip'),
         }