manageiq-appliance_console 10.0.1 → 11.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 24e2e6f70a0eec283a0bd96905cc7c5d762a570b68f9b0995bf6001cb7ac53b8
4
- data.tar.gz: 3e3f200832cd8a85d52deacf3a2fd695126e80b68e602c02eec6cda20bd58123
3
+ metadata.gz: 83413224da39d38ff2e7bf9b23bf07e72ff94707e0a3f7e0eac38d97e68f9d7f
4
+ data.tar.gz: 3279a7297f81051f6c6c24cca1ee43453ecbeb572d036962b68eaab9832be03d
5
5
  SHA512:
6
- metadata.gz: 07d6cf765043b8d5df50e8d8de87c1d7942e630cb958a89e8489ac7b42951d620944515e4d0bb438455aebd1b14fdb4428ac6434699f4c47617a029591d961f3
7
- data.tar.gz: fdbba2254917061b5e05c13704b43e663a29615fea464c723d413d6a12cfd5839e50c4738fc73b753d98e465a0283a73db1c53f563f64abe7272fb6641ea07db
6
+ metadata.gz: a1f7eb0db244889910d2508881ca3ba8f777b8c2de2816986f8e62405dca372305da9a139d4ef778c24017b4de549dd285630f533b55d099c8c0a30e1416c14f
7
+ data.tar.gz: ad1659abd5e7553cd12980fd6e547f0c89dee006e524db84c0973ee1ab0ea24d35c9d481716975f15630b699527bed16949b099666a4d92f5b00182cd008cd82
@@ -1,21 +1,30 @@
1
- ---
2
1
  name: CI
3
2
  on:
4
- push:
5
3
  pull_request:
