foreman_virt_who_configure 0.5.20 → 0.5.22

Sign up to get free protection for your applications and to get access to all the features.
Files changed (130) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +18 -6
  3. data/Rakefile +1 -1
  4. data/app/assets/javascripts/foreman_virt_who_configure/config_edit.js +8 -0
  5. data/app/models/foreman_virt_who_configure/config.rb +8 -0
  6. data/app/models/foreman_virt_who_configure/output_generator.rb +3 -2
  7. data/app/views/foreman_virt_who_configure/configs/steps/_connection_form.erb +2 -2
  8. data/lib/foreman_virt_who_configure/engine.rb +1 -1
  9. data/lib/foreman_virt_who_configure/version.rb +1 -1
  10. data/locale/action_names.rb +2 -0
  11. data/locale/bn/foreman_virt_who_configure.edit.po +621 -0
  12. data/locale/bn/foreman_virt_who_configure.po +0 -3
  13. data/locale/bn/foreman_virt_who_configure.po.time_stamp +0 -0
  14. data/locale/bn_IN/foreman_virt_who_configure.edit.po +622 -0
  15. data/locale/bn_IN/foreman_virt_who_configure.po +0 -3
  16. data/locale/bn_IN/foreman_virt_who_configure.po.time_stamp +0 -0
  17. data/locale/ca/foreman_virt_who_configure.edit.po +621 -0
  18. data/locale/ca/foreman_virt_who_configure.po +0 -3
  19. data/locale/ca/foreman_virt_who_configure.po.time_stamp +0 -0
  20. data/locale/cs_CZ/LC_MESSAGES/foreman_virt_who_configure.mo +0 -0
  21. data/locale/cs_CZ/foreman_virt_who_configure.edit.po +628 -0
  22. data/locale/cs_CZ/foreman_virt_who_configure.po +0 -3
  23. data/locale/cs_CZ/foreman_virt_who_configure.po.time_stamp +0 -0
  24. data/locale/de/LC_MESSAGES/foreman_virt_who_configure.mo +0 -0
  25. data/locale/de/foreman_virt_who_configure.edit.po +638 -0
  26. data/locale/de/foreman_virt_who_configure.po +0 -3
  27. data/locale/de/foreman_virt_who_configure.po.time_stamp +0 -0
  28. data/locale/de_DE/foreman_virt_who_configure.edit.po +624 -0
  29. data/locale/de_DE/foreman_virt_who_configure.po +0 -3
  30. data/locale/de_DE/foreman_virt_who_configure.po.time_stamp +0 -0
  31. data/locale/el/foreman_virt_who_configure.edit.po +621 -0
  32. data/locale/el/foreman_virt_who_configure.po +0 -3
  33. data/locale/el/foreman_virt_who_configure.po.time_stamp +0 -0
  34. data/locale/en/foreman_virt_who_configure.edit.po +617 -0
  35. data/locale/en/foreman_virt_who_configure.po +0 -3
  36. data/locale/en/foreman_virt_who_configure.po.time_stamp +0 -0
  37. data/locale/en_GB/foreman_virt_who_configure.edit.po +623 -0
  38. data/locale/en_GB/foreman_virt_who_configure.po +0 -3
  39. data/locale/en_GB/foreman_virt_who_configure.po.time_stamp +0 -0
  40. data/locale/es/LC_MESSAGES/foreman_virt_who_configure.mo +0 -0
  41. data/locale/es/foreman_virt_who_configure.edit.po +635 -0
  42. data/locale/es/foreman_virt_who_configure.po +0 -3
  43. data/locale/es/foreman_virt_who_configure.po.time_stamp +0 -0
  44. data/locale/foreman_virt_who_configure.pot +4 -7
  45. data/locale/fr/LC_MESSAGES/foreman_virt_who_configure.mo +0 -0
  46. data/locale/fr/foreman_virt_who_configure.edit.po +634 -0
  47. data/locale/fr/foreman_virt_who_configure.po +0 -3
  48. data/locale/fr/foreman_virt_who_configure.po.time_stamp +0 -0
  49. data/locale/gl/foreman_virt_who_configure.edit.po +621 -0
  50. data/locale/gl/foreman_virt_who_configure.po +0 -3
  51. data/locale/gl/foreman_virt_who_configure.po.time_stamp +0 -0
  52. data/locale/gu/foreman_virt_who_configure.edit.po +621 -0
  53. data/locale/gu/foreman_virt_who_configure.po +0 -3
  54. data/locale/gu/foreman_virt_who_configure.po.time_stamp +0 -0
  55. data/locale/he_IL/foreman_virt_who_configure.edit.po +623 -0
  56. data/locale/he_IL/foreman_virt_who_configure.po +0 -3
  57. data/locale/he_IL/foreman_virt_who_configure.po.time_stamp +0 -0
  58. data/locale/hi/foreman_virt_who_configure.edit.po +621 -0
  59. data/locale/hi/foreman_virt_who_configure.po +0 -3
  60. data/locale/hi/foreman_virt_who_configure.po.time_stamp +0 -0
  61. data/locale/it/foreman_virt_who_configure.edit.po +625 -0
  62. data/locale/it/foreman_virt_who_configure.po +0 -3
  63. data/locale/it/foreman_virt_who_configure.po.time_stamp +0 -0
  64. data/locale/ja/LC_MESSAGES/foreman_virt_who_configure.mo +0 -0
  65. data/locale/ja/foreman_virt_who_configure.edit.po +632 -0
  66. data/locale/ja/foreman_virt_who_configure.po +0 -3
  67. data/locale/ja/foreman_virt_who_configure.po.time_stamp +0 -0
  68. data/locale/ka/LC_MESSAGES/foreman_virt_who_configure.mo +0 -0
  69. data/locale/ka/foreman_virt_who_configure.edit.po +628 -0
  70. data/locale/ka/foreman_virt_who_configure.po +0 -3
  71. data/locale/ka/foreman_virt_who_configure.po.time_stamp +0 -0
  72. data/locale/kn/foreman_virt_who_configure.edit.po +621 -0
  73. data/locale/kn/foreman_virt_who_configure.po +0 -3
  74. data/locale/kn/foreman_virt_who_configure.po.time_stamp +0 -0
  75. data/locale/ko/foreman_virt_who_configure.edit.po +623 -0
  76. data/locale/ko/foreman_virt_who_configure.po +0 -3
  77. data/locale/ko/foreman_virt_who_configure.po.time_stamp +0 -0
  78. data/locale/mr/foreman_virt_who_configure.edit.po +621 -0
  79. data/locale/mr/foreman_virt_who_configure.po +0 -3
  80. data/locale/mr/foreman_virt_who_configure.po.time_stamp +0 -0
  81. data/locale/nl_NL/foreman_virt_who_configure.edit.po +626 -0
  82. data/locale/nl_NL/foreman_virt_who_configure.po +0 -3
  83. data/locale/nl_NL/foreman_virt_who_configure.po.time_stamp +0 -0
  84. data/locale/or/foreman_virt_who_configure.edit.po +621 -0
  85. data/locale/or/foreman_virt_who_configure.po +0 -3
  86. data/locale/or/foreman_virt_who_configure.po.time_stamp +0 -0
  87. data/locale/pa/foreman_virt_who_configure.edit.po +622 -0
  88. data/locale/pa/foreman_virt_who_configure.po +0 -3
  89. data/locale/pa/foreman_virt_who_configure.po.time_stamp +0 -0
  90. data/locale/pl/foreman_virt_who_configure.edit.po +624 -0
  91. data/locale/pl/foreman_virt_who_configure.po +0 -3
  92. data/locale/pl/foreman_virt_who_configure.po.time_stamp +0 -0
  93. data/locale/pt/foreman_virt_who_configure.edit.po +622 -0
  94. data/locale/pt/foreman_virt_who_configure.po +0 -3
  95. data/locale/pt/foreman_virt_who_configure.po.time_stamp +0 -0
  96. data/locale/pt_BR/LC_MESSAGES/foreman_virt_who_configure.mo +0 -0
  97. data/locale/pt_BR/foreman_virt_who_configure.edit.po +634 -0
  98. data/locale/pt_BR/foreman_virt_who_configure.po +0 -3
  99. data/locale/pt_BR/foreman_virt_who_configure.po.time_stamp +0 -0
  100. data/locale/ru/foreman_virt_who_configure.edit.po +627 -0
  101. data/locale/ru/foreman_virt_who_configure.po +0 -3
  102. data/locale/ru/foreman_virt_who_configure.po.time_stamp +0 -0
  103. data/locale/sl/foreman_virt_who_configure.edit.po +622 -0
  104. data/locale/sl/foreman_virt_who_configure.po +0 -3
  105. data/locale/sl/foreman_virt_who_configure.po.time_stamp +0 -0
  106. data/locale/sv_SE/foreman_virt_who_configure.edit.po +623 -0
  107. data/locale/sv_SE/foreman_virt_who_configure.po +0 -3
  108. data/locale/sv_SE/foreman_virt_who_configure.po.time_stamp +0 -0
  109. data/locale/ta/foreman_virt_who_configure.edit.po +621 -0
  110. data/locale/ta/foreman_virt_who_configure.po +0 -3
  111. data/locale/ta/foreman_virt_who_configure.po.time_stamp +0 -0
  112. data/locale/ta_IN/foreman_virt_who_configure.edit.po +622 -0
  113. data/locale/ta_IN/foreman_virt_who_configure.po +0 -3
  114. data/locale/ta_IN/foreman_virt_who_configure.po.time_stamp +0 -0
  115. data/locale/te/foreman_virt_who_configure.edit.po +621 -0
  116. data/locale/te/foreman_virt_who_configure.po +0 -3
  117. data/locale/te/foreman_virt_who_configure.po.time_stamp +0 -0
  118. data/locale/tr/foreman_virt_who_configure.edit.po +621 -0
  119. data/locale/tr/foreman_virt_who_configure.po +0 -3
  120. data/locale/tr/foreman_virt_who_configure.po.time_stamp +0 -0
  121. data/locale/zh_CN/LC_MESSAGES/foreman_virt_who_configure.mo +0 -0
  122. data/locale/zh_CN/foreman_virt_who_configure.edit.po +633 -0
  123. data/locale/zh_CN/foreman_virt_who_configure.po +0 -3
  124. data/locale/zh_CN/foreman_virt_who_configure.po.time_stamp +0 -0
  125. data/locale/zh_TW/foreman_virt_who_configure.edit.po +623 -0
  126. data/locale/zh_TW/foreman_virt_who_configure.po +0 -3
  127. data/locale/zh_TW/foreman_virt_who_configure.po.time_stamp +0 -0
  128. data/test/functional/api/v2/configs_controller_test.rb +21 -0
  129. data/test/unit/output_generator_test.rb +3 -3
  130. metadata +80 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 440065d1546034aad5444c97c65f80d75b516aa020a4b39b7cd2de7be606156f
