Class: HttpdConfigmapGenerator::Export

Inherits:
Base
  • Object
show all
Defined in:
lib/httpd_configmap_generator/export.rb

Constant Summary

Constants inherited from Base

Base::APACHE_USER, Base::HOSTNAME_COMMAND, Base::HTTP_KEYTAB, Base::IPA_COMMAND, Base::KERBEROS_CONFIG_FILE, Base::LDAP_ATTRS, Base::PAM_CONFIG, Base::SSSD_CONFIG, Base::TIMESTAMP_FORMAT

Instance Attribute Summary

Attributes inherited from Base

#opts

Instance Method Summary collapse

Methods inherited from Base

#command_run, #command_run!, #config_file_backup, #configure_pam, #cp_template, #create_target_directory, #debug_msg, #delete_target_file, #domain, #domain_from_host, #enable_kerberos_dns_lookups, #err_msg, #fetch_network_file, #file_binary?, #host_reachable?, #info_msg, #initialize, #log_command_error, #optional_options, #path_join, #realm, #rm_file, #run_configure, #template_directory, #update_hostname

Constructor Details

This class inherits a constructor from HttpdConfigmapGenerator::Base

Instance Method Details

#export(opts) ⇒ Object



14
15
16
17
18
19
20
21
22
23
# File 'lib/httpd_configmap_generator/export.rb', line 14

def export(opts)
  validate_options(opts)
  @opts = opts
  config_map = ConfigMap.new(opts)
  config_map.load(opts[:input])
  config_map.export_file(opts[:file], opts[:output])
rescue => err
  log_command_error(err)
  raise err
end

#required_optionsObject



3
4
5
6
7
8
9
10
11
12
# File 'lib/httpd_configmap_generator/export.rb', line 3

def required_options
  {
    :input  => { :description => "Input config map file",
                 :short       => "-i" },
    :file   => { :description => "Config map file to export",
                 :short       => "-l" },
    :output => { :description => "The output file being exported",
                 :short       => "-o" }
  }
end