# File lib/simp/cli/config/items/item.rb, line 27 def initialize(key = nil, description = nil) @key = key # answers file key for the config Item @value = nil # value (decided by user) @description = description # A text description of the Item @data_type = :global_hiera # :internal = parameter used within simp config, # but not persisted anywhere # :cli_params = parameter persisted to answers YAML # file for use by simp config # :global_hiera = parameter persisted to hieradata YAML # file for use by SIMP clients # and server # :global_class = class added to class list in # hieradata YAML file for use # by SIMP clients and server # :server_hiera = parameter persisted to hieradata YAML # file for use by SIMP server @fact = nil # Facter fact to query OS value @start_time = nil # time at which simp config started; use for backup timestamp @applied_status = nil # status of an applied change, as appropriate @applied_time = nil # time at which applied change completed @applied_detail = nil # details about the apply to be conveyed to user @skip_query = false # skip the query and use the default_value @skip_apply = false # skip the apply @skip_apply_reason = nil # optional description of reason for skipping the apply @skip_yaml = false # skip yaml output @silent = false # no output to stdout/Highline/log @die_on_apply_fail = false # halt simp config if apply fails @allow_user_apply = false # allow non-superuser to apply @fail_on_missing_answer = false # error out if @value is not pre-populated possible_module_paths = [ '/usr/share/simp/modules', '/etc/puppetlabs/code/environments/simp/modules', '/etc/puppet/environments/simp/modules' ] possible_module_paths.each do |modpath| if File.directory?(modpath) @puppet_apply_cmd = "puppet apply --modulepath=#{modpath} " break end end @puppet_apply_cmd ||= 'puppet apply ' @config_items = {} # a hash of all previous Config::Items # a Hash of additional Items whose value this Item may need to use. # The keys of the Hash are used to look up the queue # format: # 'answer1' => [ Item1, Item2, .. ] # 'answer2' => [ Item3, Item4, .. ] @next_items_tree = {} end