4
- data.tar.gz: 2a916a56cd2cb7735770eb46a3d47b05e99077f9cb3a3dc015487bf20ce527a7
3
+ metadata.gz: 22ea7c1f01f0e5903a2f219b5be36745a0c229b5471f2538ab88e65dc8117ff0
4
+ data.tar.gz: 1d53ba8208462ef5c2c01c67c18c1b37523effdfb9bfc3bee174e64aa86e2a18
5
5
  SHA512:
6
- metadata.gz: cb3daff17402b052f18ebd870055609fb3a43550b2b07bc53be212af51cce76e492efd3c6b4fac95ef81ddbe992641aa8bf139db0dec56ac14911114329a575b
7
- data.tar.gz: 39538b399466371a389305e163958c1018e0b24139a077fbeb4d1664724c338b1c39c87f9681b296d7c2652d87421be96851c57a7ba46e185578a1bc5e923955
6
+ metadata.gz: 5032cbca7e710798ca4061d88c5d2de7b001aa6acd39c54227d049b68321c8c35dbf50d3bbe1907821faa7d0363224f3fe9e60655f7240314bd279aab49df209
7
+ data.tar.gz: 96acfb4d9ca5099569c7a149c1c3b809595cb0ccf52f7bc6338ca8684318c1080170031b65374fc8e214dab9dd5636bc43ccab7aa85b6bfff6ec923a8e3775c8
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
- This plugins 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,
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 configurations" menu added in "Infrastructure" tab. The "Virt-who configurations" -> "Create Config" provides options to add details about configuration, most of the fields are having inline help.
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 configurations" list page, "Overview" page shows details about configuration and "Deploy page" has all details on deploying configuration.
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) 2023 - Foreman team
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
data/Rakefile CHANGED
@@ -20,7 +20,7 @@ RDoc::Task.new(:rdoc) do |rdoc|
20
20
  rdoc.rdoc_files.include('lib/**/*.rb')
