Project

General

Profile

« Previous | Next » 

Revision 6807d423

Added by Stephen Benjamin about 10 years ago

fixes #5444 - add param_false? host method and allow in templates

View differences:

app/models/concerns/host_common.rb
params.has_key?(name) && LookupKey::TRUE_VALUES.include?(params[name])
end
def param_false? name
params.has_key?(name) && LookupKey::FALSE_VALUES.include?(params[name])
end
def cg_class_ids
cg_ids = if kind_of?(Hostgroup)
path.each.map(&:config_group_ids).flatten.uniq
app/models/host/managed.rb
allow :name, :diskLayout, :puppetmaster, :puppet_ca_server, :operatingsystem, :os, :environment, :ptable, :hostgroup, :location,
:organization, :url_for_boot, :params, :info, :hostgroup, :compute_resource, :domain, :ip, :mac, :shortname, :architecture,
:model, :certname, :capabilities, :provider, :subnet, :token, :location, :organization, :provision_method,
:image_build?, :pxe_build?, :otp, :realm
:image_build?, :pxe_build?, :otp, :realm, :param_true?, :param_false?
end
attr_reader :cached_host_params
app/models/hostgroup.rb
class Jail < Safemode::Jail
allow :name, :diskLayout, :puppetmaster, :operatingsystem, :architecture,
:environment, :ptable, :url_for_boot, :params, :puppetproxy
:environment, :ptable, :url_for_boot, :params, :puppetproxy, :param_true?,
:param_false?
end
#TODO: add a method that returns the valid os for a hostgroup
lib/foreman/renderer.rb
ALLOWED_HELPERS = [ :foreman_url, :grub_pass, :snippet, :snippets,
:snippet_if_exists, :ks_console, :root_pass,
:multiboot, :jumpstart_path, :install_path, :miniroot,
:media_path, :param_true? ]
:media_path, :param_true?, :param_false? ]
ALLOWED_VARIABLES = [ :arch, :host, :osver, :mediapath, :static,
:repos, :dynamic, :kernel, :initrd,

Also available in: Unified diff