4
+ push:
5
+ branches-ignore:
6
+ - dependabot/*
7
+ - renovate/*
6
8
  schedule:
7
9
  - cron: 0 0 * * 0
10
+ workflow_dispatch:
11
+ concurrency:
12
+ group: "${{ github.workflow }}-${{ github.ref }}"
13
+ cancel-in-progress: true
14
+ permissions:
15
+ contents: read
8
16
  jobs:
9
17
  ci:
10
18
  runs-on: ubuntu-latest
11
19
  strategy:
12
20
  matrix:
13
21
  ruby-version:
14
- - '3.1'
22
+ - '3.2'
15
23
  - '3.3'
24
+ - '3.4'
16
25
  rails-version:
17
- - '7.0'
18
- - '7.1'
26
+ - '7.2'
27
+ - '8.0'
19
28
  services:
20
29
  postgres:
21
30
  image: manageiq/postgresql:13
@@ -23,17 +32,15 @@ jobs:
23
32
  POSTGRESQL_USER: root
24
33
  POSTGRESQL_PASSWORD: smartvm
25
34
  POSTGRESQL_DATABASE: vmdb_test
26
- options: "--health-cmd pg_isready --health-interval 2s --health-timeout 5s
27
- --health-retries 5"
35
+ options: "--health-cmd pg_isready --health-interval 2s --health-timeout 5s --health-retries 5"
28
36
  ports:
29
37
  - 5432:5432
30
38
  env:
31
39
  PGHOST: localhost
32
40
  PGPASSWORD: smartvm
33
- TEST_RAILS_VERSION: ${{ matrix.rails-version }}
34
- CC_TEST_REPORTER_ID: "${{ secrets.CC_TEST_REPORTER_ID }}"
41
+ TEST_RAILS_VERSION: "${{ matrix.rails-version }}"
35
42
  steps:
36
- - uses: actions/checkout@v4
43
+ - uses: actions/checkout@v6
37
44
  - name: Set up Ruby
38
45
  uses: ruby/setup-ruby@v1
39
46
  with:
@@ -41,7 +48,3 @@ jobs:
41
48
  bundler-cache: true
42
49
  - name: Run tests
43
50
  run: bundle exec rake
44
- - name: Report code coverage
45
- if: ${{ github.ref == 'refs/heads/master' && matrix.ruby-version == '3.3' && matrix.rails-version == '7.1' }}
46
- continue-on-error: true
47
- uses: paambaati/codeclimate-action@v9
data/CHANGELOG.md CHANGED
@@ -4,8 +4,23 @@ This project adheres to [Semantic Versioning](http://semver.org/).
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [11.0.0] - 2026-01-22
8
+ ### Added
9
+ - Add support for Rails 8 [[#297](https://github.com/ManageIQ/manageiq-appliance_console/pull/297)]
10
+ - Add options to authenticate to a container registry and pull an image [[#282](https://github.com/ManageIQ/manageiq-appliance_console/pull/282)]
11
+ - Add support for Rails 7.2 and Ruby 3.4 [[#284](https://github.com/ManageIQ/manageiq-appliance_console/pull/284)]
12
+ - Add option to use a dedicated volume for containers [[#281](https://github.com/ManageIQ/manageiq-appliance_console/pull/281)]
13
+
14
+ ### Removed
15
+ - Drop Ruby 3.1 and Rails 7.1 [[#297](https://github.com/ManageIQ/manageiq-appliance_console/pull/297)]
16
+ - Drop CodeClimate [[#296](https://github.com/ManageIQ/manageiq-appliance_console/pull/296)]
17
+
18
+ ## [10.0.2] - 2025-05-08
19
+ ### Changed
20
+ - Remove ping of IPA Server [[#278](https://github.com/ManageIQ/manageiq-appliance_console/pull/278)]
21
+
7
22
  ## [10.0.1] - 2024-11-27
8
- ## Changed
23
+ ### Changed
9
24
  - Readline does not work with ruby 3.3 [[#270](https://github.com/ManageIQ/manageiq-appliance_console/pull/270)]
10
25
 
11
26
  ## [10.0.0] - 2024-11-19
@@ -303,7 +318,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
303
318
 
304
319
  ## [1.0.0] - 2017-10-19
305
320
 
306
- [Unreleased]: https://github.com/ManageIQ/manageiq-appliance_console/compare/v10.0.1...HEAD
321
+ [Unreleased]: https://github.com/ManageIQ/manageiq-appliance_console/compare/v11.0.0...HEAD
322
+ [11.0.0]: https://github.com/ManageIQ/manageiq-appliance_console/compare/v10.0.2...v11.0.0
323
+ [10.0.2]: https://github.com/ManageIQ/manageiq-appliance_console/compare/v10.0.1...v10.0.2
307
324
  [10.0.1]: https://github.com/ManageIQ/manageiq-appliance_console/compare/v10.0.0...v10.0.1
308
325
  [10.0.0]: https://github.com/ManageIQ/manageiq-appliance_console/compare/v9.1.1...v10.0.0
309
326
  [9.1.1]: https://github.com/ManageIQ/manageiq-appliance_console/compare/v9.1.0...v9.1.1
data/Gemfile CHANGED
@@ -5,10 +5,10 @@ gemspec
5
5
 
6
6
  minimum_version =
7
7
  case ENV['TEST_RAILS_VERSION']
8
- when "7.0"
9
- "~>7.0.8"
8
+ when "8.0"
9
+ "~>8.0.4"
10
10
  else
11
- "~>6.1.4"
11
+ "~>7.2.3"
12
12
  end
13
13
 
14
14
  gem "activerecord", minimum_version
data/README.md CHANGED
@@ -1,9 +1,7 @@
1
1
  # ManageIQ::ApplianceConsole
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/manageiq-appliance_console.svg)](http://badge.fury.io/rb/manageiq-appliance_console)
4
- [![CI](https://github.com/ManageIQ/manageiq-appliance_console/actions/workflows/ci.yaml/badge.svg)](https://github.com/ManageIQ/manageiq-appliance_console/actions/workflows/ci.yaml)
5
- [![Code Climate](https://codeclimate.com/github/ManageIQ/manageiq-appliance_console.svg)](https://codeclimate.com/github/ManageIQ/manageiq-appliance_console)
6
- [![Test Coverage](https://codeclimate.com/github/ManageIQ/manageiq-appliance_console/badges/coverage.svg)](https://codeclimate.com/github/ManageIQ/manageiq-appliance_console/coverage)
4
+ [![CI](https://github.com/ManageIQ/manageiq-appliance_console/actions/workflows/ci.yaml/badge.svg?branch=master)](https://github.com/ManageIQ/manageiq-appliance_console/actions/workflows/ci.yaml)
7
5
 
8
6
  [![Chat](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ManageIQ/manageiq-appliance_console?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
9
7
 
@@ -382,6 +382,18 @@ To modify the configuration, use a web browser to access the management page.
382
382
  say("Failover Monitor Service configured successfully")
383
383
  press_any_key
384
384
 
385
+ when I18n.t("advanced_settings.containers_config")
386
+ say("#{selection}\n\n")
387
+ containers_config = ManageIQ::ApplianceConsole::ContainersConfiguration.new
388
+ if containers_config.ask_questions && containers_config.activate
389
+ say("Containers configuration configured")
390
+ press_any_key
391
+ else
392
+ say("Containers configuration unchanged")
393
+ press_any_key
394
+ raise MiqSignalError
395
+ end
396
+
385
397
  when I18n.t("advanced_settings.log_config")
386
398
  say("#{selection}\n\n")
387
399
  log_config = ManageIQ::ApplianceConsole::LogfileConfiguration.new
@@ -81,6 +81,18 @@ module ApplianceConsole
81
81
  options[:logdisk]
82
82
  end
83
83
 
84
+ def containers_disk?
85
+ options[:containers_storage_disk]
86
+ end
87
+
88
+ def container_registry?
89
+ options[:container_registry_uri]
90
+ end
91
+
92
+ def container_pull_image?
93
+ options[:container_pull_image]
94
+ end
95
+
84
96
  def extauth_opts?
85
97
  options[:extauth_opts]
86
98
  end
@@ -155,72 +167,79 @@ module ApplianceConsole
155
167
  self.options = Optimist.options(args) do
156
168
  banner "Usage: appliance_console_cli [options]"
157
169
 
158
- opt :host, "/etc/hosts name", :type => :string, :short => 'H'
159
- opt :region, "Region Number", :type => :integer, :short => "r"
160
- opt :internal, "Internal Database", :short => 'i'
161
- opt :hostname, "Database Hostname", :type => :string, :short => 'h'
162
- opt :port, "Database Port", :type => :integer, :default => 5432
163
- opt :username, "Database Username", :type => :string, :short => 'U', :default => "root"
164
- opt :password, "Database Password", :type => :string, :short => "p"
165
- opt :dbname, "Database Name", :type => :string, :short => "d", :default => "vmdb_production"
166
- opt :local_file, "Source/Destination file for DB dump/backup/restore", :type => :string, :shoft => "l"
167
- opt :dump, "Perform a pg-dump"
168
- opt :backup, "Perform a pg-basebackup"
169
- opt :restore, "Restore a database dump/backup"
170
- opt :standalone, "Run this server as a standalone database server", :type => :bool, :short => 'S'
171
- opt :key, "Create encryption key", :type => :boolean, :short => "k"
172
- opt :fetch_key, "SSH host with encryption key", :type => :string, :short => "K"
173
- opt :force_key, "Forcefully create encryption key", :type => :boolean, :short => "f"
174
- opt :sshlogin, "SSH login", :type => :string, :default => "root"
175
- opt :sshpassword, "SSH password", :type => :string
176
- opt :replication, "Configure database replication as primary or standby", :type => :string, :short => :none
177
- opt :primary_host, "Primary database host IP address", :type => :string, :short => :none
178
- opt :standby_host, "Standby database host IP address", :type => :string, :short => :none
179
- opt :auto_failover, "Configure Replication Manager (repmgrd) for automatic failover", :type => :bool, :short => :none
180
- opt :cluster_node_number, "Database unique cluster node number", :type => :integer, :short => :none
181
- opt :verbose, "Verbose", :type => :boolean, :short => "v"
182
- opt :dbdisk, "Database Disk Path", :type => :string
183
- opt :logdisk, "Log Disk Path", :type => :string
184
- opt :tmpdisk, "Temp storage Disk Path", :type => :string
185
- opt :uninstall_ipa, "Uninstall IPA Client", :type => :boolean, :default => false
186
- opt :ipaserver, "IPA Server FQDN", :type => :string
187
- opt :ipaprincipal, "IPA Server principal", :type => :string, :default => "admin"
188
- opt :ipapassword, "IPA Server password", :type => :string
189
- opt :ipadomain, "IPA Server domain (optional)", :type => :string
190
- opt :iparealm, "IPA Server realm (optional)", :type => :string
191
- opt :ca, "CA name used for certmonger", :type => :string, :default => "ipa"
192
- opt :http_cert, "install certs for http server", :type => :boolean
193
- opt :extauth_opts, "External Authentication Options", :type => :string
194
- opt :saml_config, "Configure Appliance for SAML Authentication", :type => :boolean, :default => false
195
- opt :saml_client_host, "Optional Appliance host used for SAML registration", :type => :string
196
- opt :saml_idp_metadata, "The file path or URL of the SAML IDP Metadata", :type => :string
197
- opt :saml_enable_sso, "Optionally enable SSO with SAML Authentication", :type => :boolean, :default => false
198
- opt :saml_unconfig, "Unconfigure Appliance SAML Authentication", :type => :boolean, :default => false
199
- opt :oidc_config, "Configure Appliance for OpenID-Connect Authentication", :type => :boolean, :default => false
200
- opt :oidc_url, "The OpenID-Connect Provider URL", :type => :string
201
- opt :oidc_client_host, "Optional Appliance host used for OpenID-Connect Authentication", :type => :string
202
- opt :oidc_client_id, "The OpenID-Connect Provider Client ID", :type => :string
203
- opt :oidc_client_secret, "The OpenID-Connect Provider Client Secret", :type => :string
204
- opt :oidc_insecure, "OpenID-Connect Insecure No SSL Verify (development)", :type => :boolean, :default => false
205
- opt :oidc_introspection_endpoint, "The OpenID-Connect Provider Introspect Endpoint", :type => :string
206
- opt :oidc_enable_sso, "Optionally enable SSO with OpenID-Connect Authentication", :type => :boolean, :default => false
207
- opt :oidc_unconfig, "Unconfigure Appliance OpenID-Connect Authentication", :type => :boolean, :default => false
208
- opt :server, "{start|stop|restart} actions on evmserverd Server", :type => :string
209
- opt :openscap, "Setup OpenScap", :type => :boolean, :default => false
210
- opt :message_server_config, "Subcommand to Configure Appliance as a Kafka Message Server", :type => :boolean, :default => false
211
- opt :message_server_unconfig, "Subcommand to Unconfigure Appliance as a Kafka Message Server", :type => :boolean, :default => false
212
- opt :message_client_config, "Subcommand to Configure Appliance as a Kafka Message Client", :type => :boolean, :default => false
213
- opt :message_client_unconfig, "Subcommand to Unconfigure Appliance as a Kafka Message Client", :type => :boolean, :default => false
214
- opt :message_keystore_username, "Message Server Keystore Username", :type => :string
215
- opt :message_keystore_password, "Message Server Keystore Password", :type => :string
216
- opt :message_server_username, "Message Server Username", :type => :string
217
- opt :message_server_password, "Message Server password", :type => :string
218
- opt :message_server_port, "Message Server Port", :type => :integer
219
- opt :message_server_use_ipaddr, "Deprecated: Message Server Use Address", :type => :boolean, :default => false
220
- opt :message_server_host, "Message Server Hostname or IP Address", :type => :string
221
- opt :message_truststore_path_src, "Message Server Truststore Path", :type => :string
222
- opt :message_ca_cert_path_src, "Message Server CA Cert Path", :type => :string
223
- opt :message_persistent_disk, "Message Persistent Disk Path", :type => :string
170
+ opt :host, "/etc/hosts name", :type => :string, :short => 'H'
171
+ opt :region, "Region Number", :type => :integer, :short => "r"
172
+ opt :internal, "Internal Database", :short => 'i'
173
+ opt :hostname, "Database Hostname", :type => :string, :short => 'h'
174
+ opt :port, "Database Port", :type => :integer, :default => 5432
175
+ opt :username, "Database Username", :type => :string, :short => 'U', :default => "root"
176
+ opt :password, "Database Password", :type => :string, :short => "p"
177
+ opt :dbname, "Database Name", :type => :string, :short => "d", :default => "vmdb_production"
178
+ opt :local_file, "Source/Destination file for DB dump/backup/restore", :type => :string, :shoft => "l"
179
+ opt :dump, "Perform a pg-dump"
180
+ opt :backup, "Perform a pg-basebackup"
181
+ opt :restore, "Restore a database dump/backup"
182
+ opt :standalone, "Run this server as a standalone database server", :type => :bool, :short => 'S'
183
+ opt :key, "Create encryption key", :type => :boolean, :short => "k"
184
+ opt :fetch_key, "SSH host with encryption key", :type => :string, :short => "K"
185
+ opt :force_key, "Forcefully create encryption key", :type => :boolean, :short => "f"
186
+ opt :sshlogin, "SSH login", :type => :string, :default => "root"
187
+ opt :sshpassword, "SSH password", :type => :string
188
+ opt :replication, "Configure database replication as primary or standby", :type => :string, :short => :none
189
+ opt :primary_host, "Primary database host IP address", :type => :string, :short => :none
190
+ opt :standby_host, "Standby database host IP address", :type => :string, :short => :none
191
+ opt :auto_failover, "Configure Replication Manager (repmgrd) for automatic failover", :type => :bool, :short => :none
192
+ opt :cluster_node_number, "Database unique cluster node number", :type => :integer, :short => :none
193
+ opt :verbose, "Verbose", :type => :boolean, :short => "v"
194
+ opt :dbdisk, "Database Disk Path", :type => :string
195
+ opt :logdisk, "Log Disk Path", :type => :string
196
+ opt :tmpdisk, "Temp storage Disk Path", :type => :string
197
+ opt :uninstall_ipa, "Uninstall IPA Client", :type => :boolean, :default => false
198
+ opt :ipaserver, "IPA Server FQDN", :type => :string
199
+ opt :ipaprincipal, "IPA Server principal", :type => :string, :default => "admin"
200
+ opt :ipapassword, "IPA Server password", :type => :string
201
+ opt :ipadomain, "IPA Server domain (optional)", :type => :string
202
+ opt :iparealm, "IPA Server realm (optional)", :type => :string
203
+ opt :ca, "CA name used for certmonger", :type => :string, :default => "ipa"
204
+ opt :http_cert, "install certs for http server", :type => :boolean
205
+ opt :extauth_opts, "External Authentication Options", :type => :string
206
+ opt :saml_config, "Configure Appliance for SAML Authentication", :type => :boolean, :default => false
207
+ opt :saml_client_host, "Optional Appliance host used for SAML registration", :type => :string
208
+ opt :saml_idp_metadata, "The file path or URL of the SAML IDP Metadata", :type => :string
209
+ opt :saml_enable_sso, "Optionally enable SSO with SAML Authentication", :type => :boolean, :default => false
210
+ opt :saml_unconfig, "Unconfigure Appliance SAML Authentication", :type => :boolean, :default => false
211
+ opt :oidc_config, "Configure Appliance for OpenID-Connect Authentication", :type => :boolean, :default => false
212
+ opt :oidc_url, "The OpenID-Connect Provider URL", :type => :string
213
+ opt :oidc_client_host, "Optional Appliance host used for OpenID-Connect Authentication", :type => :string
214
+ opt :oidc_client_id, "The OpenID-Connect Provider Client ID", :type => :string
215
+ opt :oidc_client_secret, "The OpenID-Connect Provider Client Secret", :type => :string
216
+ opt :oidc_insecure, "OpenID-Connect Insecure No SSL Verify (development)", :type => :boolean, :default => false
217
+ opt :oidc_introspection_endpoint, "The OpenID-Connect Provider Introspect Endpoint", :type => :string
218
+ opt :oidc_enable_sso, "Optionally enable SSO with OpenID-Connect Authentication", :type => :boolean, :default => false
219
+ opt :oidc_unconfig, "Unconfigure Appliance OpenID-Connect Authentication", :type => :boolean, :default => false
220
+ opt :server, "{start|stop|restart} actions on evmserverd Server", :type => :string
221
+ opt :openscap, "Setup OpenScap", :type => :boolean, :default => false
222
+ opt :message_server_config, "Subcommand to Configure Appliance as a Kafka Message Server", :type => :boolean, :default => false
223
+ opt :message_server_unconfig, "Subcommand to Unconfigure Appliance as a Kafka Message Server", :type => :boolean, :default => false
224
+ opt :message_client_config, "Subcommand to Configure Appliance as a Kafka Message Client", :type => :boolean, :default => false
225
+ opt :message_client_unconfig, "Subcommand to Unconfigure Appliance as a Kafka Message Client", :type => :boolean, :default => false
226
+ opt :message_keystore_username, "Message Server Keystore Username", :type => :string
227
+ opt :message_keystore_password, "Message Server Keystore Password", :type => :string
228
+ opt :message_server_username, "Message Server Username", :type => :string
229
+ opt :message_server_password, "Message Server password", :type => :string
230
+ opt :message_server_port, "Message Server Port", :type => :integer
231
+ opt :message_server_use_ipaddr, "Deprecated: Message Server Use Address", :type => :boolean, :default => false
232
+ opt :message_server_host, "Message Server Hostname or IP Address", :type => :string
233
+ opt :message_truststore_path_src, "Message Server Truststore Path", :type => :string
234
+ opt :message_ca_cert_path_src, "Message Server CA Cert Path", :type => :string
235
+ opt :message_persistent_disk, "Message Persistent Disk Path", :type => :string
236
+ opt :containers_storage_disk, "Containers Storage Disk Path", :type => :string
237
+ opt :container_registry_uri, "Container Registry URI", :type => :string
238
+ opt :container_registry_username, "Container Registry Username", :type => :string
239
+ opt :container_registry_password, "Container Registry Password", :type => :string
240
+ opt :container_registry_authfile, "Path of the authentication file for container registry auth", :type => :string
241
+ opt :container_registry_tls_verify, "Verify certificates when contacting registries", :type => :boolean
242
+ opt :container_pull_image, "Container Pull Image", :type => :string
224
243
  end
225
244
  Optimist.die :region, "needed when setting up a local database" if region_number_required? && options[:region].nil?
226
245
  Optimist.die "Supply only one of --message-server-config, --message-server-unconfig, --message-client-config or --message-client-unconfig" if multiple_message_subcommands?
@@ -239,7 +258,8 @@ module ApplianceConsole
239
258
 
240
259
  def run
241
260
  Optimist.educate unless set_host? || key? || database? || db_dump? || db_backup? ||
242
- db_restore? || tmp_disk? || log_disk? ||
261
+ db_restore? || tmp_disk? || log_disk? || containers_disk? ||
262
+ container_registry? || container_pull_image? ||
243
263
  uninstall_ipa? || install_ipa? || certs? || extauth_opts? ||
244
264
  set_server_state? || set_replication? || openscap? ||
245
265
  saml_config? || saml_unconfig? ||
@@ -261,6 +281,9 @@ module ApplianceConsole
261
281
  db_restore if db_restore?
262
282
  config_tmp_disk if tmp_disk?
263
283
  config_log_disk if log_disk?
284
+ config_containers_disk if containers_disk?
285
+ config_container_registry if container_registry?
286
+ config_container_pull_image if container_pull_image?
264
287
  uninstall_ipa if uninstall_ipa?
265
288
  install_ipa if install_ipa?
266
289
  install_certs if certs?
@@ -466,6 +489,33 @@ module ApplianceConsole
466
489
  end
467
490
  end
468
491
 
492
+ def config_containers_disk
493
+ containers_disk = disk_from_string(options[:containers_storage_disk])
494
+ if containers_disk
495
+ say("creating containers storage disk")
496
+ ManageIQ::ApplianceConsole::ContainersConfiguration.new(:disk => containers_disk).activate
497
+ else
498
+ report_disk_error(options[:containers_storage_disk])
499
+ end
500
+ end
501
+
502
+ def config_container_registry
503
+ if options[:container_registry_uri]
504
+ ManageIQ::ApplianceConsole::ContainersConfiguration.new(
505
+ :container_registry_uri => options[:container_registry_uri],
506
+ :container_registry_username => options[:container_registry_username],
507
+ :container_registry_password => options[:container_registry_password],
508
+ :container_registry_authfile => options[:container_registry_authfile],
509
+ :container_registry_tls_verify => options[:container_registry_tls_verify]
510
+ ).activate
511
+ end
512
+ end
513
+
514
+ def config_container_pull_image
515
+ container_image = options[:container_pull_image]
516
+ ManageIQ::ApplianceConsole::ContainersConfiguration.new(:container_image => container_image).activate if container_image
517
+ end
518
+
469
519
  def report_disk_error(missing_disk)
470
520
  choose_disk = disk.try(:path)
471
521
  if choose_disk
@@ -0,0 +1,134 @@
1
+ require_relative 'manageiq_user_mixin'
2
+
3
+ module ManageIQ
4
+ module ApplianceConsole
5
+ class ContainersConfiguration
6
+ include ManageIQ::ApplianceConsole::Prompts
7
+ include ManageIQ::ApplianceConsole::ManageiqUserMixin
8
+
9
+ CONTAINERS_ROOT_DIR = Pathname.new("/var/lib/manageiq/containers").freeze
10
+ CONTAINERS_VOL_NAME = "miq_containers".freeze
11
+
12
+ attr_accessor :registry_uri, :registry_username, :registry_password,
13
+ :registry_authfile, :registry_certdir, :registry_tls_verify,
14
+ :disk, :image
15
+
16
+ def initialize(options = {})
17
+ self.registry_uri = options[:container_registry_uri]
18
+ self.registry_username = options[:container_registry_username]
19
+ self.registry_password = options[:container_registry_password]
20
+ self.registry_authfile = options[:container_registry_authfile]
21
+ self.registry_tls_verify = options[:conatiner_registry_tls_verify]
22
+ self.image = options[:container_image]
23
+ self.disk = options[:disk]
24
+ end
25
+
26
+ def ask_questions
27
+ clear_screen
28
+ choose_disk if use_new_disk?
29
+ choose_container_registry if authenticate_container_registry?
30
+ choose_container_image if pull_container_image?
31
+ confirm_selection
32
+ end
33
+
34
+ def activate
35
+ activate_new_disk if disk
36
+ activate_registry_login if registry_uri
37
+ activate_image_pull if image
38
+ true
39
+ rescue AwesomeSpawn::CommandResultError => e
40
+ say(e.result.output)
41
+ say(e.result.error)
42
+ say("")
43
+ false
44
+ end
45
+
46
+ private
47
+
48
+ def use_new_disk?
49
+ agree("Configure a new disk for container storage? (Y/N):")
50
+ end
51
+
52
+ def choose_disk
53
+ self.disk = ask_for_disk("container disk")
54
+ end
55
+
56
+ def authenticate_container_registry?
57
+ agree("Authenticate to a container registry? (Y/N):")
58
+ end
59
+
60
+ def choose_container_registry
61
+ self.registry_uri = ask_for_string("Registry")
62
+ self.registry_username = ask_for_string("Registry username")
63
+ self.registry_password = ask_for_password("Registry password")
64
+ end
65
+
66
+ def pull_container_image?
67
+ agree("Pull a container image? (Y/N):")
68
+ end
69
+
70
+ def choose_container_image
71
+ self.image = ask_for_string("Container image")
72
+ end
73
+
74
+ def confirm_selection
75
+ return false unless disk || registry_uri || image
76
+
77
+ clear_screen
78
+
79
+ if disk
80
+ say("\t#{disk.path} with #{disk.size.to_i / 1.gigabyte} GB will be configured as the new containers root disk.")
81
+ end
82
+
83
+ if registry_uri
84
+ say("Authenticating to container registry #{registry_uri}")
85
+ end
86
+
87
+ if image
88
+ say("Pull container image #{image}")
89
+ end
90
+
91
+ agree("Confirm continue with these updates (Y/N):")
92
+ end
93
+
94
+ def activate_new_disk
95
+ say("Initializing container storage disk")
96
+
97
+ FileUtils.mkdir_p(CONTAINERS_ROOT_DIR)
98
+ LogicalVolumeManagement.new(:disk => disk, :mount_point => CONTAINERS_ROOT_DIR, :name => CONTAINERS_VOL_NAME).setup
99
+ FileUtils.chown(manageiq_uid, manageiq_gid, CONTAINERS_ROOT_DIR)
100
+ end
101
+
102
+ def activate_registry_login
103
+ say("Authenticating to container registry #{registry_uri}...")
104
+
105
+ extra_opts = {}
106
+ login_params = {}
107
+ login_params[:username] = registry_username if registry_username
108
+ login_params[:authfile] = registry_authfile if registry_authfile
109
+ login_params[:cert_dir] = registry_certdir if registry_certdir.present?
110
+ login_params[:tls_verify] = nil if registry_tls_verify
111
+
112
+ if registry_password
113
+ login_params[:password_stdin] = nil
114
+ extra_opts[:in_data] = "#{registry_password}\n"
115
+ end
116
+
117
+ podman!(:params => ["login", registry_uri, login_params], **extra_opts)
118
+ end
119
+
120
+ def activate_image_pull
121
+ say("Pulling container image #{image}...")
122
+
123
+ podman!(:params => ["image", "pull", image])
124
+ end
125
+
126
+ def podman!(options = {})
127
+ options[:params].unshift("podman", {:root => CONTAINERS_ROOT_DIR.join("storage").to_s})
128
+ options[:chdir] ||= "/home/manageiq"
129
+
130
+ run_as_manageiq!(options)
131
+ end
132
+ end
133
+ end
134
+ end
@@ -205,7 +205,7 @@ FRIENDLY
205
205
  def validate!
206
206
  pool = ModelWithNoBackingTable.establish_connection(settings_hash.delete_if { |_n, v| v.blank? })
207
207
  begin
208
- pool.connection
208
+ pool.with_connection { |conn| conn.connect! && conn.connected? }
209
209
  ensure
210
210
  ModelWithNoBackingTable.remove_connection
211
211
  end
@@ -170,8 +170,8 @@ module ApplianceConsole
170
170
  true
171
171
  end
172
172
 
173
- def valid_parameters?(ipaserver)
174
- host_reachable?(ipaserver, "IPA Server")
173
+ def valid_parameters?(_ipaserver)
174
+ true
175
175
  end
176
176
 
177
177
  #
@@ -182,21 +182,6 @@ module ApplianceConsole
182
182
  File.open(path, "w") { |f| f.write(config) }
183
183
  end
184
184
 
185
- #
186
- # Network validation
187
- #
188
- def host_reachable?(host, what = "Server")
189
- require 'net/ping'
190
- say("Checking connectivity to #{host} ... ")
191
- unless Net::Ping::External.new(host).ping
192
- say("Failed.\nCould not connect to #{host},")
193
- say("the #{what} must be reachable by name.")
194
- return false
195
- end
196
- say("Succeeded.")
197
- true
198
- end
199
-
200
185
  def cp_template(file, src_dir, dest_dir = "/")
201
186
  src_path = path_join(src_dir, file)
202
187
  dest_path = path_join(dest_dir, file.gsub(".erb", ""))
@@ -10,6 +10,11 @@ module ManageIQ
10
10
  def manageiq_gid
11
11
  @manageiq_gid ||= Process::GID.from_name("manageiq")
12
12
  end
13
+
14
+ def run_as_manageiq!(options = {})
15
+ options[:params].unshift({:user => "manageiq"})
16
+ AwesomeSpawn.run!("sudo", options)
17
+ end
13
18
  end
14
19
  end
15
20
  end
@@ -1,5 +1,5 @@
1
1
  module ManageIQ
2
2
  module ApplianceConsole
3
- VERSION = '10.0.1'.freeze
3
+ VERSION = '11.0.0'.freeze
4
4
  end
5
5
  end
@@ -26,6 +26,7 @@ require 'manageiq/appliance_console/auth_utilities'
26
26
  require 'manageiq/appliance_console/certificate'
27
27
  require 'manageiq/appliance_console/certificate_authority'
28
28
  require 'manageiq/appliance_console/cli'
29
+ require 'manageiq/appliance_console/containers_configuration'
29
30
  require 'manageiq/appliance_console/database_admin'
30
31
  require 'manageiq/appliance_console/database_configuration'
31
32
  require 'manageiq/appliance_console/database_replication'
@@ -10,6 +10,7 @@ en:
10
10
  - app_config
11
11
  - db_replication
12
12
  - log_config
13
+ - containers_config
13
14
  - failover_monitor
14
15
  - httpdauth
15
16
  - extauth_opts
@@ -26,6 +27,7 @@ en:
26
27
  app_config: Configure Application
27
28
  db_replication: Configure Database Replication
28
29
  log_config: Logfile Configuration
30
+ containers_config: Containers Configuration
29
31
  failover_monitor: Control Application Database Failover Monitor
30
32
  httpdauth: Configure External Authentication (httpd)
31
33
  extauth_opts: Update External Authentication Options
@@ -27,6 +27,13 @@ Gem::Specification.new do |spec|
27
27
  spec.add_runtime_dependency "bcrypt_pbkdf", ">= 1.0", "< 2.0"
28
28
  spec.add_runtime_dependency "ed25519", ">= 1.2", "< 2.0"
29
29
  spec.add_runtime_dependency "highline", "~> 2.1"
30
+
31
+ # These two dependencies can be removed for ruby 3.4 support once we upgrade highline:
32
+ # abbrev is not in ruby 3.4 standard library and no longer a dependency in highline 3.0.1
33
+ # reline is not in ruby 3.4 standard library and added as a runtime dependency in highline 3.1.0
34
+ spec.add_runtime_dependency "abbrev"
35
+ spec.add_runtime_dependency "reline"
36
+
30
37
  spec.add_runtime_dependency "i18n", ">= 0.8"
31
38
  spec.add_runtime_dependency "linux_admin", "~> 4.0"
32
39
  spec.add_runtime_dependency "manageiq-password", "< 2"
@@ -37,9 +44,10 @@ Gem::Specification.new do |spec|
37
44
  spec.add_runtime_dependency "pg-logical_replication"
38
45
 
39
46
  spec.add_development_dependency "bundler"
40
- spec.add_development_dependency "manageiq-style"
47
+ spec.add_development_dependency "manageiq-style", ">= 1.5.4"
48
+
41
49
  spec.add_development_dependency "rake"
42
- spec.add_development_dependency "rspec", "~> 3.0"
50
+ spec.add_development_dependency "rspec", "~> 3.0"
43
51
  spec.add_development_dependency "rubocop"
44
- spec.add_development_dependency "simplecov", ">= 0.21.2"
52
+ spec.add_development_dependency "simplecov", ">= 0.21.2"
45
53
  end
data/renovate.json CHANGED
@@ -1,6 +1,5 @@
1
1
  {
2
2
  "$schema": "https://docs.renovatebot.com/renovate-schema.json",
3
- "extends": [
4
- "config:recommended"
5
- ]
3
+ "inheritConfig": true,
4
+ "inheritConfigRepoName": "manageiq/renovate-config"
6
5
  }
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: manageiq-appliance_console
3
3
  version: !ruby/object:Gem::Version
4
- version: 10.0.1
4
+ version: 11.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ManageIQ Developers
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-11-27 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: activerecord
@@ -120,6 +119,34 @@ dependencies:
120
119
  - - "~>"
121
120
  - !ruby/object:Gem::Version
122
121
  version: '2.1'
122
+ - !ruby/object:Gem::Dependency
123
+ name: abbrev
124
+ requirement: !ruby/object:Gem::Requirement
125
+ requirements:
126
+ - - ">="
127
+ - !ruby/object:Gem::Version
128
+ version: '0'
129
+ type: :runtime
130
+ prerelease: false
131
+ version_requirements: !ruby/object:Gem::Requirement
132
+ requirements:
133
+ - - ">="
134
+ - !ruby/object:Gem::Version
135
+ version: '0'
136
+ - !ruby/object:Gem::Dependency
137
+ name: reline
138
+ requirement: !ruby/object:Gem::Requirement
139
+ requirements:
140
+ - - ">="
141
+ - !ruby/object:Gem::Version
142
+ version: '0'
143
+ type: :runtime
144
+ prerelease: false
145
+ version_requirements: !ruby/object:Gem::Requirement
146
+ requirements:
147
+ - - ">="
148
+ - !ruby/object:Gem::Version
149
+ version: '0'
123
150
  - !ruby/object:Gem::Dependency
124
151
  name: i18n
125
152
  requirement: !ruby/object:Gem::Requirement
@@ -252,14 +279,14 @@ dependencies:
252
279
  requirements:
253
280
  - - ">="
254
281
  - !ruby/object:Gem::Version
255
- version: '0'
282
+ version: 1.5.4
256
283
  type: :development
257
284
  prerelease: false
258
285
  version_requirements: !ruby/object:Gem::Requirement
259
286
  requirements:
260
287
  - - ">="
261
288
  - !ruby/object:Gem::Version
262
- version: '0'
289
+ version: 1.5.4
263
290
  - !ruby/object:Gem::Dependency
264
291
  name: rake
265
292
  requirement: !ruby/object:Gem::Requirement
@@ -317,20 +344,17 @@ dependencies:
317
344
  - !ruby/object:Gem::Version
318
345
  version: 0.21.2
319
346
  description: ManageIQ Appliance Console
320
- email:
321
347
  executables:
322
348
  - appliance_console
323
349
  - appliance_console_cli
324
350
  extensions: []
325
351
  extra_rdoc_files: []
326
352
  files:
327
- - ".codeclimate.yml"
328
353
  - ".github/workflows/ci.yaml"
329
354
  - ".gitignore"
330
355
  - ".rspec"
331
356
  - ".rspec_ci"
332
357
  - ".rubocop.yml"
333
- - ".rubocop_cc.yml"
334
358
  - ".rubocop_local.yml"
335
359
  - ".whitesource"
336
360
  - ".yamllint"
@@ -346,6 +370,7 @@ files:
346
370
  - lib/manageiq/appliance_console/certificate.rb
347
371
  - lib/manageiq/appliance_console/certificate_authority.rb
348
372
  - lib/manageiq/appliance_console/cli.rb
373
+ - lib/manageiq/appliance_console/containers_configuration.rb
349
374
  - lib/manageiq/appliance_console/database_admin.rb
350
375
  - lib/manageiq/appliance_console/database_configuration.rb
351
376
  - lib/manageiq/appliance_console/database_replication.rb
@@ -386,7 +411,6 @@ homepage: https://github.com/ManageIQ/manageiq-appliance_console
386
411
  licenses:
387
412
  - Apache-2.0
388
413
  metadata: {}
389
- post_install_message:
390
414
  rdoc_options: []
391
415
  require_paths:
392
416
  - lib
@@ -401,8 +425,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
401
425
  - !ruby/object:Gem::Version
402
426
  version: '0'
403
427
  requirements: []
404
- rubygems_version: 3.3.27
405
- signing_key:
428
+ rubygems_version: 3.6.9
406
429
  specification_version: 4
407
430
  summary: ManageIQ Appliance Console
408
431
  test_files: []
data/.codeclimate.yml DELETED
@@ -1,43 +0,0 @@
1
- prepare:
2
- fetch:
3
- - url: https://raw.githubusercontent.com/ManageIQ/manageiq-style/master/.rubocop_base.yml
4
- path: ".rubocop_base.yml"
5
- - url: https://raw.githubusercontent.com/ManageIQ/manageiq-style/master/.rubocop_cc_base.yml
6
- path: ".rubocop_cc_base.yml"
7
- - url: https://raw.githubusercontent.com/ManageIQ/manageiq-style/master/styles/base.yml
8
- path: styles/base.yml
9
- - url: https://raw.githubusercontent.com/ManageIQ/manageiq-style/master/styles/cc_base.yml
10
- path: styles/cc_base.yml
11
- plugins:
12
- rubocop:
13
- enabled: true
14
- config: ".rubocop_cc.yml"
15
- channel: rubocop-1-56-3
16
- brakeman:
17
- enabled: false
18
- bundler-audit:
19
- enabled: false
20
- csslint:
21
- enabled: false
22
- duplication:
23
- enabled: true
24
- config:
25
- languages:
26
- - ruby
27
- - javascript
28
- eslint:
29
- enabled: false
30
- channel: eslint-3
31
- fixme:
32
- enabled: false
33
- markdownlint:
34
- enabled: false
35
- exclude_patterns:
36
- - ".git/"
37
- - "**.xml"
38
- - "**.yaml"
39
- - "**.yml"
40
- - locale/
41
- - spec/
42
- - tools/
43
- version: '2'
data/.rubocop_cc.yml DELETED
@@ -1,4 +0,0 @@
1
- inherit_from:
2
- - ".rubocop_base.yml"
3
- - ".rubocop_cc_base.yml"
4
- - ".rubocop_local.yml"