21
21
  end
22
22
 
23
- APP_RAKEFILE = File.expand_path('../test/dummy/Rakefile', __FILE__)
23
+ APP_RAKEFILE = File.expand_path('test/dummy/Rakefile', __dir__)
24
24
 
25
25
  Bundler::GemHelper.install_tasks
26
26
 
@@ -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') {
@@ -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")
@@ -131,8 +131,10 @@ module ForemanVirtWhoConfigure
131
131
  ### manual edits will be deleted.
132
132
  [global]
133
133
  debug=#{config.debug? ? 1 : 0}
134
- interval=#{config.interval * 60}#{proxy_strings}
134
+ interval=#{config.interval * 60}
135
135
  oneshot=False
136
+
137
+ [system_environment]#{proxy_strings}
136
138
  EOF
137
139
  if [ $? -ne 0 ]; then result_code=$(($result_code|#{error_code(:virt_who_sysconfig_file_issue)})); fi
138
140
 
@@ -289,7 +291,6 @@ encrypted_password=$cr_password"
289
291
  output = ''
290
292
  output << "\n#{proxy_type}=#{sanitize_proxy(proxy.full_url)}" if proxy.present?
291
293
  output << "\nno_proxy=#{sanitize_proxy(no_proxy)}" if no_proxy.present?
292
- output << "\nno_proxy=*" if proxy.blank? && no_proxy.blank?
293
294
  output
294
295
  end
295
296
 
@@ -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.
@@ -18,7 +18,7 @@
18
18
  <%= textarea_f f, :exclude_host_parents, inline_help_popover(_('Exclude hosts which cluster ID is specified in comma-separated list in this option will <b>NOT</b> be reported. PowerCLI command to find the domain names in VMware <code>Get-Cluster “ClusterName” | Select ID</code>. Wildcards and regular expressions are supported, multiple records must be separated by comma. Put the value into the double-quotes if it contains special characters like comma. All new line characters will be removed in resulting configuration file, white spaces are removed from beginning and end.')).merge(:label => _('Exclude host parents')) %>
19
19
 
20
20
  <%= checkbox_f f, :debug, { :label => _('Enable debugging output') }.merge(inline_help_popover(_("Different debug value can't be set per hypervisor, therefore it will affect all other deployed configurations on the host on which this configuration will be deployed."))) %>
21
- <%= select_f f, :http_proxy_id, HttpProxy.all, :id, :full_url, {:include_blank => true}, { :label => _('HTTP Proxy') }.merge(
21
+ <%= select_f f, :http_proxy_id, HttpProxy.all, :id, :name, {:include_blank => true}, { :label => _('HTTP Proxy') }.merge(
22
22
  inline_help_popover(_('HTTP proxy that should be used for communication between the server on which virt-who is running and the hypervisors and virtualization managers. Leave this blank if no proxy is used.').html_safe)) %>
23
23
  <%= text_f f, :no_proxy, inline_help_popover(_('A comma-separated list of hostnames or domains or ip addresses to ignore proxy settings for. Optionally this may be set to <code>*</code> to bypass proxy settings for all hostnames domains or ip addresses.')).merge(:label => _('Ignore proxy')) %>
24
24
  <%= text_f f, :kubeconfig_path, inline_help_popover(_('Configuration file containing details about how to connect to the cluster and authentication details')).merge(:label => _('Path to kubeconfig file')) %>
@@ -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 configurations'),
74
+ caption: N_('Virt-who Configurations'),
75
75
  parent: :infrastructure_menu,
76
76
  after: :compute_resources
77
77
 
@@ -1,3 +1,3 @@
1
1
  module ForemanVirtWhoConfigure
2
- VERSION = '0.5.20'.freeze
2
+ VERSION = '0.5.22'.freeze
3
3
  end
@@ -0,0 +1,2 @@
1
+ # Autogenerated!
2
+ _("Report")