Class: ManageIQ::ApplianceConsole::ContainersConfiguration
- Inherits:
-
Object
- Object
- ManageIQ::ApplianceConsole::ContainersConfiguration
- Includes:
- ManageiqUserMixin, Prompts
- Defined in:
- lib/manageiq/appliance_console/containers_configuration.rb
Constant Summary collapse
- CONTAINERS_ROOT_DIR =
Pathname.new("/var/lib/manageiq/containers").freeze
- CONTAINERS_VOL_NAME =
"miq_containers".freeze
Constants included from Prompts
Prompts::CLEAR_CODE, Prompts::DOMAIN_REGEXP, Prompts::HOSTNAME_REGEXP, Prompts::INT_REGEXP, Prompts::IPV4_REGEXP, Prompts::IPV6_REGEXP, Prompts::IP_REGEXP, Prompts::MESSAGING_HOSTNAME_REGEXP, Prompts::MESSAGING_PASSWORD_REGEXP, Prompts::NONE_REGEXP
Instance Attribute Summary collapse
-
#disk ⇒ Object
Returns the value of attribute disk.
-
#image ⇒ Object
Returns the value of attribute image.
-
#registry_authfile ⇒ Object
Returns the value of attribute registry_authfile.
-
#registry_certdir ⇒ Object
Returns the value of attribute registry_certdir.
-
#registry_password ⇒ Object
Returns the value of attribute registry_password.
-
#registry_tls_verify ⇒ Object
Returns the value of attribute registry_tls_verify.
-
#registry_uri ⇒ Object
Returns the value of attribute registry_uri.
-
#registry_username ⇒ Object
Returns the value of attribute registry_username.
Instance Method Summary collapse
- #activate ⇒ Object
- #ask_questions ⇒ Object
-
#initialize(options = {}) ⇒ ContainersConfiguration
constructor
A new instance of ContainersConfiguration.
Methods included from ManageiqUserMixin
#manageiq_gid, #manageiq_uid, #run_as_manageiq!
Methods included from Prompts
#are_you_sure?, #ask_for_disk, #ask_for_domain, #ask_for_hostname, #ask_for_hour_number, #ask_for_integer, #ask_for_ip, #ask_for_ip_or_hostname, #ask_for_ip_or_hostname_or_none, #ask_for_many, #ask_for_messaging_hostname, #ask_for_messaging_password, #ask_for_month_day_number, #ask_for_new_password, #ask_for_password, #ask_for_schedule_frequency, #ask_for_string, #ask_for_uri, #ask_for_week_day_number, #ask_with_menu, #ask_yn?, #clear_screen, #default_to_index, #just_ask, #press_any_key
Constructor Details
#initialize(options = {}) ⇒ ContainersConfiguration
Returns a new instance of ContainersConfiguration.
16 17 18 19 20 21 22 23 24 |
# File 'lib/manageiq/appliance_console/containers_configuration.rb', line 16 def initialize( = {}) self.registry_uri = [:container_registry_uri] self.registry_username = [:container_registry_username] self.registry_password = [:container_registry_password] self.registry_authfile = [:container_registry_authfile] self.registry_tls_verify = [:conatiner_registry_tls_verify] self.image = [:container_image] self.disk = [:disk] end |
Instance Attribute Details
#disk ⇒ Object
Returns the value of attribute disk.
12 13 14 |
# File 'lib/manageiq/appliance_console/containers_configuration.rb', line 12 def disk @disk end |
#image ⇒ Object
Returns the value of attribute image.
12 13 14 |
# File 'lib/manageiq/appliance_console/containers_configuration.rb', line 12 def image @image end |
#registry_authfile ⇒ Object
Returns the value of attribute registry_authfile.
12 13 14 |
# File 'lib/manageiq/appliance_console/containers_configuration.rb', line 12 def registry_authfile @registry_authfile end |
#registry_certdir ⇒ Object
Returns the value of attribute registry_certdir.
12 13 14 |
# File 'lib/manageiq/appliance_console/containers_configuration.rb', line 12 def registry_certdir @registry_certdir end |
#registry_password ⇒ Object
Returns the value of attribute registry_password.
12 13 14 |
# File 'lib/manageiq/appliance_console/containers_configuration.rb', line 12 def registry_password @registry_password end |
#registry_tls_verify ⇒ Object
Returns the value of attribute registry_tls_verify.
12 13 14 |
# File 'lib/manageiq/appliance_console/containers_configuration.rb', line 12 def registry_tls_verify @registry_tls_verify end |
#registry_uri ⇒ Object
Returns the value of attribute registry_uri.
12 13 14 |
# File 'lib/manageiq/appliance_console/containers_configuration.rb', line 12 def registry_uri @registry_uri end |
#registry_username ⇒ Object
Returns the value of attribute registry_username.
12 13 14 |
# File 'lib/manageiq/appliance_console/containers_configuration.rb', line 12 def registry_username @registry_username end |
Instance Method Details
#activate ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/manageiq/appliance_console/containers_configuration.rb', line 34 def activate activate_new_disk if disk activate_registry_login if registry_uri activate_image_pull if image true rescue AwesomeSpawn::CommandResultError => e say(e.result.output) say(e.result.error) say("") false end |
#ask_questions ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/manageiq/appliance_console/containers_configuration.rb', line 26 def ask_questions clear_screen choose_disk if use_new_disk? choose_container_registry if authenticate_container_registry? choose_container_image if pull_container_image? confirm_selection end |