foreman_discovery 25.0.1 → 25.1.1

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.
Files changed (88) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/foreman_discovery/locale/ca/foreman_discovery.js +13 -4
  3. data/app/assets/javascripts/foreman_discovery/locale/cs_CZ/foreman_discovery.js +13 -4
  4. data/app/assets/javascripts/foreman_discovery/locale/de/foreman_discovery.js +13 -4
  5. data/app/assets/javascripts/foreman_discovery/locale/es/foreman_discovery.js +14 -5
  6. data/app/assets/javascripts/foreman_discovery/locale/fr/foreman_discovery.js +17 -8
  7. data/app/assets/javascripts/foreman_discovery/locale/gl/foreman_discovery.js +13 -4
  8. data/app/assets/javascripts/foreman_discovery/locale/it/foreman_discovery.js +13 -4
  9. data/app/assets/javascripts/foreman_discovery/locale/ja/foreman_discovery.js +17 -8
  10. data/app/assets/javascripts/foreman_discovery/locale/ka/foreman_discovery.js +13 -4
  11. data/app/assets/javascripts/foreman_discovery/locale/ko/foreman_discovery.js +136 -130
  12. data/app/assets/javascripts/foreman_discovery/locale/pt_BR/foreman_discovery.js +13 -4
  13. data/app/assets/javascripts/foreman_discovery/locale/ru/foreman_discovery.js +13 -4
  14. data/app/assets/javascripts/foreman_discovery/locale/sv_SE/foreman_discovery.js +13 -4
  15. data/app/assets/javascripts/foreman_discovery/locale/zh_CN/foreman_discovery.js +18 -9
  16. data/app/assets/javascripts/foreman_discovery/locale/zh_TW/foreman_discovery.js +13 -4
  17. data/app/controllers/api/v2/discovered_hosts_controller.rb +2 -0
  18. data/app/controllers/concerns/foreman/controller/parameters/discovered_host.rb +41 -35
  19. data/app/controllers/concerns/foreman/controller/parameters/discovery_rule.rb +18 -12
  20. data/app/controllers/discovered_hosts_controller.rb +0 -13
  21. data/app/models/host/discovered.rb +1 -0
  22. data/app/services/foreman_discovery/fact_to_category_resolver.rb +11 -6
  23. data/app/services/foreman_discovery/lldp_neighbors.rb +6 -2
  24. data/app/views/api/v2/discovered_hosts/main.json.rabl +2 -1
  25. data/app/views/discovered_hosts/_discovered_host.html.erb +1 -0
  26. data/app/views/discovered_hosts/_discovered_hosts_list.html.erb +2 -1
  27. data/app/views/discovered_hosts/show.html.erb +3 -1
  28. data/app/views/discovered_mailer/_discovered_host.html.erb +5 -0
  29. data/lib/foreman_discovery/version.rb +1 -1
  30. data/locale/ca/LC_MESSAGES/foreman_discovery.mo +0 -0
  31. data/locale/ca/foreman_discovery.po +13 -4
  32. data/locale/cs_CZ/LC_MESSAGES/foreman_discovery.mo +0 -0
  33. data/locale/cs_CZ/foreman_discovery.po +13 -4
  34. data/locale/de/LC_MESSAGES/foreman_discovery.mo +0 -0
  35. data/locale/de/foreman_discovery.po +13 -4
  36. data/locale/es/LC_MESSAGES/foreman_discovery.mo +0 -0
  37. data/locale/es/foreman_discovery.po +17 -8
  38. data/locale/foreman_discovery.pot +136 -137
  39. data/locale/fr/LC_MESSAGES/foreman_discovery.mo +0 -0
  40. data/locale/fr/foreman_discovery.po +17 -8
  41. data/locale/gl/LC_MESSAGES/foreman_discovery.mo +0 -0
  42. data/locale/gl/foreman_discovery.po +13 -4
  43. data/locale/it/LC_MESSAGES/foreman_discovery.mo +0 -0
  44. data/locale/it/foreman_discovery.po +13 -4
  45. data/locale/ja/LC_MESSAGES/foreman_discovery.mo +0 -0
  46. data/locale/ja/foreman_discovery.po +17 -8
  47. data/locale/ka/LC_MESSAGES/foreman_discovery.mo +0 -0
  48. data/locale/ka/foreman_discovery.po +13 -4
  49. data/locale/ko/LC_MESSAGES/foreman_discovery.mo +0 -0
  50. data/locale/ko/foreman_discovery.po +136 -130
  51. data/locale/pt_BR/LC_MESSAGES/foreman_discovery.mo +0 -0
  52. data/locale/pt_BR/foreman_discovery.po +13 -4
  53. data/locale/ru/LC_MESSAGES/foreman_discovery.mo +0 -0
  54. data/locale/ru/foreman_discovery.po +13 -4
  55. data/locale/sv_SE/LC_MESSAGES/foreman_discovery.mo +0 -0
  56. data/locale/sv_SE/foreman_discovery.po +13 -4
  57. data/locale/zh_CN/LC_MESSAGES/foreman_discovery.mo +0 -0
  58. data/locale/zh_CN/foreman_discovery.po +20 -9
  59. data/locale/zh_TW/LC_MESSAGES/foreman_discovery.mo +0 -0
  60. data/locale/zh_TW/foreman_discovery.po +13 -4
  61. data/test/facts/facts_with_lldp_bond_candidate.json +7 -0
  62. data/test/functional/api/v2/discovered_hosts_controller_test.rb +35 -0
  63. data/test/test_helper_discovery.rb +21 -7
  64. data/test/unit/lldp_neighbors_test.rb +34 -0
  65. metadata +3 -26
  66. data/app/assets/javascripts/foreman_discovery/locale/en/foreman_discovery.js +0 -835
  67. data/app/assets/javascripts/foreman_discovery/locale/en_GB/foreman_discovery.js +0 -835
  68. data/locale/ca/foreman_discovery.edit.po +0 -1122
  69. data/locale/cs_CZ/foreman_discovery.edit.po +0 -1120
  70. data/locale/de/foreman_discovery.edit.po +0 -1129
  71. data/locale/en/LC_MESSAGES/foreman_discovery.mo +0 -0
  72. data/locale/en/foreman_discovery.edit.po +0 -1115
  73. data/locale/en/foreman_discovery.po +0 -834
  74. data/locale/en_GB/LC_MESSAGES/foreman_discovery.mo +0 -0
  75. data/locale/en_GB/foreman_discovery.edit.po +0 -1125
  76. data/locale/en_GB/foreman_discovery.po +0 -839
  77. data/locale/es/foreman_discovery.edit.po +0 -1130
  78. data/locale/fr/foreman_discovery.edit.po +0 -1126
  79. data/locale/gl/foreman_discovery.edit.po +0 -1120
  80. data/locale/it/foreman_discovery.edit.po +0 -1123
  81. data/locale/ja/foreman_discovery.edit.po +0 -1119
  82. data/locale/ka/foreman_discovery.edit.po +0 -1120
  83. data/locale/ko/foreman_discovery.edit.po +0 -1119
  84. data/locale/pt_BR/foreman_discovery.edit.po +0 -1132
  85. data/locale/ru/foreman_discovery.edit.po +0 -1131
  86. data/locale/sv_SE/foreman_discovery.edit.po +0 -1123
  87. data/locale/zh_CN/foreman_discovery.edit.po +0 -1117
  88. data/locale/zh_TW/foreman_discovery.edit.po +0 -1120
