-
-
Save stbenjam/eb523feb1a1d71d7a3af to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def exend_data(data) | |
# Get osrelease fact: | |
host_id = data['id'] | |
hostname = data['name'] | |
all_facts = HammerCLIForeman.foreman_resource!(:fact_values).call(:index, :host_id => host_id, :per_page => 99999) | |
data['osrelease_fact'] = all_facts['results'][hostname]['osrelease'] | |
# Get my_param parameter | |
param = data['parameters'].find { |param| param['name'] == 'my_param' } | |
data['myparam_param'] = param['value'] | |
data | |
end | |
output do | |
field :osrelease_fact, _('OS Release') | |
field :myparam_param, _('My Param') | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment