manageiq-appliance_console 10.0.2 → 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 +4 -4
- data/.github/workflows/ci.yaml +17 -14
- data/CHANGELOG.md +15 -3
- data/Gemfile +3 -3
- data/README.md +1 -3
- data/bin/appliance_console +12 -0
- data/lib/manageiq/appliance_console/cli.rb +117 -67
- data/lib/manageiq/appliance_console/containers_configuration.rb +134 -0
- data/lib/manageiq/appliance_console/database_configuration.rb +1 -1
- data/lib/manageiq/appliance_console/manageiq_user_mixin.rb +5 -0
- data/lib/manageiq/appliance_console/version.rb +1 -1
- data/lib/manageiq/appliance_console.rb +1 -0
- data/locales/appliance/en.yml +2 -0
- data/manageiq-appliance_console.gemspec +7 -0
- metadata +32 -9
- data/.codeclimate.yml +0 -43
- data/.rubocop_cc.yml +0 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 83413224da39d38ff2e7bf9b23bf07e72ff94707e0a3f7e0eac38d97e68f9d7f
|
|
4
|
+
data.tar.gz: 3279a7297f81051f6c6c24cca1ee43453ecbeb572d036962b68eaab9832be03d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a1f7eb0db244889910d2508881ca3ba8f777b8c2de2816986f8e62405dca372305da9a139d4ef778c24017b4de549dd285630f533b55d099c8c0a30e1416c14f
|
|
7
|
+
data.tar.gz: ad1659abd5e7553cd12980fd6e547f0c89dee006e524db84c0973ee1ab0ea24d35c9d481716975f15630b699527bed16949b099666a4d92f5b00182cd008cd82
|
data/.github/workflows/ci.yaml
CHANGED
|
@@ -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.
|
|
22
|
+
- '3.2'
|
|
15
23
|
- '3.3'
|
|
24
|
+
- '3.4'
|
|
16
25
|
rails-version:
|
|
17
|
-
- '7.
|
|
18
|
-
- '
|
|
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@
|
|
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,12 +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
|
+
|
|
7
18
|
## [10.0.2] - 2025-05-08
|
|
8
|
-
|
|
19
|
+
### Changed
|
|
9
20
|
- Remove ping of IPA Server [[#278](https://github.com/ManageIQ/manageiq-appliance_console/pull/278)]
|
|
10
21
|
|
|
11
22
|
## [10.0.1] - 2024-11-27
|
|
12
|
-
|
|
23
|
+
### Changed
|
|
13
24
|
- Readline does not work with ruby 3.3 [[#270](https://github.com/ManageIQ/manageiq-appliance_console/pull/270)]
|
|
14
25
|
|
|
15
26
|
## [10.0.0] - 2024-11-19
|
|
@@ -307,7 +318,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
|
307
318
|
|
|
308
319
|
## [1.0.0] - 2017-10-19
|
|
309
320
|
|
|
310
|
-
[Unreleased]: https://github.com/ManageIQ/manageiq-appliance_console/compare/
|
|
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
|
|
311
323
|
[10.0.2]: https://github.com/ManageIQ/manageiq-appliance_console/compare/v10.0.1...v10.0.2
|
|
312
324
|
[10.0.1]: https://github.com/ManageIQ/manageiq-appliance_console/compare/v10.0.0...v10.0.1
|
|
313
325
|
[10.0.0]: https://github.com/ManageIQ/manageiq-appliance_console/compare/v9.1.1...v10.0.0
|
data/Gemfile
CHANGED
data/README.md
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
# ManageIQ::ApplianceConsole
|
|
2
2
|
|
|
3
3
|
[](http://badge.fury.io/rb/manageiq-appliance_console)
|
|
4
|
-
[](https://github.com/ManageIQ/manageiq-appliance_console/actions/workflows/ci.yaml)
|
|
5
|
-
[](https://codeclimate.com/github/ManageIQ/manageiq-appliance_console)
|
|
6
|
-
[](https://codeclimate.com/github/ManageIQ/manageiq-appliance_console/coverage)
|
|
4
|
+
[](https://github.com/ManageIQ/manageiq-appliance_console/actions/workflows/ci.yaml)
|
|
7
5
|
|
|
8
6
|
[](https://gitter.im/ManageIQ/manageiq-appliance_console?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
|
9
7
|
|
data/bin/appliance_console
CHANGED
|
@@ -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,
|
|
159
|
-
opt :region,
|
|
160
|
-
opt :internal,
|
|
161
|
-
opt :hostname,
|
|
162
|
-
opt :port,
|
|
163
|
-
opt :username,
|
|
164
|
-
opt :password,
|
|
165
|
-
opt :dbname,
|
|
166
|
-
opt :local_file,
|
|
167
|
-
opt :dump,
|
|
168
|
-
opt :backup,
|
|
169
|
-
opt :restore,
|
|
170
|
-
opt :standalone,
|
|
171
|
-
opt :key,
|
|
172
|
-
opt :fetch_key,
|
|
173
|
-
opt :force_key,
|
|
174
|
-
opt :sshlogin,
|
|
175
|
-
opt :sshpassword,
|
|
176
|
-
opt :replication,
|
|
177
|
-
opt :primary_host,
|
|
178
|
-
opt :standby_host,
|
|
179
|
-
opt :auto_failover,
|
|
180
|
-
opt :cluster_node_number,
|
|
181
|
-
opt :verbose,
|
|
182
|
-
opt :dbdisk,
|
|
183
|
-
opt :logdisk,
|
|
184
|
-
opt :tmpdisk,
|
|
185
|
-
opt :uninstall_ipa,
|
|
186
|
-
opt :ipaserver,
|
|
187
|
-
opt :ipaprincipal,
|
|
188
|
-
opt :ipapassword,
|
|
189
|
-
opt :ipadomain,
|
|
190
|
-
opt :iparealm,
|
|
191
|
-
opt :ca,
|
|
192
|
-
opt :http_cert,
|
|
193
|
-
opt :extauth_opts,
|
|
194
|
-
opt :saml_config,
|
|
195
|
-
opt :saml_client_host,
|
|
196
|
-
opt :saml_idp_metadata,
|
|
197
|
-
opt :saml_enable_sso,
|
|
198
|
-
opt :saml_unconfig,
|
|
199
|
-
opt :oidc_config,
|
|
200
|
-
opt :oidc_url,
|
|
201
|
-
opt :oidc_client_host,
|
|
202
|
-
opt :oidc_client_id,
|
|
203
|
-
opt :oidc_client_secret,
|
|
204
|
-
opt :oidc_insecure,
|
|
205
|
-
opt :oidc_introspection_endpoint,
|
|
206
|
-
opt :oidc_enable_sso,
|
|
207
|
-
opt :oidc_unconfig,
|
|
208
|
-
opt :server,
|
|
209
|
-
opt :openscap,
|
|
210
|
-
opt :message_server_config,
|
|
211
|
-
opt :message_server_unconfig,
|
|
212
|
-
opt :message_client_config,
|
|
213
|
-
opt :message_client_unconfig,
|
|
214
|
-
opt :message_keystore_username,
|
|
215
|
-
opt :message_keystore_password,
|
|
216
|
-
opt :message_server_username,
|
|
217
|
-
opt :message_server_password,
|
|
218
|
-
opt :message_server_port,
|
|
219
|
-
opt :message_server_use_ipaddr,
|
|
220
|
-
opt :message_server_host,
|
|
221
|
-
opt :message_truststore_path_src,
|
|
222
|
-
opt :message_ca_cert_path_src,
|
|
223
|
-
opt :message_persistent_disk,
|
|
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.
|
|
208
|
+
pool.with_connection { |conn| conn.connect! && conn.connected? }
|
|
209
209
|
ensure
|
|
210
210
|
ModelWithNoBackingTable.remove_connection
|
|
211
211
|
end
|
|
@@ -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
|
|
@@ -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'
|
data/locales/appliance/en.yml
CHANGED
|
@@ -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"
|
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:
|
|
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:
|
|
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
|
|
@@ -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.
|
|
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