foreman_bootdisk 22.0.0 → 22.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/foreman_bootdisk/locale/ca/foreman_bootdisk.js +108 -120
  3. data/app/assets/javascripts/foreman_bootdisk/locale/cs_CZ/foreman_bootdisk.js +105 -117
  4. data/app/assets/javascripts/foreman_bootdisk/locale/de/foreman_bootdisk.js +158 -170
  5. data/app/assets/javascripts/foreman_bootdisk/locale/en/foreman_bootdisk.js +85 -97
  6. data/app/assets/javascripts/foreman_bootdisk/locale/en_GB/foreman_bootdisk.js +157 -169
  7. data/app/assets/javascripts/foreman_bootdisk/locale/es/foreman_bootdisk.js +158 -170
  8. data/app/assets/javascripts/foreman_bootdisk/locale/fr/foreman_bootdisk.js +158 -170
  9. data/app/assets/javascripts/foreman_bootdisk/locale/it/foreman_bootdisk.js +118 -130
  10. data/app/assets/javascripts/foreman_bootdisk/locale/ja/foreman_bootdisk.js +157 -169
  11. data/app/assets/javascripts/foreman_bootdisk/locale/ka/foreman_bootdisk.js +157 -169
  12. data/app/assets/javascripts/foreman_bootdisk/locale/ko/foreman_bootdisk.js +158 -170
  13. data/app/assets/javascripts/foreman_bootdisk/locale/pt_BR/foreman_bootdisk.js +157 -169
  14. data/app/assets/javascripts/foreman_bootdisk/locale/ru/foreman_bootdisk.js +131 -143
  15. data/app/assets/javascripts/foreman_bootdisk/locale/sv_SE/foreman_bootdisk.js +103 -115
  16. data/app/assets/javascripts/foreman_bootdisk/locale/zh_CN/foreman_bootdisk.js +156 -168
  17. data/app/assets/javascripts/foreman_bootdisk/locale/zh_TW/foreman_bootdisk.js +129 -141
  18. data/app/lib/foreman_bootdisk/scope/bootdisk.rb +0 -42
  19. data/app/lib/foreman_bootdisk/template_helpers.rb +48 -0
  20. data/lib/foreman_bootdisk/engine.rb +3 -1
  21. data/lib/foreman_bootdisk/engine.rb.orig +159 -0
  22. data/lib/foreman_bootdisk/version.rb +1 -1
  23. data/locale/Makefile +12 -2
  24. data/locale/ca/LC_MESSAGES/foreman_bootdisk.mo +0 -0
  25. data/locale/ca/foreman_bootdisk.po +1 -13
  26. data/locale/cs_CZ/LC_MESSAGES/foreman_bootdisk.mo +0 -0
  27. data/locale/cs_CZ/foreman_bootdisk.po +30 -40
  28. data/locale/de/LC_MESSAGES/foreman_bootdisk.mo +0 -0
  29. data/locale/de/foreman_bootdisk.po +3 -15
  30. data/locale/en/LC_MESSAGES/foreman_bootdisk.mo +0 -0
  31. data/locale/en/foreman_bootdisk.po +9 -19
  32. data/locale/en_GB/LC_MESSAGES/foreman_bootdisk.mo +0 -0
  33. data/locale/en_GB/foreman_bootdisk.po +1 -13
  34. data/locale/es/LC_MESSAGES/foreman_bootdisk.mo +0 -0
  35. data/locale/es/foreman_bootdisk.po +6 -16
  36. data/locale/fr/LC_MESSAGES/foreman_bootdisk.mo +0 -0
  37. data/locale/fr/foreman_bootdisk.po +6 -16
  38. data/locale/it/LC_MESSAGES/foreman_bootdisk.mo +0 -0
  39. data/locale/it/foreman_bootdisk.po +1 -13
  40. data/locale/ja/LC_MESSAGES/foreman_bootdisk.mo +0 -0
  41. data/locale/ja/foreman_bootdisk.po +7 -18
  42. data/locale/ka/LC_MESSAGES/foreman_bootdisk.mo +0 -0
  43. data/locale/ka/foreman_bootdisk.po +1 -13
  44. data/locale/ko/LC_MESSAGES/foreman_bootdisk.mo +0 -0
  45. data/locale/ko/foreman_bootdisk.po +47 -59
  46. data/locale/pt_BR/LC_MESSAGES/foreman_bootdisk.mo +0 -0
  47. data/locale/pt_BR/foreman_bootdisk.po +1 -13
  48. data/locale/ru/LC_MESSAGES/foreman_bootdisk.mo +0 -0
  49. data/locale/ru/foreman_bootdisk.po +1 -13
  50. data/locale/sv_SE/LC_MESSAGES/foreman_bootdisk.mo +0 -0
  51. data/locale/sv_SE/foreman_bootdisk.po +1 -13
  52. data/locale/zh_CN/LC_MESSAGES/foreman_bootdisk.mo +0 -0
  53. data/locale/zh_CN/foreman_bootdisk.po +2 -14
  54. data/locale/zh_TW/LC_MESSAGES/foreman_bootdisk.mo +0 -0
  55. data/locale/zh_TW/foreman_bootdisk.po +1 -13
  56. metadata +4 -3
  57. data/locale/action_names.rb +0 -5
