Class: DInstaller::CockpitManager
- Inherits:
-
Object
- Object
- DInstaller::CockpitManager
- Includes:
- Yast::I18n, Yast::Logger, Yast::Transfer::FileFromUrl
- Defined in:
- lib/dinstaller/cockpit_manager.rb
Overview
Handles the Cockpit service
This API offers an API to adjust Cockpit configuration and restart/reload the process. At this point, just a few options are allowed (@see #setup).
Constant Summary collapse
- WS_CERTS_DIR =
Directory to store Cockpit certificates
"/etc/cockpit/ws-certs.d"
- COCKPIT_SERVICE =
"cockpit"
- COCKPIT_CONF_PATH =
"/etc/cockpit/cockpit.conf"
Instance Method Summary collapse
-
#initialize(logger, prefix: "/") ⇒ CockpitManager
constructor
A new instance of CockpitManager.
-
#setup(options) ⇒ Object
Adjust Cockpit configuration and restart the process if needed.
Constructor Details
#initialize(logger, prefix: "/") ⇒ CockpitManager
Returns a new instance of CockpitManager.
72 73 74 75 |
# File 'lib/dinstaller/cockpit_manager.rb', line 72 def initialize(logger, prefix: "/") @prefix = prefix @logger = logger end |
Instance Method Details
#setup(options) ⇒ Object
Adjust Cockpit configuration and restart the process if needed
If all arguments are nil, the configuration is not modified and the process is not restarted.
85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/dinstaller/cockpit_manager.rb', line 85 def setup() return if .values.all?(&:nil?) enable_ssl(["ssl"]) unless ["ssl"].nil? if ["ssl_cert"] copy_ssl_cert(["ssl_cert"]) copy_ssl_key(["ssl_key"]) unless ["ssl_key"].nil? clear_self_signed_cert end restart_cockpit end |