@@ -3,7 +3,7 @@
3
3
  "locale_data": {
4
4
  "foreman_discovery": {
5
5
  "": {
6
- "Project-Id-Version": "foreman_discovery 25.0.0",
6
+ "Project-Id-Version": "foreman_discovery 25.1.0",
7
7
  "Report-Msgid-Bugs-To": "",
8
8
  "PO-Revision-Date": "2013-11-15 17:25+0000",
9
9
  "Last-Translator": "Valeria S Silva <valeriassilva@live.com>, 2015",
@@ -374,9 +374,6 @@
374
374
  "IP Address": [
375
375
  "Endereço IP"
376
376
  ],
377
- "IP address": [
378
- "Endereco de IP"
379
- ],
380
377
  "IPAM must be configured for subnet '%s'": [
381
378
  "O IPAM deve ser configurado para a sub-rede '%s'"
382
379
  ],
@@ -386,6 +383,12 @@
386
383
  "IPMI facts": [
387
384
  "Fatos IPMI"
388
385
  ],
386
+ "IPv4": [
387
+ "IPv4"
388
+ ],
389
+ "IPv6": [
390
+ "IPv6"
391
+ ],
389
392
  "Identifier": [
390
393
  "Identificador"
391
394
  ],
@@ -797,6 +800,9 @@
797
800
  "not required if using a subnet with DHCP proxy": [
798
801
  "não necessário se utilizar um subrede com proxy DHCP"
799
802
  ],
803
+ "not required if using an IPv6 subnet with DHCP proxy": [
804
+ ""
805
+ ],
800
806
  "number of entries per request": [
801
807
  "número de entradas por requisições"
802
808
  ],
@@ -821,6 +827,9 @@
821
827
  "required if host is managed and value is not inherited from host group": [
822
828
  "necessário se o host é gerenciado e valor não é herdado do grupo de host"
823
829
  ],
830
+ "required if host is managed, does not have IPv4 IP / Subnet, or the value is not inherited from the host group": [
831
+ ""
832
+ ],
824
833
  "required if not imaged based provisioning and host is managed and value is not inherited from host group": [
825
834
  "solicitado se o provisionamento não for baseado em imagem, o host for gerenciado e o valor não for herdado do grupo de host"
826
835
  ],
@@ -3,7 +3,7 @@
3
3
  "locale_data": {
4
4
  "foreman_discovery": {
5
5
  "": {
6
- "Project-Id-Version": "foreman_discovery 25.0.0",
6
+ "Project-Id-Version": "foreman_discovery 25.1.0",
7
7
  "Report-Msgid-Bugs-To": "",
8
8
  "PO-Revision-Date": "2013-11-15 17:25+0000",
9
9
  "Last-Translator": "Yulia <yulia.poyarkova@redhat.com>, 2016",
@@ -375,9 +375,6 @@
375
375
  "IP Address": [
376
376
  "IP"
377
377
  ],
378
- "IP address": [
379
- "IP-адрес"
380
- ],
381
378
  "IPAM must be configured for subnet '%s'": [
382
379
  ""
383
380
  ],
@@ -387,6 +384,12 @@
387
384
  "IPMI facts": [
388
385
  ""
389
386
  ],
387
+ "IPv4": [
388
+ "IPv4"
389
+ ],
390
+ "IPv6": [
391
+ "IPv6"
392
+ ],
390
393
  "Identifier": [
391
394
  "Идентификатор"
392
395
  ],
@@ -798,6 +801,9 @@
798
801
  "not required if using a subnet with DHCP proxy": [
799
802
  "не требуется, если используется подсеть с DHCP прокси"
800
803
  ],
804
+ "not required if using an IPv6 subnet with DHCP proxy": [
805
+ ""
806
+ ],
801
807
  "number of entries per request": [
802
808
  "количество записей на запрос"
803
809
  ],
@@ -822,6 +828,9 @@
822
828
  "required if host is managed and value is not inherited from host group": [
823
829
  "требуется, если узел уже контролируется, но значение не было унаследовано от группы узлов"
824
830
  ],
831
+ "required if host is managed, does not have IPv4 IP / Subnet, or the value is not inherited from the host group": [
832
+ ""
833
+ ],
825
834
  "required if not imaged based provisioning and host is managed and value is not inherited from host group": [
826
835
  "требуется, если подготовка управляемого узла осуществляется без участия образов и при этом значение не было унаследовано от группы узлов"
827
836
  ],
@@ -3,7 +3,7 @@
3
3
  "locale_data": {
4
4
  "foreman_discovery": {
5
5
  "": {
6
- "Project-Id-Version": "foreman_discovery 25.0.0",
6
+ "Project-Id-Version": "foreman_discovery 25.1.0",
7
7
  "Report-Msgid-Bugs-To": "",
8
8
  "PO-Revision-Date": "2013-11-15 17:25+0000",
9
9
  "Last-Translator": "johnny.westerlund <johnny.westerlund@gmail.com>, 2014",
@@ -371,9 +371,6 @@
371
371
  "IP Address": [
372
372
  "IPadress"
373
373
  ],
374
- "IP address": [
375
- ""
376
- ],
377
374
  "IPAM must be configured for subnet '%s'": [
378
375
  ""
379
376
  ],
@@ -383,6 +380,12 @@
383
380
  "IPMI facts": [
384
381
  ""
385
382
  ],
383
+ "IPv4": [
384
+ ""
385
+ ],
386
+ "IPv6": [
387
+ ""
388
+ ],
386
389
  "Identifier": [
387
390
  ""
388
391
  ],
@@ -794,6 +797,9 @@
794
797
  "not required if using a subnet with DHCP proxy": [
795
798
  ""
796
799
  ],
800
+ "not required if using an IPv6 subnet with DHCP proxy": [
801
+ ""
802
+ ],
797
803
  "number of entries per request": [
798
804
  "antal poster per begäran"
799
805
  ],
@@ -818,6 +824,9 @@
818
824
  "required if host is managed and value is not inherited from host group": [
819
825
  ""
820
826
  ],
827
+ "required if host is managed, does not have IPv4 IP / Subnet, or the value is not inherited from the host group": [
828
+ ""
829
+ ],
821
830
  "required if not imaged based provisioning and host is managed and value is not inherited from host group": [
822
831
  ""
823
832
  ],
@@ -3,10 +3,10 @@
3
3
  "locale_data": {
4
4
  "foreman_discovery": {
5
5
  "": {
6
- "Project-Id-Version": "foreman_discovery 25.0.0",
6
+ "Project-Id-Version": "foreman_discovery 25.1.0",
7
7
  "Report-Msgid-Bugs-To": "",
8
8
  "PO-Revision-Date": "2013-11-15 17:25+0000",
9
- "Last-Translator": "FULL NAME <EMAIL@ADDRESS>",
9
+ "Last-Translator": "Ewoud Kohl van Wijngaarden <ewoud+transifex@kohlvanwijngaarden.nl>, 2024",
10
10
  "Language-Team": "Chinese (China) (http://app.transifex.com/foreman/foreman/language/zh_CN/)",
11
11
  "MIME-Version": "1.0",
12
12
  "Content-Type": "text/plain; charset=UTF-8",
@@ -39,7 +39,7 @@
39
39
  "指定机构"
40
40
  ],
41
41
  "Associated Hosts": [
42
- "关联主机"
42
+ "关联的主机"
43
43
  ],
44
44
  "Auto Provision": [
45
45
  "自动置备"
@@ -159,7 +159,7 @@
159
159
  "现在正在重启发现主机"
160
160
  ],
161
161
  "Discovered hosts from Foreman server at %{foreman_url}": [
162
- "来自 %%{foreman_url} Foreman 服务器的发现主机"
162
+ "来自 %{foreman_url} Foreman 服务器的发现主机"
163
163
  ],
164
164
  "Discovered hosts reported from unknown subnet are %s, communication will not be proxied.": [
165
165
  "从未知子网报告发现的主机为 %s,通信数据将不会被代理。"
@@ -276,7 +276,7 @@
276
276
  "重启主机 %s 失败"
277
277
  ],
278
278
  "Failed to reboot host %{hostname} with error %{error_message}": [
279
- "重启主机 %%{hostname} 失败,错误为 %%{error_message}"
279
+ "重启主机 %{hostname} 失败,错误为 %{error_message}"
280
280
  ],
281
281
  "Failed to reboot hosts with error %s": [
282
282
  "无法重启主机,错误 %s"
@@ -285,7 +285,7 @@
285
285
  "%s 的事实刷新失败"
286
286
  ],
287
287
  "Failed to refresh facts for %{hostname} with error %{error_message}": [
288
- "为 %%{hostname} 刷新事实失败,错误为 %%{error_message}"
288
+ "为 %{hostname} 刷新事实失败,错误为 %{error_message}"
289
289
  ],
290
290
  "For more information please see ": [
291
291
  "查看详情 "
@@ -368,9 +368,6 @@
368
368
  "IP Address": [
369
369
  "IP 地址"
370
370
  ],
371
- "IP address": [
372
- "IP 地址"
373
- ],
374
371
  "IPAM must be configured for subnet '%s'": [
375
372
  "必须为子网 '%s' 配置 IPAM"
376
373
  ],
@@ -380,6 +377,12 @@
380
377
  "IPMI facts": [
381
378
  "IPMI 详情"
382
379
  ],
380
+ "IPv4": [
381
+ "IPv4的"
382
+ ],
383
+ "IPv6": [
384
+ "IPv6的"
385
+ ],
383
386
  "Identifier": [
384
387
  "鉴定"
385
388
  ],
@@ -791,6 +794,9 @@
791
794
  "not required if using a subnet with DHCP proxy": [
792
795
  "如果使用带有 DHCP 代理的子网则不需要"
793
796
  ],
797
+ "not required if using an IPv6 subnet with DHCP proxy": [
798
+ "如果使用带有 DHCP 代理的 IPv6 子网,则不需要"
799
+ ],
794
800
  "number of entries per request": [
795
801
  "每个请求的条目数"
796
802
  ],
@@ -815,6 +821,9 @@
815
821
  "required if host is managed and value is not inherited from host group": [
816
822
  "如果主机是受管的,且值没有从主机组继承,则是必需的"
817
823
  ],
824
+ "required if host is managed, does not have IPv4 IP / Subnet, or the value is not inherited from the host group": [
825
+ "如果主机被管理,没有 IPv4 IP / Subnet,或值不是从主机组继承的,则不需要"
826
+ ],
818
827
  "required if not imaged based provisioning and host is managed and value is not inherited from host group": [
819
828
  "如果不是基于置备镜像的,主机是受管的,且值没有从主机组继承,则是必需的"
820
829
  ],
@@ -3,7 +3,7 @@
3
3
  "locale_data": {
4
4
  "foreman_discovery": {
5
5
  "": {
6
- "Project-Id-Version": "foreman_discovery 25.0.0",
6
+ "Project-Id-Version": "foreman_discovery 25.1.0",
7
7
  "Report-Msgid-Bugs-To": "",
8
8
  "PO-Revision-Date": "2013-11-15 17:25+0000",
9
9
  "Last-Translator": "FULL NAME <EMAIL@ADDRESS>",
@@ -371,9 +371,6 @@
371
371
  "IP Address": [
372
372
  "IP 位址"
373
373
  ],
374
- "IP address": [
375
- "IP 位址"
376
- ],
377
374
  "IPAM must be configured for subnet '%s'": [
378
375
  ""
379
376
  ],
@@ -383,6 +380,12 @@
383
380
  "IPMI facts": [
384
381
  ""
385
382
  ],
383
+ "IPv4": [
384
+ "IPv4"
385
+ ],
386
+ "IPv6": [
387
+ "IPv6"
388
+ ],
386
389
  "Identifier": [
387
390
  "辨識碼"
388
391
  ],
@@ -794,6 +797,9 @@
794
797
  "not required if using a subnet with DHCP proxy": [
795
798
  "若是使用一個含有 DHCP 協定的子網路則不需要"
796
799
  ],
800
+ "not required if using an IPv6 subnet with DHCP proxy": [
801
+ ""
802
+ ],
797
803
  "number of entries per request": [
798
804
  "每個請求的項目數量"
799
805
  ],
@@ -818,6 +824,9 @@
818
824
  "required if host is managed and value is not inherited from host group": [
819
825
  "若主機是個受管理的主機,並且值不是由主機群組所繼承的話便需要"
820
826
  ],
827
+ "required if host is managed, does not have IPv4 IP / Subnet, or the value is not inherited from the host group": [
828
+ ""
829
+ ],
821
830
  "required if not imaged based provisioning and host is managed and value is not inherited from host group": [
822
831
  "若不是基於映像檔的佈建,而主機受管理並且值並非由主機群組所繼承的話便需要"
823
832
  ],
@@ -53,6 +53,7 @@ module Api
53
53
  param :name, String
54
54
  param :environment_id, String, :desc => N_("required if host is managed and value is not inherited from host group")
55
55
  param :ip, String, :desc => N_("not required if using a subnet with DHCP proxy")
56
+ param :ip6, String, :desc => N_("not required if using an IPv6 subnet with DHCP proxy")
56
57
  param :mac, String, :desc => N_("not required if it's a virtual machine")
57
58
  param :architecture_id, :number, :desc => N_("required if host is managed and value is not inherited from host group")
58
59
  param :domain_id, :number, :desc => N_("required if host is managed and value is not inherited from host group")
@@ -62,6 +63,7 @@ module Api
62
63
  param :medium_id, String, :desc => N_("required if not imaged based provisioning and host is managed and value is not inherited from host group")
63
64
  param :ptable_id, :number, :desc => N_("required if host is managed and custom partition has not been defined")
64
65
  param :subnet_id, :number, :desc => N_("required if host is managed and value is not inherited from host group")
66
+ param :subnet6_id, :number, :desc => N_("required if host is managed, does not have IPv4 IP / Subnet, or the value is not inherited from the host group")
65
67
  param :sp_subnet_id, :number
66
68
  param :model_id, :number
67
69
  param :hostgroup_id, :number
@@ -1,43 +1,49 @@
1
- module Foreman::Controller::Parameters::DiscoveredHost
2
- extend ActiveSupport::Concern
3
- include Foreman::Controller::Parameters::Host
4
- if defined?(ForemanPuppet)
5
- include ForemanPuppet::Extensions::ParametersHost
6
- end
1
+ module Foreman
2
+ module Controller
3
+ module Parameters
4
+ module DiscoveredHost
5
+ extend ActiveSupport::Concern
6
+ include Foreman::Controller::Parameters::Host
7
+ if defined?(ForemanPuppet)
8
+ include ForemanPuppet::Extensions::ParametersHost
9
+ end
7
10
 
8
- class_methods do
9
- def discovered_host_params_filter
10
- Foreman::ParameterFilter.new(::Host::Discovered).tap do |filter|
11
- filter.permit :discovery_rule_id
11
+ class_methods do
12
+ def discovered_host_params_filter
13
+ Foreman::ParameterFilter.new(::Host::Discovered).tap do |filter|
14
+ filter.permit :discovery_rule_id
12
15
 
13
- add_host_base_params_filter(filter)
14
- add_host_common_params_filter(filter)
15
- add_host_puppet_params_filter(filter) if defined?(ForemanPuppet)
16
- end
17
- end
18
- end
16
+ add_host_base_params_filter(filter)
17
+ add_host_common_params_filter(filter)
18
+ add_host_puppet_params_filter(filter) if defined?(ForemanPuppet)
19
+ end
20
+ end
21
+ end
19
22
 
20
- def discovered_host_params
21
- filtered_params = self.class.discovered_host_params_filter.filter_params(params, parameter_filter_context)
22
- process_deprecated_puppet_params!(filtered_params) if defined?(ForemanPuppet)
23
- filtered_params
24
- end
23
+ def discovered_host_params
24
+ filtered_params = self.class.discovered_host_params_filter.filter_params(params, parameter_filter_context)
25
+ process_deprecated_puppet_params!(filtered_params) if defined?(ForemanPuppet)
26
+ filtered_params
27
+ end
25
28
 
26
- def discovered_host_params_host
27
- filtered_params = self.class.discovered_host_params_filter.filter_params(params, parameter_filter_context, :host)
28
- process_deprecated_puppet_params!(filtered_params) if defined?(ForemanPuppet)
29
- filtered_params
30
- end
29
+ def discovered_host_params_host
30
+ filtered_params = self.class.discovered_host_params_filter.filter_params(params, parameter_filter_context, :host)
31
+ process_deprecated_puppet_params!(filtered_params) if defined?(ForemanPuppet)
32
+ filtered_params
33
+ end
31
34
 
32
- def managed_host_params_host
33
- filtered_params = self.class.host_params_filter.filter_params(params, parameter_filter_context, :host)
34
- process_deprecated_puppet_params!(filtered_params) if defined?(ForemanPuppet)
35
- filtered_params
36
- end
35
+ def managed_host_params_host
36
+ filtered_params = self.class.host_params_filter.filter_params(params, parameter_filter_context, :host)
37
+ process_deprecated_puppet_params!(filtered_params) if defined?(ForemanPuppet)
38
+ filtered_params
39
+ end
37
40
 
38
- def managed_host_params
39
- filtered_params = self.class.host_params_filter.filter_params(params, parameter_filter_context)
40
- process_deprecated_puppet_params!(filtered_params) if defined?(ForemanPuppet)
41
- filtered_params
41
+ def managed_host_params
42
+ filtered_params = self.class.host_params_filter.filter_params(params, parameter_filter_context)
43
+ process_deprecated_puppet_params!(filtered_params) if defined?(ForemanPuppet)
44
+ filtered_params
45
+ end
46
+ end
47
+ end
42
48
  end
43
49
  end
@@ -1,17 +1,23 @@
1
- module Foreman::Controller::Parameters::DiscoveryRule
2
- extend ActiveSupport::Concern
3
- include Foreman::Controller::Parameters::Taxonomix
1
+ module Foreman
2
+ module Controller
3
+ module Parameters
4
+ module DiscoveryRule
5
+ extend ActiveSupport::Concern
6
+ include Foreman::Controller::Parameters::Taxonomix
4
7
 
5
- class_methods do
6
- def discovery_rule_params_filter
7
- Foreman::ParameterFilter.new(::DiscoveryRule).tap do |filter|
8
- filter.permit :name, :search, :hostname, :priority, :enabled, :hostgroup, :hostgroup_id, :max_count
9
- add_taxonomix_params_filter(filter)
8
+ class_methods do
9
+ def discovery_rule_params_filter
10
+ Foreman::ParameterFilter.new(::DiscoveryRule).tap do |filter|
11
+ filter.permit :name, :search, :hostname, :priority, :enabled, :hostgroup, :hostgroup_id, :max_count
12
+ add_taxonomix_params_filter(filter)
13
+ end
14
+ end
15
+ end
16
+
17
+ def discovery_rule_params
18
+ self.class.discovery_rule_params_filter.filter_params(params, parameter_filter_context)
19
+ end
10
20
  end
11
21
  end
12
22
  end
13
-
14
- def discovery_rule_params
15
- self.class.discovery_rule_params_filter.filter_params(params, parameter_filter_context)
16
- end
17
23
  end
@@ -335,19 +335,6 @@ class DiscoveredHostsController < ::ApplicationController
335
335
  Bullet.enable = true if defined? Bullet
336
336
  end
337
337
 
338
- def get_interfaces
339
- @host.interfaces.each do |interface|
340
- @interfaces << {:identifier => interface["identifier"], :type => interface["type"], :mac => interface["mac"], :ip => interface["ip"]? interface["ip"] : "N/A", :primary => interface["primary"], :provision => interface["provision"]}
341
- end
342
- end
343
-
344
- def add_custom_facts
345
- unless @host.primary_interface.subnet.nil?
346
- discovery_subnet = "#{@host.primary_interface.subnet.name} (#{@host.primary_interface.subnet.network})"
347
- assign_fact_to_category("discovery_subnet", discovery_subnet)
348
- end
349
- end
350
-
351
338
  def process_warning(hash = {})
352
339
  warning hash[:warning_msg]
353
340
  end
@@ -18,6 +18,7 @@ class Host::Discovered < ::Host::Base
18
18
  scoped_search :on => :created_at, :default_order => :desc, :only_explicit => true
19
19
  scoped_search :on => :last_report, :complete_value => true, :only_explicit => true
20
20
  scoped_search :relation => :primary_interface, :on => :ip, :complete_value => true
21
+ scoped_search :relation => :primary_interface, :on => :ip6, :complete_value => true
21
22
  scoped_search :relation => :primary_interface, :on => :mac, :complete_value => true
22
23
  scoped_search :relation => :model, :on => :name, :complete_value => true, :rename => :model, :only_explicit => true
23
24
  scoped_search :relation => :fact_values, :on => :value, :in_key => :fact_names, :on_key => :name, :rename => :facts, :complete_value => true, :only_explicit => true
@@ -33,7 +33,8 @@ module ForemanDiscovery
33
33
  identifier: interface["identifier"],
34
34
  type: interface["type"],
35
35
  mac: interface["mac"],
36
- ip: interface["ip"] || "N/A",
36
+ ip: interface["ip"],
37
+ ip6: interface["ip6"],
37
38
  primary: interface["primary"],
38
39
  provision: interface["provision"],
39
40
  }
@@ -50,10 +51,7 @@ module ForemanDiscovery
50
51
  assign_fact_to_category(key, value)
51
52
  end
52
53
 
53
- return if host.primary_interface.subnet.nil?
54
-
55
- discovery_subnet = "#{host.primary_interface.subnet.name} (#{host.primary_interface.subnet.network})"
56
- assign_fact_to_category("discovery_subnet", discovery_subnet)
54
+ subnets_facts(host.primary_interface)
57
55
  end
58
56
 
59
57
  def assign_fact_to_category(key, value)
@@ -74,6 +72,14 @@ module ForemanDiscovery
74
72
  end
75
73
  end
76
74
 
75
+ def subnets_facts(iface)
76
+ subnet4 = iface.subnet
77
+ subnet6 = iface.subnet6
78
+
79
+ assign_fact_to_category("discovery_subnet", "#{subnet4.name} (#{subnet4.network})") if subnet4
80
+ assign_fact_to_category("discovery_subnet6", "#{subnet6.name} (#{subnet6.network})") if subnet6
81
+ end
82
+
77
83
  def highlights
78
84
  /^(productname|memorysize|manufacturer|architecture|macaddress$|processorcount|physicalprocessorcount|discovery_subnet|discovery_boot|ipaddress$)/
79
85
  end
@@ -103,4 +109,3 @@ module ForemanDiscovery
103
109
  end
104
110
  end
105
111
  end
106
-
@@ -52,15 +52,18 @@ module ForemanDiscovery
52
52
 
53
53
  return if neighbors.nil?
54
54
 
55
- ip = primary.ip
55
+ ip = primary.ip
56
+ ip6 = primary.ip6
56
57
  mac = primary.mac
57
58
  name = primary.name
59
+
58
60
  primary.update(
59
61
  :primary => false,
60
62
  :provision => false,
61
63
  :managed => false,
62
64
  :name => nil,
63
- :ip => nil
65
+ :ip => nil,
66
+ :ip6 => nil
64
67
  )
65
68
 
66
69
  bond = Nic::Bond.create(
@@ -70,6 +73,7 @@ module ForemanDiscovery
70
73
  :provision => true,
71
74
  :name => name,
72
75
  :ip => ip,
76
+ :ip6 => ip6,
73
77
  :mac => mac,
74
78
  :host => host
75
79
  )
@@ -2,7 +2,8 @@ object @discovered_host
2
2
 
3
3
  extends "api/v2/discovered_hosts/base"
4
4
 
5
- attributes :ip, :mac, :last_report, :subnet_id, :subnet_name, :hardware_model_name, :memory, :disk_count, :disks_size
5
+ attributes :ip, :ip6, :mac, :last_report, :subnet_id,
6
+ :subnet_name, :hardware_model_name, :memory, :disk_count, :disks_size
6
7
  attribute :cpu_count => :cpus
7
8
 
8
9
  node :subnet_name do |host|
@@ -1,6 +1,7 @@
1
1
  <td class="ellipsis"><%= link_to (discovery_status_icon(host) + '&nbsp;'.html_safe + trunc_with_tooltip(h(host.name))), discovered_host_path(host) %></td>
2
2
  <td class="hidden-tablet hidden-xs"><%= host.try(:hardware_model_name) || 'N/A' %></td>
3
3
  <td class="hidden-tablet hidden-xs"><%= host.ip %></td>
4
+ <td class="hidden-tablet hidden-xs"><%= host.ip6 %></td>
4
5
  <td class="hidden-tablet hidden-xs"><%= discovery_attribute(host, :cpu_count) %></td>
5
6
  <td class="hidden-tablet hidden-xs"><%= number_to_human_size(discovery_attribute(host, :memory, 0) * 1024 * 1024) %></td>
6
7
  <td class="hidden-tablet hidden-xs"><%= discovery_attribute(host, :disk_count) %></td>
@@ -5,7 +5,8 @@
5
5
  <th class="ca"><%= check_box_tag "check_all", "", false, { :onclick => "tfm.hosts.table.toggleCheck()", :'check-title' => _("Select all items in this page"), :'uncheck-title'=> _("items selected. Uncheck to Clear") } %></th>
6
6
  <th class=''><%= sort :name, :as => _('Name') %></th>
7
7
  <th class="hidden-tablet hidden-xs"><%= sort :model, :as => _('Model') %></th>
8
- <th class="hidden-tablet hidden-xs"><%= sort :ip, :as => _('IP Address') %></th>
8
+ <th class="hidden-tablet hidden-xs"><%= sort :ip, :as => _('IPv4') %></th>
9
+ <th class="hidden-tablet hidden-xs"><%= sort :ip6, :as => _('IPv6') %></th>
9
10
  <th class="hidden-tablet hidden-xs"><%= sort :cpu_count, :as => _('CPUs') %></th>
10
11
  <th class="hidden-tablet hidden-xs"><%= sort :memory, :as => _('Memory') %></th>
11
12
  <th class="hidden-tablet hidden-xs"><%= sort :disk_count, :as => _('Disk Count') %></th>
@@ -44,7 +44,8 @@
44
44
  <th class="hidden-xs " width="12%"><%= _('Type') %></th>
45
45
  <th class="hidden-xs "><%= _('Identifier') %></th>
46
46
  <th class="hidden-xs "><%= _("MAC address") %></th>
47
- <th class="hidden-xs "><%= _("IP address") %></th>
47
+ <th class="hidden-xs "><%= _("IPv4") %></th>
48
+ <th class="hidden-xs "><%= _("IPv6") %></th>
48
49
  </tr>
49
50
  <% @interfaces.each do |interface| %>
50
51
  <tr>
@@ -52,6 +53,7 @@
52
53
  <td class="ellipsis"><%= interface[:identifier] %></td>
53
54
  <td class="ellipsis"><%= interface[:mac] %></td>
54
55
  <td class="ellipsis"><%= interface[:ip] %></td>
56
+ <td class="ellipsis"><%= interface[:ip6] %></td>
55
57
  </tr>
56
58
  <% end %>
57
59
  </table>
@@ -3,7 +3,12 @@
3
3
  <%= link_to host, discovered_host_url(:id => host, :host => @url.host, :port => @url.port, :only_path => false, :protocol => @url.scheme) %>
4
4
  </td>
5
5
  <td style="<%= td_style%>"><%= host.try(:hardware_model_name) || 'N/A' %></td>
6
+ <% if host.ip %>
6
7
  <td style="<%= td_style%>"><%= host.ip %></td>
8
+ <% end %>
9
+ <% if host.ip6 %>
10
+ <td style="<%= td_style%>"><%= host.ip6 %></td>
11
+ <% end %>
7
12
  <td style="<%= td_style%>"><%= discovery_attribute(host, :cpu_count) %></td>
8
13
  <td style="<%= td_style%>"><%= number_to_human_size(discovery_attribute(host, :memory, 0) * 1024 * 1024) %></td>
9
14
  <td style="<%= td_style%>"><%= discovery_attribute(host, :disk_count) %></td>
@@ -1,3 +1,3 @@
1
1
  module ForemanDiscovery
2
- VERSION = "25.0.1"
2
+ VERSION = "25.1.1"
3
3
  end
@@ -7,7 +7,7 @@
7
7
  # Robert Antoni Buj i Gelonch <rbuj@fedoraproject.org>, 2015-2016
8
8
  msgid ""
9
9
  msgstr ""
10
- "Project-Id-Version: foreman_discovery 25.0.0\n"
10
+ "Project-Id-Version: foreman_discovery 25.1.0\n"
11
11
  "Report-Msgid-Bugs-To: \n"
12
12
  "PO-Revision-Date: 2013-11-15 17:25+0000\n"
13
13
  "Last-Translator: Robert Antoni Buj i Gelonch <rbuj@fedoraproject.org>, 2017\n"
@@ -376,9 +376,6 @@ msgstr ""
376
376
  msgid "IP Address"
377
377
  msgstr "Adreça IP"
378
378
 
379
- msgid "IP address"
380
- msgstr "Adreça IP"
381
-
382
379
  msgid "IPAM must be configured for subnet '%s'"
383
380
  msgstr ""
384
381
 
@@ -388,6 +385,12 @@ msgstr ""
388
385
  msgid "IPMI facts"
389
386
  msgstr ""
390
387
 
388
+ msgid "IPv4"
389
+ msgstr ""
390
+
391
+ msgid "IPv6"
392
+ msgstr ""
393
+
391
394
  msgid "Identifier"
392
395
  msgstr "Identificador"
393
396
 
@@ -799,6 +802,9 @@ msgstr ""
799
802
  msgid "not required if using a subnet with DHCP proxy"
800
803
  msgstr "no es requereix si s'està utilitzant una subxarxa amb servidor intermediari DHCP"
801
804
 
805
+ msgid "not required if using an IPv6 subnet with DHCP proxy"
806
+ msgstr ""
807
+
802
808
  msgid "number of entries per request"
803
809
  msgstr "Nombre d'entrades per petició"
804
810
 
@@ -823,6 +829,9 @@ msgstr "es requereix si l'amfitrió està gestionat i no s'ha definit la partici
823
829
  msgid "required if host is managed and value is not inherited from host group"
824
830
  msgstr ""
825
831
 
832
+ msgid "required if host is managed, does not have IPv4 IP / Subnet, or the value is not inherited from the host group"
833
+ msgstr ""
834
+
826
835
  msgid "required if not imaged based provisioning and host is managed and value is not inherited from host group"
827
836
  msgstr ""
828
837