@@ -3,7 +3,7 @@
3
3
  "locale_data": {
4
4
  "foreman_bootdisk": {
5
5
  "": {
6
- "Project-Id-Version": "foreman_bootdisk 21.0.4",
6
+ "Project-Id-Version": "foreman_bootdisk 22.0.0",
7
7
  "Report-Msgid-Bugs-To": "",
8
8
  "PO-Revision-Date": "2014-02-13 12:12+0000",
9
9
  "Last-Translator": "FULL NAME <EMAIL@ADDRESS>",
@@ -17,263 +17,251 @@
17
17
  "domain": "foreman_bootdisk",
18
18
  "plural_forms": "nplurals=1; plural=0;"
19
19
  },
20
- "This type of bootdisk is not allowed. Please contact administrator.": [
20
+ "* - These bootdisk types were disabled, you can enable them in Administer - Settings.": [
21
21
  ""
22
22
  ],
23
- "Boot disks": [
24
- "開機磁碟"
25
- ],
26
- "Download generic image": [
27
- "下載泛型映像檔"
28
- ],
29
- "Download host image": [
30
- "下載主機映像檔"
23
+ "A variant of the per-host image which contains the OS bootloader embedded inside the disk. This may be useful if chainloading fails on certain hardware, but has the downside that the image must be regenerated for any change in the OS, bootloader or PXELinux templates.": [
24
+ "個別主機映像檔的變體,磁碟中嵌入了 OS 的開機載入程式。這對於在特定硬體上的 chainloading 失敗時特別有幫助,不過缺點就是若要對 OS、開機載入程式或 PXELinux 範本進行任何更改,映像檔就必須重新產生。"
31
25
  ],
32
- "True for full, false for basic reusable image": [
33
- "「true」代表完整,「false」則代表可重複使用的基本映像檔"
26
+ "All images are usable as either ISOs or as disk images, including being written to a USB disk with `dd`.": [
27
+ "所有映像檔皆能作為 ISO 或是磁碟映像檔使用,包括以 `dd` 寫入一個 USB 磁碟中。"
34
28
  ],
35
- "Host is not in build mode": [
29
+ "Allowed bootdisk types": [
36
30
  ""
37
31
  ],
38
- "Subnet boot disks": [
39
- "子網路開機磁碟"
40
- ],
41
- "Download subnet generic image": [
42
- "下載子網路泛型映像檔"
43
- ],
44
- "TFTP feature not enabled for subnet %s": [
45
- "TFTP 功能並未啟動給子網路 %s 使用"
46
- ],
47
- "Host is not in build mode.": [
32
+ "Attach ISO image to CDROM drive for %s": [
48
33
  ""
49
34
  ],
50
- "Failed to render boot disk template": [
51
- "轉譯開機磁碟範本失敗"
52
- ],
53
- "Host '%s' image": [
54
- "主機「%s」映像檔"
55
- ],
56
- "Full host '%s' image": [
57
- "完整的主機 '%s' 映像檔"
35
+ "Back": [
36
+ "上一步"
58
37
  ],
59
- "Boot disk help": [
60
- ""
38
+ "Boot disk": [
39
+ "開機磁碟"
61
40
  ],
62
41
  "Boot disk Help": [
63
42
  ""
64
43
  ],
65
- "Boot disk": [
66
- "開機磁碟"
44
+ "Boot disk based": [
45
+ ""
67
46
  ],
68
47
  "Boot disk download not available for %s architecture": [
69
48
  ""
70
49
  ],
71
- "Subnet '%s' generic image": [
72
- "子網路「%s」泛型映像檔"
73
- ],
74
- "Subnet generic image": [
50
+ "Boot disk help": [
75
51
  ""
76
52
  ],
77
- "Generic image": [
78
- "泛型映像檔"
53
+ "Boot disks": [
54
+ "開機磁碟"
79
55
  ],
80
- "Unable to find template specified by %s setting": [
81
- "找不到 %s 設定所指定的範本"
56
+ "Command to generate ISO image, use genisoimage or mkisofs": [
57
+ "請使用 genisoimage 或是 mkisofs 來作為產生 ISO 映像檔的指令"
82
58
  ],
83
- "Generating ISO image for %s": [
59
+ "Creating new image failed, install truncate utility": [
84
60
  ""
85
61
  ],
86
- "Upload ISO image to datastore for %s": [
62
+ "Detach ISO image from CDROM drive for %s": [
87
63
  ""
88
64
  ],
89
- "Attach ISO image to CDROM drive for %s": [
90
- ""
65
+ "Download generic image": [
66
+ "下載泛型映像檔"
91
67
  ],
92
- "Detach ISO image from CDROM drive for %s": [
93
- ""
68
+ "Download host image": [
69
+ "下載主機映像檔"
94
70
  ],
95
- "Failed to generate ISO image for instance %{name}: %{message}": [
96
- ""
71
+ "Download subnet generic image": [
72
+ "下載子網路泛型映像檔"
97
73
  ],
98
- "Failed to upload ISO image for instance %{name}: %{message}": [
74
+ "Ensure %{file} is readable (or update \\\"Grub2 directory\\\" setting)": [
99
75
  ""
100
76
  ],
101
77
  "Failed to attach ISO image to CDROM drive of instance %{name}: %{message}": [
102
78
  ""
103
79
  ],
104
- "Failed to detach ISO image from CDROM drive of instance %{name}: %{message}": [
80
+ "Failed to create a directory within the ESP image": [
105
81
  ""
106
82
  ],
107
- "Host is not in build mode, so the template cannot be rendered": [
108
- "主機不在組建模式下,因此無法編寫範本"
109
- ],
110
- "Unable to generate disk template, %{kind} template not found.": [
83
+ "Failed to detach ISO image from CDROM drive of instance %{name}: %{message}": [
111
84
  ""
112
85
  ],
113
- "Unable to generate disk %{kind} template: %{error}": [
86
+ "Failed to format the ESP image via mkfs.msdos": [
114
87
  ""
115
88
  ],
116
- "Please ensure the isolinux/syslinux package(s) are installed.": [
89
+ "Failed to generate ISO image for instance %{name}: %{message}": [
117
90
  ""
118
91
  ],
119
- "Please ensure the ipxe-bootimgs package is installed.": [
120
- ""
92
+ "Failed to render boot disk template": [
93
+ "轉譯開機磁碟範本失敗"
121
94
  ],
122
- "Creating new image failed, install truncate utility": [
95
+ "Failed to upload ISO image for instance %{name}: %{message}": [
123
96
  ""
124
97
  ],
125
- "Failed to format the ESP image via mkfs.msdos": [
126
- ""
98
+ "Full host '%s' image": [
99
+ "完整的主機 '%s' 映像檔"
127
100
  ],
128
- "Failed to create a directory within the ESP image": [
129
- ""
101
+ "Full host image": [
102
+ "完整的主機映像檔"
130
103
  ],
131
- "Ensure %{file} is readable (or update \\\"Grub2 directory\\\" setting)": [
104
+ "Generating ISO image for %s": [
132
105
  ""
133
106
  ],
134
- "Unable to mcopy %{file}": [
107
+ "Generic Grub2 EFI image template": [
135
108
  ""
136
109
  ],
137
- "ISO build failed": [
138
- "建立 ISO 失敗"
110
+ "Generic image": [
111
+ "泛型映像檔"
139
112
  ],
140
- "ISO hybrid conversion failed: %s": [
113
+ "Generic image template": [
141
114
  ""
142
115
  ],
143
- "Back": [
144
- "上一步"
145
- ],
146
- "Various types of boot disks can be created to provision hosts without the need for PXE services. Boot disks can be attached to the host (physical or virtual) which boots from the disk, contacts Foreman and begins the OS installation.": [
147
- "您可建立各種不同類型的開機磁碟來在不使用 PXE 服務的情況下佈建主機。開機磁碟能連接至由磁碟開機的主機(實體或虛擬),聯絡 Foreman 並開始進行 OS 的安裝程序。"
116
+ "Generic images": [
117
+ ""
148
118
  ],
149
- "All images are usable as either ISOs or as disk images, including being written to a USB disk with `dd`.": [
150
- "所有映像檔皆能作為 ISO 或是磁碟映像檔使用,包括以 `dd` 寫入一個 USB 磁碟中。"
119
+ "Generic images are a reusable disk image that works for any host registered in Foreman. It requires a basic DHCP and DNS service to function and contact the server, but does not require DHCP reservations or static IP addresses.": [
120
+ "泛型映像檔是個可重複使用的磁碟映像檔,並且可使用於任何向 Foreman 註冊過的主機上。它需要一項基本的 DHCP DNS 服務才能運作和聯絡伺服器,不過並不需要 DHCP 預留或靜態 IP 位址。"
151
121
  ],
152
- "Host images": [
122
+ "Grub2 directory": [
153
123
  ""
154
124
  ],
155
- "These images are used for host. You can find them at host detail page.": [
156
- ""
125
+ "Host '%s' image": [
126
+ "主機「%s」映像檔"
157
127
  ],
158
128
  "Host image": [
159
129
  "主機映像檔"
160
130
  ],
161
- "Per-host images contain data about a particular host registered in Foreman and set up fully static networking, avoiding the requirement for DHCP. After networking is configured, they chainload from Foreman, picking up the current OS configuration and build state from the server.": [
162
- "個別主機的映像檔包含了有關於向 Foreman 註冊的特定主機的資料,並且會設置完整靜態的網路,以避免需要使用到 DHCP。在配置了網路後,它們便會由 Foreman 進行 chainload,取得目前的 OS 配置,並由伺服器建立狀態。"
131
+ "Host image template": [
132
+ ""
163
133
  ],
164
- "Once chainloaded, the OS bootloader and installer are downloaded directly from the installation media configured in Foreman, and the provisioning script (kickstart/preseed) is downloaded from Foreman.": [
165
- "在 chainload 之後,OS 開機載入程式和安裝程式將會直接從 Foreman 中所配置的安裝媒介下載,而佈建 script(kickstart/preseed)則會由 Foreman 下載。"
134
+ "Host images": [
135
+ ""
166
136
  ],
167
- "Full host image": [
168
- "完整的主機映像檔"
137
+ "Host is not in build mode": [
138
+ ""
169
139
  ],
170
- "A variant of the per-host image which contains the OS bootloader embedded inside the disk. This may be useful if chainloading fails on certain hardware, but has the downside that the image must be regenerated for any change in the OS, bootloader or PXELinux templates.": [
171
- "個別主機映像檔的變體,磁碟中嵌入了 OS 的開機載入程式。這對於在特定硬體上的 chainloading 失敗時特別有幫助,不過缺點就是若要對 OS、開機載入程式或 PXELinux 範本進行任何更改,映像檔就必須重新產生。"
140
+ "Host is not in build mode, so the template cannot be rendered": [
141
+ "主機不在組建模式下,因此無法編寫範本"
172
142
  ],
173
- "Generic images": [
143
+ "Host is not in build mode.": [
174
144
  ""
175
145
  ],
176
- "These images are more generic than previous images. You can find them at subnet index page.": [
177
- ""
146
+ "ISO build failed": [
147
+ "建立 ISO 失敗"
178
148
  ],
179
- "Generic images are a reusable disk image that works for any host registered in Foreman. It requires a basic DHCP and DNS service to function and contact the server, but does not require DHCP reservations or static IP addresses.": [
180
- "泛型映像檔是個可重複使用的磁碟映像檔,並且可使用於任何向 Foreman 註冊過的主機上。它需要一項基本的 DHCP 和 DNS 服務才能運作和聯絡伺服器,不過並不需要 DHCP 預留或靜態 IP 位址。"
149
+ "ISO generation command": [
150
+ ""
181
151
  ],
182
- "The OS install continues using the installation media configured in Foreman, and it will typically configure static networking, depending on how the OS iPXE template is configured.": [
183
- "OS 安裝程序會繼續使用配置於 Foreman 中的安裝媒介,並且它一般會根據 OS iPXE 範本的配置方法來配置靜態網路。"
152
+ "ISO hybrid conversion failed: %s": [
153
+ ""
184
154
  ],
185
- "Subnet image": [
186
- "子網路映像檔"
155
+ "ISOLINUX directory": [
156
+ ""
187
157
  ],
188
- "Subnet images are similar to generic images, but chain-loading is done via the TFTP Smart Proxy assigned to the Subnet of the host. The smart proxy must have the \\\"Templates\\\" module enabled and configured.": [
189
- "子網路映像檔跟泛型映像檔類似,但連鎖載入(chain-loading)是透過 TFTP 智慧型代理指定至主機的子網路。智慧型代理必須啟用並配置了「模版」(Templates)模組。"
158
+ "Installation media caching": [
159
+ ""
190
160
  ],
191
- "This image is generic for all hosts with a provisioning NIC on that subnet.": [
192
- "這映像檔對在該子網路上配有網路卡的所有主機來說,是通用的。"
161
+ "Installation media files will be cached for full host images": [
162
+ "安裝媒介檔案將會被快取以作為完整的主機映像檔"
193
163
  ],
194
- "* - These bootdisk types were disabled, you can enable them in Administer - Settings.": [
164
+ "List of allowed bootdisk types, remove type to disable it": [
195
165
  ""
196
166
  ],
197
- "Boot disk based": [
167
+ "Not available": [
198
168
  ""
199
169
  ],
200
- "iPXE directory": [
170
+ "Once chainloaded, the OS bootloader and installer are downloaded directly from the installation media configured in Foreman, and the provisioning script (kickstart/preseed) is downloaded from Foreman.": [
171
+ "在 chainload 之後,OS 開機載入程式和安裝程式將會直接從 Foreman 中所配置的安裝媒介下載,而佈建 script(kickstart/preseed)則會由 Foreman 下載。"
172
+ ],
173
+ "Path to directory containing grubx64.efi and shimx64.efi": [
201
174
  ""
202
175
  ],
203
176
  "Path to directory containing iPXE images": [
204
177
  "包含 iPXE 映像檔的目錄之路徑"
205
178
  ],
206
- "ISOLINUX directory": [
207
- ""
208
- ],
209
179
  "Path to directory containing isolinux images": [
210
180
  ""
211
181
  ],
212
- "SYSLINUX directory": [
213
- ""
214
- ],
215
182
  "Path to directory containing syslinux images": [
216
183
  "包含 syslinux 映像檔的目錄之路徑"
217
184
  ],
218
- "Grub2 directory": [
219
- ""
185
+ "Per-host images contain data about a particular host registered in Foreman and set up fully static networking, avoiding the requirement for DHCP. After networking is configured, they chainload from Foreman, picking up the current OS configuration and build state from the server.": [
186
+ "個別主機的映像檔包含了有關於向 Foreman 註冊的特定主機的資料,並且會設置完整靜態的網路,以避免需要使用到 DHCP。在配置了網路後,它們便會由 Foreman 進行 chainload,取得目前的 OS 配置,並由伺服器建立狀態。"
220
187
  ],
221
- "Path to directory containing grubx64.efi and shimx64.efi": [
188
+ "Please ensure the ipxe-bootimgs package is installed.": [
222
189
  ""
223
190
  ],
224
- "Host image template": [
191
+ "Please ensure the isolinux/syslinux package(s) are installed.": [
225
192
  ""
226
193
  ],
227
- "iPXE template to use for host-specific boot disks": [
228
- "使用來作為主機特屬開機磁碟的 iPXE 範本"
194
+ "Plugin for Foreman that creates iPXE-based boot disks to provision hosts without the need for PXE infrastructure.": [
195
+ "能建立基於 iPXE 的開機磁碟的 Foreman 外掛程式,以在不需要 PXE 設備的情況下佈建主機。"
229
196
  ],
230
- "Generic image template": [
197
+ "SYSLINUX directory": [
231
198
  ""
232
199
  ],
233
- "iPXE template to use for generic host boot disks": [
234
- "使用來作為泛型主機開機磁碟的 iPXE 範本"
200
+ "Subnet '%s' generic image": [
201
+ "子網路「%s」泛型映像檔"
235
202
  ],
236
- "Generic Grub2 EFI image template": [
203
+ "Subnet boot disks": [
204
+ "子網路開機磁碟"
205
+ ],
206
+ "Subnet generic image": [
237
207
  ""
238
208
  ],
239
- "iPXE template to use for generic EFI host boot disks": [
209
+ "Subnet image": [
210
+ "子網路映像檔"
211
+ ],
212
+ "Subnet images are similar to generic images, but chain-loading is done via the TFTP Smart Proxy assigned to the Subnet of the host. The smart proxy must have the \\\"Templates\\\" module enabled and configured.": [
213
+ "子網路映像檔跟泛型映像檔類似,但連鎖載入(chain-loading)是透過 TFTP 智慧型代理指定至主機的子網路。智慧型代理必須啟用並配置了「模版」(Templates)模組。"
214
+ ],
215
+ "TFTP feature not enabled for subnet %s": [
216
+ "TFTP 功能並未啟動給子網路 %s 使用"
217
+ ],
218
+ "The OS install continues using the installation media configured in Foreman, and it will typically configure static networking, depending on how the OS iPXE template is configured.": [
219
+ "OS 安裝程序會繼續使用配置於 Foreman 中的安裝媒介,並且它一般會根據 OS iPXE 範本的配置方法來配置靜態網路。"
220
+ ],
221
+ "These images are more generic than previous images. You can find them at subnet index page.": [
240
222
  ""
241
223
  ],
242
- "ISO generation command": [
224
+ "These images are used for host. You can find them at host detail page.": [
243
225
  ""
244
226
  ],
245
- "Command to generate ISO image, use genisoimage or mkisofs": [
246
- "請使用 genisoimage 或是 mkisofs 來作為產生 ISO 映像檔的指令"
227
+ "This image is generic for all hosts with a provisioning NIC on that subnet.": [
228
+ "這映像檔對在該子網路上配有網路卡的所有主機來說,是通用的。"
247
229
  ],
248
- "Installation media caching": [
230
+ "This type of bootdisk is not allowed. Please contact administrator.": [
249
231
  ""
250
232
  ],
251
- "Installation media files will be cached for full host images": [
252
- "安裝媒介檔案將會被快取以作為完整的主機映像檔"
233
+ "True for full, false for basic reusable image": [
234
+ "「true」代表完整,「false」則代表可重複使用的基本映像檔"
253
235
  ],
254
- "Allowed bootdisk types": [
236
+ "Unable to find template specified by %s setting": [
237
+ "找不到 %s 設定所指定的範本"
238
+ ],
239
+ "Unable to generate disk %{kind} template: %{error}": [
255
240
  ""
256
241
  ],
257
- "List of allowed bootdisk types, remove type to disable it": [
242
+ "Unable to generate disk template, %{kind} template not found.": [
258
243
  ""
259
244
  ],
260
- "Not available": [
245
+ "Unable to mcopy %{file}": [
246
+ ""
247
+ ],
248
+ "Upload ISO image to datastore for %s": [
261
249
  ""
262
250
  ],
263
- "Remote action:": [
264
- "遠端動作:"
251
+ "Various types of boot disks can be created to provision hosts without the need for PXE services. Boot disks can be attached to the host (physical or virtual) which boots from the disk, contacts Foreman and begins the OS installation.": [
252
+ "您可建立各種不同類型的開機磁碟來在不使用 PXE 服務的情況下佈建主機。開機磁碟能連接至由磁碟開機的主機(實體或虛擬),聯絡 Foreman 並開始進行 OS 的安裝程序。"
265
253
  ],
266
- "Import Puppet classes": [
267
- "匯入 Puppet 類別"
254
+ "iPXE directory": [
255
+ ""
268
256
  ],
269
- "Import facts": [
270
- "匯入詳情"
257
+ "iPXE template to use for generic EFI host boot disks": [
258
+ ""
271
259
  ],
272
- "Action with sub plans": [
273
- "有子計畫的動作"
260
+ "iPXE template to use for generic host boot disks": [
261
+ "使用來作為泛型主機開機磁碟的 iPXE 範本"
274
262
  ],
275
- "Plugin for Foreman that creates iPXE-based boot disks to provision hosts without the need for PXE infrastructure.": [
276
- "能建立基於 iPXE 的開機磁碟的 Foreman 外掛程式,以在不需要 PXE 設備的情況下佈建主機。"
263
+ "iPXE template to use for host-specific boot disks": [
264
+ "使用來作為主機特屬開機磁碟的 iPXE 範本"
277
265
  ]
278
266
  }
279
267
  }
@@ -3,48 +3,6 @@
3
3
  module ForemanBootdisk
4
4
  module Scope
5
5
  class Bootdisk < ::Foreman::Renderer::Scope::Provisioning
6
- extend ApipieDSL::Class
7
-
8
- apipie :class, 'Macros related to provisioning via boot disk' do
9
- name 'Bootdisk'
10
- sections only: %w[all provisioning]
11
- end
12
-
13
- apipie :method, 'Generates URL for boot chain' do
14
- optional :mac, String, 'MAC address of the host', default: 'MAC address of the current host'
15
- optional :action, String, 'Bootloader to use', default: 'iPXE'
16
- returns String, desc: 'URL for boot chain'
17
- example 'bootdisk_chain_url #=> "http://foreman.example.com/unattended/iPXE?mac=00%3A11%3A22%3A33%3A44%3A55"'
18
- example 'bootdisk_chain_url("00:11:22:33:44:55") #=> "http://foreman.example.com/unattended/iPXE?mac=00%3A11%3A22%3A33%3A44%3A55"'
19
- end
20
- def bootdisk_chain_url(mac = host.try(:mac), action = 'iPXE')
21
- url = foreman_url(action)
22
- u = URI.parse(url)
23
- new_query_data = URI.decode_www_form(u.query || '') << ['mac', mac || '']
24
- new_querystring = URI.encode_www_form(new_query_data)
25
- u.query = nil
26
- u.query = new_querystring if new_querystring.present?
27
- u.fragment = nil
28
- u.to_s
29
- end
30
-
31
- apipie :method, 'Always raises an error with a description provided as an argument' do
32
- desc 'This method is useful for aborting script execution if some of the conditions are not met'
33
- list :args, desc: 'Description for the error'
34
- raises error: ::Foreman::Exception, desc: 'The error is always being raised'
35
- returns nil, desc: "Doesn't return anything"
36
- example "<%
37
- interface = @host.provision_interface #=> interface = nil
38
- bootdisk_raise(N_('Host has no provisioning interface defined')) unless interface #=> Foreman::Exception is raised and the execution of the script is aborted
39
- %>"
40
- end
41
- def bootdisk_raise(*args)
42
- raise ::Foreman::Exception.new(*args)
43
- end
44
-
45
- def template_name
46
- "Foreman Bootdisk"
47
- end
48
6
  end
49
7
  end
50
8
  end
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ForemanBootdisk
4
+ module TemplateHelpers
5
+ extend ApipieDSL::Class
6
+
7
+ apipie :class, 'Macros related to provisioning via boot disk' do
8
+ name 'Bootdisk'
9
+ sections only: %w[all provisioning]
10
+ end
11
+
12
+ apipie :method, 'Generates URL for boot chain' do
13
+ optional :mac, String, 'MAC address of the host', default: 'MAC address of the current host'
14
+ optional :action, String, 'Bootloader to use', default: 'iPXE'
15
+ returns String, desc: 'URL for boot chain'
16
+ example 'bootdisk_chain_url #=> "http://foreman.example.com/unattended/iPXE?mac=00%3A11%3A22%3A33%3A44%3A55"'
17
+ example 'bootdisk_chain_url("00:11:22:33:44:55") #=> "http://foreman.example.com/unattended/iPXE?mac=00%3A11%3A22%3A33%3A44%3A55"'
18
+ end
19
+ def bootdisk_chain_url(mac = host.try(:mac), action = 'iPXE')
20
+ url = foreman_url(action)
21
+ u = URI.parse(url)
22
+ new_query_data = URI.decode_www_form(u.query || '') << ['mac', mac || '']
23
+ new_querystring = URI.encode_www_form(new_query_data)
24
+ u.query = nil
25
+ u.query = new_querystring if new_querystring.present?
26
+ u.fragment = nil
27
+ u.to_s
28
+ end
29
+
30
+ apipie :method, 'Always raises an error with a description provided as an argument' do
31
+ desc 'This method is useful for aborting script execution if some of the conditions are not met'
32
+ list :args, desc: 'Description for the error'
33
+ raises error: ::Foreman::Exception, desc: 'The error is always being raised'
34
+ returns nil, desc: "Doesn't return anything"
35
+ example "<%
36
+ interface = @host.provision_interface #=> interface = nil
37
+ bootdisk_raise(N_('Host has no provisioning interface defined')) unless interface #=> Foreman::Exception is raised and the execution of the script is aborted
38
+ %>"
39
+ end
40
+ def bootdisk_raise(*args)
41
+ raise ::Foreman::Exception.new(*args)
42
+ end
43
+
44
+ def template_name
45
+ "Foreman Bootdisk"
46
+ end
47
+ end
48
+ end
@@ -45,8 +45,10 @@ module ForemanBootdisk
45
45
  ApipieDSL.configuration.dsl_classes_matchers += [
46
46
  "#{ForemanBootdisk::Engine.root}/app/lib/foreman_bootdisk/scope/*.rb"
47
47
  ]
48
+
48
49
  provision_method 'bootdisk', N_('Boot disk based')
49
- allowed_template_helpers :bootdisk_chain_url, :bootdisk_raise
50
+
51
+ extend_template_helpers ForemanBootdisk::TemplateHelpers
50
52
 
51
53
  extend_page "subnets/index" do |cx|
52
54
  cx.add_pagelet :subnet_index_action_buttons, name: 'Bootdisk', partial: 'subnets/bootdisk_action_buttons'