foreman_virt_who_configure 0.5.21 → 0.5.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +18 -6
- data/app/assets/javascripts/foreman_virt_who_configure/config_copy_and_paste.js +8 -6
- data/app/assets/javascripts/foreman_virt_who_configure/config_edit.js +17 -3
- data/app/models/foreman_virt_who_configure/config.rb +8 -0
- data/app/views/foreman_virt_who_configure/configs/show.html.erb +2 -2
- data/app/views/foreman_virt_who_configure/configs/steps/_connection_form.erb +1 -1
- data/lib/foreman_virt_who_configure/engine.rb +1 -1
- data/lib/foreman_virt_who_configure/version.rb +1 -1
- data/locale/bn/foreman_virt_who_configure.po +0 -3
- data/locale/bn_IN/foreman_virt_who_configure.po +0 -3
- data/locale/ca/foreman_virt_who_configure.po +0 -3
- data/locale/cs_CZ/LC_MESSAGES/foreman_virt_who_configure.mo +0 -0
- data/locale/cs_CZ/foreman_virt_who_configure.po +0 -3
- data/locale/de/LC_MESSAGES/foreman_virt_who_configure.mo +0 -0
- data/locale/de/foreman_virt_who_configure.po +0 -3
- data/locale/de_DE/foreman_virt_who_configure.po +0 -3
- data/locale/el/foreman_virt_who_configure.po +0 -3
- data/locale/en/foreman_virt_who_configure.po +0 -3
- data/locale/en_GB/foreman_virt_who_configure.po +0 -3
- data/locale/es/LC_MESSAGES/foreman_virt_who_configure.mo +0 -0
- data/locale/es/foreman_virt_who_configure.po +0 -3
- data/locale/foreman_virt_who_configure.pot +4 -7
- data/locale/fr/LC_MESSAGES/foreman_virt_who_configure.mo +0 -0
- data/locale/fr/foreman_virt_who_configure.po +0 -3
- data/locale/gl/foreman_virt_who_configure.po +0 -3
- data/locale/gu/foreman_virt_who_configure.po +0 -3
- data/locale/he_IL/foreman_virt_who_configure.po +0 -3
- data/locale/hi/foreman_virt_who_configure.po +0 -3
- data/locale/it/foreman_virt_who_configure.po +0 -3
- data/locale/ja/LC_MESSAGES/foreman_virt_who_configure.mo +0 -0
- data/locale/ja/foreman_virt_who_configure.po +0 -3
- data/locale/ka/LC_MESSAGES/foreman_virt_who_configure.mo +0 -0
- data/locale/ka/foreman_virt_who_configure.po +0 -3
- data/locale/kn/foreman_virt_who_configure.po +0 -3
- data/locale/ko/foreman_virt_who_configure.po +0 -3
- data/locale/mr/foreman_virt_who_configure.po +0 -3
- data/locale/nl_NL/foreman_virt_who_configure.po +0 -3
- data/locale/or/foreman_virt_who_configure.po +0 -3
- data/locale/pa/foreman_virt_who_configure.po +0 -3
- data/locale/pl/foreman_virt_who_configure.po +0 -3
- data/locale/pt/foreman_virt_who_configure.po +0 -3
- data/locale/pt_BR/LC_MESSAGES/foreman_virt_who_configure.mo +0 -0
- data/locale/pt_BR/foreman_virt_who_configure.po +0 -3
- data/locale/ru/foreman_virt_who_configure.po +0 -3
- data/locale/sl/foreman_virt_who_configure.po +0 -3
- data/locale/sv_SE/foreman_virt_who_configure.po +0 -3
- data/locale/ta/foreman_virt_who_configure.po +0 -3
- data/locale/ta_IN/foreman_virt_who_configure.po +0 -3
- data/locale/te/foreman_virt_who_configure.po +0 -3
- data/locale/tr/foreman_virt_who_configure.po +0 -3
- data/locale/zh_CN/LC_MESSAGES/foreman_virt_who_configure.mo +0 -0
- data/locale/zh_CN/foreman_virt_who_configure.po +0 -3
- data/locale/zh_TW/foreman_virt_who_configure.po +0 -3
- data/test/functional/api/v2/configs_controller_test.rb +21 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 119cc91cb905da4bd294432142b61ac910531ae8e34cdb0a6e7223a932894b32
|
4
|
+
data.tar.gz: a2e875685992c24bbadbf43cb3337cddefa7fcafa3ea592f7afa59026fec1e73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf72c11793e7157e197b8728be459ca702d5a030325445300f8b70ac010a43c03fa3064d46637c9727673796647e0a6e0ce709e6a3c4a7f30043fc17af815261
|
7
|
+
data.tar.gz: 5c0707b56eb0aa13bc1379d473fb207d35015c28531ca945b0396ac650f8d4f3d55176c38cbdc6667aa12428b6dc42f8c31218b766a71ac50fbe829923b269bc
|
data/README.md
CHANGED
@@ -4,21 +4,33 @@ A Foreman plugin to make virt-who configuration easier. This provides a simple U
|
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
|
-
|
7
|
+
### Development setup:
|
8
8
|
|
9
|
+
* This plugin requires Katello to be installed in your Foreman instance. If it's there, simply install a package with the plugin (rpm only), run migrations and seed by running:
|
10
|
+
|
11
|
+
```
|
9
12
|
dnf install rubygem-foreman_virt_who_configure
|
10
13
|
foreman-rake db:migrate
|
11
14
|
foreman-rake db:seed
|
15
|
+
```
|
16
|
+
|
17
|
+
### Production setup:
|
18
|
+
|
19
|
+
* Run the following command to install the plugin with the Foreman Installer.
|
20
|
+
```
|
21
|
+
foreman-installer --enable-foreman-plugin-virt-who-configure
|
22
|
+
foreman-installer --enable-foreman-cli-virt-who-configure
|
23
|
+
```
|
12
24
|
|
13
25
|
## Usage
|
14
26
|
|
15
|
-
After installation there is new "Virt-who
|
27
|
+
* After installation there is new "Virt-who Configurations" menu added in "Infrastructure" tab. The "Virt-who Configurations" -> "Create Config" provides options to add details about configuration, most of the fields have inline help.
|
16
28
|
|
17
|
-
The virt-who configuration should be in an organization. If an organization has not selected then Owner field would be displayed where it is required to select organization. If organization is already selected then Owner field is not displayed and virt-configuration will be automatically created in selected organization scope.
|
29
|
+
* The virt-who configuration should be in an organization. If an organization has not selected then Owner field would be displayed where it is required to select organization. If an organization is already selected then Owner field is not displayed and virt-configuration will be automatically created in the selected organization scope.
|
18
30
|
|
19
|
-
To deploy the configuration click on configuration name on "Virt-who
|
31
|
+
* To deploy the configuration click on configuration name on "Virt-who Configurations" list page, "Overview" page shows details about configuration and "Deploy page" has all details on deploying configuration.
|
20
32
|
|
21
|
-
More details are available at - https://theforeman.org/plugins/foreman_virt_who_configure
|
33
|
+
* More details are available at - https://theforeman.org/plugins/foreman_virt_who_configure
|
22
34
|
|
23
35
|
## Contributing
|
24
36
|
|
@@ -26,7 +38,7 @@ Fork and send a Pull Request. Thanks!
|
|
26
38
|
|
27
39
|
## Copyright
|
28
40
|
|
29
|
-
Copyright (c)
|
41
|
+
Copyright (c) 2024 - Foreman team
|
30
42
|
|
31
43
|
This program is free software: you can redistribute it and/or modify
|
32
44
|
it under the terms of the GNU General Public License as published by
|
@@ -1,8 +1,10 @@
|
|
1
1
|
function virt_who_copy_configuration_to_clipboard(text) {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
2
|
+
try {
|
3
|
+
navigator.clipboard.writeText(text);
|
4
|
+
} catch (error) {
|
5
|
+
console.error(
|
6
|
+
"Copying to clipboard is not supported in this browser, or with an insecure connection."
|
7
|
+
);
|
8
|
+
console.error(error);
|
9
|
+
}
|
8
10
|
}
|
@@ -5,6 +5,14 @@ function virt_who_update_listing_mode() {
|
|
5
5
|
var blacklist = $('#foreman_virt_who_configure_config_blacklist').parents('div.form-group');
|
6
6
|
var whitelist_parent = $('#foreman_virt_who_configure_config_filter_host_parents').parents('div.form-group');
|
7
7
|
var blacklist_parent = $('#foreman_virt_who_configure_config_exclude_host_parents').parents('div.form-group');
|
8
|
+
var hypervisor_ids = foreman_virt_who_configure_config_hypervisor_id;
|
9
|
+
|
10
|
+
// https://projects.theforeman.org/issues/26321
|
11
|
+
if (hypervisor_type != 'esx') {
|
12
|
+
$(hypervisor_ids).find('option[value=hwuuid]').remove();
|
13
|
+
} else if (hypervisor_type == 'esx' && $(hypervisor_ids).find('option[value=hwuuid]').length == 0) {
|
14
|
+
$(hypervisor_ids).append('<option value='+'hwuuid>'+'hwuuid'+'</option>');
|
15
|
+
}
|
8
16
|
|
9
17
|
// UNLIMITED = 0, WHITELIST = 1, BLACKLIST = 2, see config.rb model for the definition
|
10
18
|
if (filtering_mode == '0') {
|
@@ -74,7 +82,13 @@ $(document).ready(function () {
|
|
74
82
|
virt_who_update_hypervisor_fields();
|
75
83
|
virt_who_update_ahv_debug();
|
76
84
|
|
77
|
-
$(
|
78
|
-
$(
|
79
|
-
|
85
|
+
$("#foreman_virt_who_configure_config_listing_mode").on("change", virt_who_update_listing_mode);
|
86
|
+
$("#foreman_virt_who_configure_config_hypervisor_type").on(
|
87
|
+
"change",
|
88
|
+
virt_who_update_credentials_help
|
89
|
+
);
|
90
|
+
$("#foreman_virt_who_configure_config_hypervisor_type").on(
|
91
|
+
"change",
|
92
|
+
virt_who_update_hypervisor_fields
|
93
|
+
);
|
80
94
|
});
|
@@ -116,6 +116,7 @@ module ForemanVirtWhoConfigure
|
|
116
116
|
validates :prism_flavor, :inclusion => {:in => PRISM_FLAVORS.keys, :message => "should be either central or element"}, :if => proc { |c| c.hypervisor_type == 'ahv' }
|
117
117
|
validate :validates_whitelist_blacklist
|
118
118
|
validate :validates_debug_settings, :if => proc { |c| c.hypervisor_type == 'ahv' }
|
119
|
+
validate :validates_hypervisor_id_non_vmware, :if => proc { |c| c.hypervisor_type != 'esx' }
|
119
120
|
validate :validates_hypervisor_options
|
120
121
|
|
121
122
|
def validates_whitelist_blacklist
|
@@ -131,6 +132,13 @@ module ForemanVirtWhoConfigure
|
|
131
132
|
end
|
132
133
|
end
|
133
134
|
|
135
|
+
def validates_hypervisor_id_non_vmware
|
136
|
+
return unless hypervisor_id.present?
|
137
|
+
if hypervisor_id == 'hwuuid'
|
138
|
+
errors.add(:hypervisor_id, "hwuuid is only supported for ESX hypervisor type")
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
134
142
|
def validates_debug_settings
|
135
143
|
if ahv_internal_debug && !debug
|
136
144
|
errors.add(:ahv_internal_debug, "Enable debugging output is required for Enable AHV debug")
|
@@ -79,7 +79,7 @@
|
|
79
79
|
</div>
|
80
80
|
<div class="col-md-8">
|
81
81
|
<div class="terminal-buttons">
|
82
|
-
<%= link_to _('Copy to clipboard'),
|
82
|
+
<%= link_to _('Copy to clipboard'), '#', :class => 'btn btn-default', :onclick => 'virt_who_copy_configuration_to_clipboard($("#config_command").html()); return false' %>
|
83
83
|
</div>
|
84
84
|
</div>
|
85
85
|
</div>
|
@@ -103,7 +103,7 @@
|
|
103
103
|
</div>
|
104
104
|
<div class="col-md-8">
|
105
105
|
<div class="terminal-buttons">
|
106
|
-
<%= link_to _('Copy to clipboard'),
|
106
|
+
<%= link_to _('Copy to clipboard'), '#', :class => 'btn btn-default', :onclick => 'virt_who_copy_configuration_to_clipboard($("#config_script").html()); return false' %>
|
107
107
|
<%= link_to _('Download the script'), deploy_script_foreman_virt_who_configure_config_path(@config), :class => 'btn btn-default' %>
|
108
108
|
</div>
|
109
109
|
</div>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<div id="config_connection">
|
2
|
-
<%= text_f f, :satellite_url, inline_help_popover(_('Foreman server’s fully-qualified host name, for example: foreman.example.com')).merge(:label => _('Foreman server FQDN')) %>
|
2
|
+
<%= text_f f, :satellite_url, inline_help_popover(_('Foreman server’s fully-qualified host name, for example: foreman.example.com')).merge(:label => _('Foreman server FQDN'), readonly: true) %>
|
3
3
|
<%= select_f f, :hypervisor_id, ForemanVirtWhoConfigure::Config::HYPERVISOR_IDS, :to_s, :to_s, {}, { :label => _('Hypervisor ID') }.merge(
|
4
4
|
inline_help_popover(_("Specifies that hypervisors will be identified by their <b>hostname</b>, <b>uuid</b> or <b>hwuuid</b>.
|
5
5
|
Note that some virtualization backends don't have all of them implemented.
|
@@ -71,7 +71,7 @@ module ForemanVirtWhoConfigure
|
|
71
71
|
# add menu entry
|
72
72
|
menu :top_menu, :virt_who_configs,
|
73
73
|
url_hash: { controller: 'foreman_virt_who_configure/configs', action: :index },
|
74
|
-
caption: N_('Virt-who
|
74
|
+
caption: N_('Virt-who Configurations'),
|
75
75
|
parent: :infrastructure_menu,
|
76
76
|
after: :compute_resources
|
77
77
|
|
Binary file
|
@@ -469,9 +469,6 @@ msgstr "Nastavení pro virt-who"
|
|
469
469
|
msgid "Virt-who Configurations Status"
|
470
470
|
msgstr "Stav nastavení pro virt-who"
|
471
471
|
|
472
|
-
msgid "Virt-who configurations"
|
473
|
-
msgstr "Virt-who konfigurace"
|
474
|
-
|
475
472
|
msgid "Whitelist"
|
476
473
|
msgstr "Seznam povolených"
|
477
474
|
|
Binary file
|
@@ -479,9 +479,6 @@ msgstr "Virt-who Konfigurationen"
|
|
479
479
|
msgid "Virt-who Configurations Status"
|
480
480
|
msgstr "Virt-who Konfigurationsstatus"
|
481
481
|
|
482
|
-
msgid "Virt-who configurations"
|
483
|
-
msgstr "Virt-Who-Konfigurationen"
|
484
|
-
|
485
482
|
msgid "Whitelist"
|
486
483
|
msgstr "Whitelist"
|
487
484
|
|
Binary file
|
@@ -476,9 +476,6 @@ msgstr "Configuraciones de virt-who"
|
|
476
476
|
msgid "Virt-who Configurations Status"
|
477
477
|
msgstr "Estado de configuración de virt-who"
|
478
478
|
|
479
|
-
msgid "Virt-who configurations"
|
480
|
-
msgstr "Configuraciones virt-who"
|
481
|
-
|
482
479
|
msgid "Whitelist"
|
483
480
|
msgstr "Lista blanca"
|
484
481
|
|
@@ -8,8 +8,8 @@ msgid ""
|
|
8
8
|
msgstr ""
|
9
9
|
"Project-Id-Version: foreman_virt_who_configure 1.0.0\n"
|
10
10
|
"Report-Msgid-Bugs-To: \n"
|
11
|
-
"POT-Creation-Date:
|
12
|
-
"PO-Revision-Date:
|
11
|
+
"POT-Creation-Date: 2024-05-22 09:39-0400\n"
|
12
|
+
"PO-Revision-Date: 2024-05-22 09:39-0400\n"
|
13
13
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
14
14
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
15
15
|
"Language: \n"
|
@@ -369,7 +369,7 @@ msgstr ""
|
|
369
369
|
msgid "Prism Element"
|
370
370
|
msgstr ""
|
371
371
|
|
372
|
-
#: ../app/models/foreman_virt_who_configure/config.rb:
|
372
|
+
#: ../app/models/foreman_virt_who_configure/config.rb:233
|
373
373
|
msgid "every %s hours"
|
374
374
|
msgstr ""
|
375
375
|
|
@@ -465,6 +465,7 @@ msgstr ""
|
|
465
465
|
#: ../app/views/foreman_virt_who_configure/configs/index.html.erb:1
|
466
466
|
#: ../app/views/foreman_virt_who_configure/configs/show.html.erb:12
|
467
467
|
#: ../app/views/foreman_virt_who_configure/configs/welcome.html.erb:3
|
468
|
+
#: ../lib/foreman_virt_who_configure/engine.rb:74
|
468
469
|
msgid "Virt-who Configurations"
|
469
470
|
msgstr ""
|
470
471
|
|
@@ -809,10 +810,6 @@ msgid ""
|
|
809
810
|
"or deploy it on a selected target host through Remote Execution."
|
810
811
|
msgstr ""
|
811
812
|
|
812
|
-
#: ../lib/foreman_virt_who_configure/engine.rb:74
|
813
|
-
msgid "Virt-who configurations"
|
814
|
-
msgstr ""
|
815
|
-
|
816
813
|
#: ../lib/foreman_virt_who_configure/engine.rb:79
|
817
814
|
msgid "Virt-who Configs Status"
|
818
815
|
msgstr ""
|
Binary file
|
@@ -475,9 +475,6 @@ msgstr "Configurations virt-who"
|
|
475
475
|
msgid "Virt-who Configurations Status"
|
476
476
|
msgstr "État des configurations virt-who"
|
477
477
|
|
478
|
-
msgid "Virt-who configurations"
|
479
|
-
msgstr "Configurations virt-who"
|
480
|
-
|
481
478
|
msgid "Whitelist"
|
482
479
|
msgstr "Liste blanche"
|
483
480
|
|
Binary file
|
Binary file
|
@@ -469,9 +469,6 @@ msgstr "Virt-who-ის კონფიგურაციები"
|
|
469
469
|
msgid "Virt-who Configurations Status"
|
470
470
|
msgstr "Virt-who-ის კონფიგურაციის სტატუსი"
|
471
471
|
|
472
|
-
msgid "Virt-who configurations"
|
473
|
-
msgstr "Virt-who-ის კონფიგურაციები"
|
474
|
-
|
475
472
|
msgid "Whitelist"
|
476
473
|
msgstr "თეთრი სია"
|
477
474
|
|
Binary file
|
@@ -475,9 +475,6 @@ msgstr "Configurações do virt-who"
|
|
475
475
|
msgid "Virt-who Configurations Status"
|
476
476
|
msgstr "Status de configuração do virt-who"
|
477
477
|
|
478
|
-
msgid "Virt-who configurations"
|
479
|
-
msgstr "Configurações do virt-who"
|
480
|
-
|
481
478
|
msgid "Whitelist"
|
482
479
|
msgstr "Lista de permissões"
|
483
480
|
|
Binary file
|
@@ -167,6 +167,27 @@ class ForemanVirtWhoConfigure::Api::V2::ConfigsControllerTest < ActionController
|
|
167
167
|
assert_equal "Kubeconfig path Invalid option for hypervisor [esx]", response['error']['full_messages'].join('')
|
168
168
|
end
|
169
169
|
|
170
|
+
test "should error when hypervisor type is hwuuid and type is not vmware" do
|
171
|
+
org = FactoryBot.create(:organization)
|
172
|
+
post :create, :params => { :foreman_virt_who_configure_config => { :name => 'my new config',
|
173
|
+
:interval => 240,
|
174
|
+
:filtering_mode => ForemanVirtWhoConfigure::Config::BLACKLIST,
|
175
|
+
:blacklist => ' a,b ',
|
176
|
+
:hypervisor_id => 'hwuuid',
|
177
|
+
:hypervisor_type => 'libvirt',
|
178
|
+
:hypervisor_server => "libvirt.example.com",
|
179
|
+
:hypervisor_username => "root",
|
180
|
+
:debug => true,
|
181
|
+
:satellite_url => "foreman.example.com",
|
182
|
+
:organization_id => org.id }
|
183
|
+
}, :session => set_session_user
|
184
|
+
|
185
|
+
assert_response :unprocessable_entity
|
186
|
+
|
187
|
+
response = ActiveSupport::JSON.decode(@response.body)
|
188
|
+
assert_equal "Hypervisor hwuuid is only supported for ESX hypervisor type", response['error']['full_messages'].join('')
|
189
|
+
end
|
190
|
+
|
170
191
|
test "should create the config" do
|
171
192
|
org = FactoryBot.create(:organization)
|
172
193
|
post :create, :params => { :foreman_virt_who_configure_config => { :name => 'my new config',
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_virt_who_configure
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.23
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Foreman virt-who-configure team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: katello
|
@@ -255,7 +255,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
255
255
|
- !ruby/object:Gem::Version
|
256
256
|
version: '0'
|
257
257
|
requirements: []
|
258
|
-
rubygems_version: 3.
|
258
|
+
rubygems_version: 3.2.33
|
259
259
|
signing_key:
|
260
260
|
specification_version: 4
|
261
261
|
summary: A plugin to make virt-who configuration easy
|