foreman_opentofu 0.0.3 → 0.0.5

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 (59) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +133 -68
  3. data/app/assets/javascripts/foreman_opentofu/locale/de_DE/foreman_opentofu.js +136 -0
  4. data/app/assets/javascripts/foreman_opentofu/locale/en/foreman_opentofu.js +80 -2
  5. data/app/controllers/concerns/foreman_opentofu/api/v2/hosts_controller_power_override.rb +22 -0
  6. data/app/controllers/concerns/foreman_opentofu/hosts_controller_power_override.rb +14 -0
  7. data/app/lib/foreman_opentofu/concerns/base_template_scope_extensions.rb +62 -3
  8. data/app/models/concerns/foreman_opentofu/vm_command_collection_normalization.rb +64 -0
  9. data/app/models/foreman_opentofu/compute_vm.rb +47 -6
  10. data/app/models/foreman_opentofu/opentofu_vm_commands.rb +14 -5
  11. data/app/models/foreman_opentofu/tf_state.rb +3 -0
  12. data/app/models/foreman_opentofu/tofu.rb +69 -5
  13. data/app/overrides/compute_resources_vms/tofu_indexed_networks_fields.rb +7 -0
  14. data/app/overrides/compute_resources_vms/tofu_indexed_volumes_fields.rb +8 -0
  15. data/app/overrides/compute_resources_vms/tofu_remove_new_vm_from_removable_layout.rb +7 -0
  16. data/app/services/foreman_opentofu/app_wrapper.rb +26 -2
  17. data/app/services/foreman_opentofu/authorizer_power_override.rb +15 -0
  18. data/app/services/foreman_opentofu/key_pairs.rb +26 -0
  19. data/app/services/foreman_opentofu/opentofu_executer.rb +59 -9
  20. data/app/services/foreman_opentofu/power_capability.rb +14 -0
  21. data/app/services/foreman_opentofu/provider_type.rb +51 -2
  22. data/app/services/foreman_opentofu/tofu_key_pair.rb +24 -0
  23. data/app/views/compute_resources/form/_tofu.html.erb +3 -3
  24. data/app/views/compute_resources_vms/form/tofu/_base.html.erb +11 -15
  25. data/app/views/compute_resources_vms/form/tofu/_volume.html.erb +2 -0
  26. data/app/views/foreman_opentofu/compute_resources_vms/_indexed_networks_fields.html.erb +46 -0
  27. data/app/views/foreman_opentofu/compute_resources_vms/_indexed_volumes_fields.html.erb +28 -0
  28. data/app/views/foreman_opentofu/compute_resources_vms/form/_removable_layout.html.erb +5 -0
  29. data/app/views/foreman_opentofu/compute_resources_vms/form/tofu/_interfaces_fields.html.erb +13 -0
  30. data/app/views/foreman_opentofu/compute_resources_vms/form/tofu/_volumes_fields.html.erb +18 -0
  31. data/app/views/templates/provisioning/hetzner_provision_host.erb +38 -6
  32. data/app/views/templates/provisioning/nutanix_provision_default.erb +3 -2
  33. data/lib/foreman_opentofu/engine.rb +12 -2
  34. data/lib/foreman_opentofu/provider_types/hetzner.rb +86 -1
  35. data/lib/foreman_opentofu/provider_types/nutanix.rb +26 -0
  36. data/lib/foreman_opentofu/version.rb +1 -1
  37. data/lib/foreman_opentofu.rb +4 -0
  38. data/locale/de_DE/LC_MESSAGES/foreman_opentofu.mo +0 -0
  39. data/locale/de_DE/foreman_opentofu.po +137 -0
  40. data/locale/en/LC_MESSAGES/foreman_opentofu.mo +0 -0
  41. data/locale/en/foreman_opentofu.po +80 -3
  42. data/locale/foreman_opentofu.pot +149 -11
  43. data/selinux/Makefile +22 -0
  44. data/selinux/foreman_opentofu.fc +3 -0
  45. data/selinux/foreman_opentofu.if +0 -0
  46. data/selinux/foreman_opentofu.te +93 -0
  47. data/test/factories/compute_resources.rb +8 -0
  48. data/test/fixtures/snapshots/foreman_opentofu/base_template_scope_extensions_test/resource_block.txt +8 -0
  49. data/test/lib/foreman_opentofu/concerns/base_template_scope_extensions_test.rb +84 -0
  50. data/test/models/foreman_opentofu/opentofu_vm_commands_test.rb +70 -24
  51. data/test/models/foreman_opentofu/tf_state_test.rb +19 -0
  52. data/test/models/foreman_opentofu/tofu_test.rb +70 -0
  53. data/test/services/app_wrapper_test.rb +42 -1
  54. data/test/services/foreman_opentofu/provider_type_test.rb +103 -0
  55. data/test/services/key_pairs_test.rb +32 -0
  56. data/test/services/opentofu_executer_test.rb +161 -27
  57. data/test/services/tofu_key_pair_test.rb +31 -0
  58. metadata +36 -6
  59. data/locale/gemspec.rb +0 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ccfa3742aa9fe09edc20f685bf1a65f0f32aa34603572812fd250f64f84c7f60
4
- data.tar.gz: 632627c1dbecb3da3282fa29085647263f588eb99753db33d2f2ada53b57680c
3
+ metadata.gz: 13aa21537aa49784d6b945e5e0169c20509c46e361e951b6db79a17d330559ef
4
+ data.tar.gz: e0f23b3286a236bd161421d8464518a9b47878d61e7ebd03ab41b361cb0b513f
5
5
  SHA512:
6
- metadata.gz: 1858acdfd4b8e7e32dd3c91765ca1e5e6921da70b8754842e1fa8284bb9b1ceb23b5abb7b22320218d6326167f821d032071915458155545e19ace88dfadd996
7
- data.tar.gz: a9f29bd6e263acb43c2a692ed848a71b99c61dce3fb3b64a9ebd7597bceae0280f8b93879b2e5b89a6a8a2244f9cfd5644fdfdc20444353fc962211def091591
6
+ metadata.gz: f1459d8aa7ad4e99b3d43b2725093f7cdc06d7473073432ca8386f46b1d2db4a5ac3acad3ec7c3580830e2d13a11e25354713c9a702a1f3ac669a527a504137f
7
+ data.tar.gz: 4724e84ebc240ef60bdd95c65710fc3156f718628d38ba65570d8305df762be8883e00df13783002927589cdb2e7eed0304b98b414e5ac4e1edf9a48c5ca3d8c
data/README.md CHANGED
@@ -1,20 +1,50 @@
1
1
  [![Ruby Tests](https://github.com/ATIX-AG/foreman_opentofu/actions/workflows/ruby.yml/badge.svg)](https://github.com/ATIX-AG/foreman_opentofu/actions/workflows/ruby.yml)
2
2
 
3
- # ForemanOpenTOFU
3
+ # Foreman OpenTofu
4
4
 
5
- [Foreman](http://theforeman.org/) plugin that adds that adds a generic openTOFU-based compute resource, enabling host provisioning through openTOFU scripts instead of provider-specific SDK integrations such as fog-vsphere.
5
+ [Foreman](http://theforeman.org/) plugin that adds that adds a generic OpenTofu-based compute resource, enabling host provisioning through OpenTofu scripts instead of provider-specific SDK integrations such as fog-vsphere.
6
6
 
7
- This plugin introduces a new provisioning model where Foreman remains responsible for host lifecycle and orchestration, while openTOFU handles infrastructure creation using its provider ecosystem.
7
+ This plugin introduces a new provisioning model where Foreman remains responsible for host lifecycle and orchestration, while OpenTofu handles infrastructure creation using its provider ecosystem.
8
8
 
9
9
  The plugin is designed to be easily extendable and can support multiple infrastructure platforms (for example Nutanix, Hetzner) without requiring a dedicated Foreman compute resource plugin per provider.
10
10
 
11
11
  ## Installation
12
12
 
13
+ Install the rubygem as usual or use the RPM/Deb package for your distribution.
14
+
15
+ If you use the rubygem, make sure to create the folllowing directory and set the correct permissions:
16
+
17
+ ```shell
18
+
19
+ mkdir -p /var/lib/foreman-opentofu
20
+ mkdir -p /var/lib/foreman-opentofu/plugin-cache
21
+ mkdir -p /var/lib/foreman-opentofu/tmp
22
+
23
+ chown -R foreman:foreman /var/lib/foreman-opentofu
24
+ chmod 755 /var/lib/foreman-opentofu
25
+ chmod 755 /var/lib/foreman-opentofu/plugin-cache
26
+ chmod 700 /var/lib/foreman-opentofu/tmp
27
+ ```
28
+
29
+ ## SELinux
30
+
31
+ If you have installed the rubygem manually, you need to set the correct SELinux context for the plugin to work properly.
32
+ Re-use the selinux directives defined in the selinux directory of the plugin.
33
+
34
+ ```shell
35
+ cd selinux
36
+ make clean && make all
37
+ mkdir -p /usr/share/selinux/targeted/
38
+ install -m 0600 foreman_opentofu.pp /usr/share/selinux/targeted/
39
+ /usr/sbin/semodule -i /usr/share/selinux/targeted/foreman_opentofu.pp
40
+ /sbin/restorecon -ri /var/lib/foreman-opentofu/
41
+ ```
42
+
13
43
 
14
44
  ## Usage
15
- Create a openTofu compute resource and set:
16
- * Provider: openTofu
17
- * Opentofu Provider: Select desired hypervisor supported by openTofu plugin
45
+ Create a OpenTofu compute resource and set:
46
+ * Provider: OpenTofu
47
+ * OpenTofu Provider: Select desired hypervisor supported by OpenTofu plugin
18
48
  * URL: Hypervisor specific URL
19
49
 
20
50
 
@@ -22,19 +52,19 @@ Then add all necessary information to the form.
22
52
 
23
53
  Provisioning workflow:
24
54
 
25
- * Create a host in Foreman using the openTOFU based compute resource
55
+ * Create a host in Foreman using the OpenTofu based compute resource
26
56
 
27
57
  * Foreman passes host parameters to the plugin
28
58
 
29
- * The plugin renders and executes openTOFU plans
59
+ * The plugin renders and executes OpenTofu plans
30
60
 
31
- * openTOFU provisions the infrastructure
61
+ * OpenTofu provisions the infrastructure
32
62
 
33
63
  * Foreman continues with OS provisioning and configuration
34
64
 
35
- Provider-specific details (for example Nutanix, Hetzner) are handled entirely through openTOFU scripts.
65
+ Provider-specific details (for example Nutanix, Hetzner) are handled entirely through OpenTofu scripts.
36
66
 
37
- ### Create new ProviderType
67
+ ### Add support for a new Tofu-Provider
38
68
 
39
69
  This Plugin empowers you to add support of a new backend VM- or Cloud-Platform yourself.
40
70
  Follow these simple steps to do so:
@@ -50,11 +80,39 @@ You may use the UI-Editor in Hosts -> Templates -> Provisioning Templates to cre
50
80
  Either clone a pre-installed template or create one from scratch.
51
81
  In the latter case be sure to select the correct Template Type: OpenTofu Script template.
52
82
 
83
+
84
+ #### Create Provider Type
85
+
86
+ To let the Foreman OpenTofu Plugin know about your new Provider Type, one additional file has to be created in `/lib/foreman_opentofu/provider_types/`.
87
+
88
+ A very simple ProviderType file to add a new Provider named `nutanix` has to be located in `lib/foreman_opentofu/provider_types/nutanix.rb` and might look like this:
89
+
90
+ ```ruby
91
+ ForemanOpentofu::ProviderTypeManager.register('nutanix') do
92
+ end
93
+ ```
94
+
95
+ Additional informations about the ProviderType can be set within the `register`-block:
96
+
97
+ ##### `default_attributes`
98
+
99
+ Define values that should be set as default for attributes.
100
+ The values do not have to be defined in the config-file.
101
+ If attributes are also defined in the config-file and therefore set during Host creation, the default\_attribute values will be overwritten.
102
+
103
+ ```ruby
104
+ ForemanOpentofu::ProviderTypeManager.register('nutanix') do
105
+ @default_attributes = {
106
+ 'enable_cpu_passthrough' => true,
107
+ 'num_threads_per_core' => 2,
108
+ }
109
+ end
110
+ ```
111
+
53
112
  #### Create Parameter Config
54
113
 
55
- To define which Virtual Machine parameters can be set for a new Host a new config file under `/config` must be added.
56
- Feel free to use either YAML or JSON (be sure to end the filename with `.json` or `.yaml`).
57
- The config file defines an array of dicts, where each dict represents a configuration-parameter.
114
+ To define which Virtual Machine parameters can be set for a new Host the `self.provider_attrs` variable must be defined within the `register`-block.
115
+ The `provider_attrs`-variable defines an Array of Dicts/Hashes, where each Dict/Hash represents a configuration-parameter.
58
116
 
59
117
  A config-parameter has the following values:
60
118
 
@@ -68,54 +126,53 @@ A config-parameter has the following values:
68
126
  * `help`: Tooltip describing what that value does and what values are allowed
69
127
  * `mandatory`: `true`/`false` defines if omitting the value triggers an error
70
128
  * `options`: array of strings representing the possible values
129
+ * `default`: default-value should be specified if parameter is mandatory and options is empty
71
130
  * `group`: define where the value should be configured
72
131
  * `vm`: ones per Host in the 'Virtual Machine' tab,
73
132
  * `disk`: for each defined disk/volume in the 'Virtual Machine' tab
74
133
  * `nic`: for each defined network-interface on the 'Interfaces' tab
75
134
 
76
- A short config file might look like this:
77
-
78
- ```json
79
- [
80
- { "name": "memory_size_mib", "type": "number", "group": "vm", "mandatory": false,
81
- "label": "Memory (MB)" },
82
- { "name": "boot_type", "type": "select", "group": "vm", "mandatory": false,
83
- "label": "Firmware", "options": [ "UEFI", "LEGACY", "SECURE_BOOT" ] },
84
- { "name": "disk_size_mib", "type": "number", "group": "disk", "mandatory": true,
85
- "label": "Size (MB)" },
86
- { "name": "model", "type": "select", "group": "nic", "mandatory": true,
87
- "options": [ "VIRTIO", "E1000" ] }
135
+ A short definition might look like this:
136
+
137
+ ```ruby
138
+ self.provider_attrs = [
139
+ { name: 'memory_size_mib', type: 'number', group: 'vm', mandatory: false,
140
+ label: 'Memory (MB)' },
141
+ { name: 'boot_type', type: 'select', group: 'vm', mandatory: false,
142
+ label: 'Firmware', options: [ 'UEFI', 'LEGACY', 'SECURE_BOOT' ] },
143
+ { name: 'disk_size_mib', type: 'number', group: 'disk', mandatory: true,
144
+ label: 'Size (MB)' },
145
+ { name: 'model', type: 'select', group: 'nic', mandatory: true,
146
+ options: [ 'VIRTIO', 'E1000' ] }
88
147
  ]
89
148
  ```
90
149
 
91
- The name of the file must be the same as the provider-type name we set in the next step (e.g. `/config/nutanix.json`).
92
-
93
150
  ##### Dynamic Config Parameter
94
151
 
95
152
  Sometimes it is necessary to provide a list of possible values that are defined by the backend-service.
96
153
  Curating the 'options'-Array is tedious at best or not possible if multiple instances of the backend service are in use.
97
- This can be addressed by specifiying an OpenTofu-Provider's [DataSource](https://opentofu.org/docs/language/data-sources/) in the following way:
154
+ This can be addressed by specifiying an OpenTofu provider's [DataSource](https://opentofu.org/docs/language/data-sources/) in the following way:
98
155
 
99
- ```json
156
+ ```ruby
100
157
  {
101
- "name": "volume_group", "type": "select", "group": "disk", "mandatory": true, "label": "Volume Group",
102
- "options": {
103
- "data_source": {
104
- "name": "nutanix_volume_groups_v2",
105
- "arguments": {
106
- "filter": "name eq 'volume_group_test'",
107
- "limit": 20
158
+ name: 'volume_group', type: 'select', group: 'disk', mandatory: true, label: 'Volume Group',
159
+ options: {
160
+ data_source: {
161
+ name: 'nutanix_volume_groups_v2',
162
+ arguments: {
163
+ filter: 'name eq 'volume_group_test'',
164
+ limit: 20
108
165
  },
109
- "entity": {
110
- "id": "metadata.uuid"
166
+ entity: {
167
+ id: 'metadata.uuid'
111
168
  }
112
169
  },
113
- "output_path_postfix": "volume_groups"
170
+ output_path_postfix: 'volume_groups'
114
171
  }
115
172
  }
116
173
 
117
174
  ```
118
- The GUI requires a list of objects that at least contain a name and an id for each select-option.
175
+ The GUI requires a list of objects that at least contains a name and an id for each select-option.
119
176
  The `entity` section can be used to define a specific value from an object within the list that the DataSource returns.
120
177
  If the object already has `name` and `id` entries, these will automatically used.
121
178
  In the above example `name` exists in the object and can be used.
@@ -140,49 +197,57 @@ output "resources" {
140
197
 
141
198
  Some config parameter names have special meanings.
142
199
  For instance, Image-based Deployment requires binding images available on the backend-service with Operating Systems configured in Foreman.
200
+
201
+ ###### available\_images
202
+
143
203
  To enable Foreman OpenTofu to display the available images, a `select`-parameter with the name `available_images` must be specified.
144
204
  It is recommended to tie this to a data-source available in the OpenTofu provider.
145
205
 
146
- ```json
206
+ ```ruby
147
207
  {
148
- "name": "available_images", "type": "select",
149
- "options": {
150
- "data_source": {
151
- "name": "hcloud_images",
152
- "arguments": { "with_architecture": ["x86"] }
208
+ name: 'available_images', type: 'select',
209
+ options: {
210
+ data_source: {
211
+ name: 'hcloud_images',
212
+ arguments: { with_architecture: ['x86'] }
153
213
  },
154
- "output_path_postfix": "images"
214
+ output_path_postfix: 'images'
155
215
  }
156
216
  }
157
217
  ```
158
218
 
219
+ ###### available\_ssh\_keys
159
220
 
160
- #### Create Provider Type
161
-
162
- To let the Foreman OpenTofu Plugin know about your new Provider Type, one additional file has to be created in `/lib/foreman_opentofu/provider_types/`.
163
-
164
- A very simple ProviderType file to add a new Provider named `nutanix` has to be located in `lib/foreman_opentofu/provider_types/nutanix.rb` and might look like this:
221
+ Cloud-based Providers usually require an SSH key pair to configure image-based hosts.
222
+ This dynamic data-source should provide a list of SSH keys known to the cloud-provider.
165
223
 
166
224
  ```ruby
167
- ForemanOpentofu::ProviderTypeManager.register('nutanix') do
168
- end
225
+ {
226
+ name: 'available_ssh_keys', type: 'select',
227
+ label: 'SSH-Deployment-Keys', options: {
228
+ data_source: {
229
+ name: 'hcloud_ssh_keys',
230
+ },
231
+ entity: {
232
+ fingerprint: 'fingerprint',
233
+ },
234
+ output_path_postfix: 'ssh_keys',
235
+ }
236
+ }
169
237
  ```
170
238
 
171
- Additional informations about the ProviderType can be set within the `register`-block:
239
+ #### Protection against Accidental Resource Recreation
172
240
 
173
- ##### `default_attributes`
241
+ Depending on the settings that are changed for an existing resource (e.g. a Host), OpenTofu may decide that it has to destroy the existing resource and create a new one.
242
+ This is almost never what we want for a managed Foreman Host.
243
+ After editing a host, this Plugin checks OpenTofu's plan for applying the changes.
244
+ If the plan includes a 'delete'-action, it will raise an exception and will not apply the changes.
174
245
 
175
- Define values that should be set as default for attributes.
176
- The values do not have to be defined in the config-file.
177
- If attributes are also defined in the config-file and therefore set during Host creation, the default\_attribute values will be overwritten.
246
+ In case the recreation of a specific resource type is expected behavior, the resource type can be added to an allow-list within the ProviderType definition file.
247
+ The following example allows OpenTofu to destroy and recreate resources of type `hcloud_volume`:
178
248
 
179
249
  ```ruby
180
- ForemanOpentofu::ProviderTypeManager.register('nutanix') do
181
- @default_attributes = {
182
- 'enable_cpu_passthrough' => true,
183
- 'num_threads_per_core' => 2,
184
- }
185
- end
250
+ self.recreate_type_allow_list = ['hcloud_volume']
186
251
  ```
187
252
 
188
253
 
@@ -192,7 +257,7 @@ end
192
257
 
193
258
  > See [Foreman dev setup](https://github.com/theforeman/foreman/blob/develop/developer_docs/foreman_dev_setup.asciidoc)
194
259
 
195
- * You need a openTOFU installed on your machine.
260
+ * You need a OpenTofu installed on your machine.
196
261
  * You need ruby 2.7. You can install it with [asdf-vm](https://asdf-vm.com).
197
262
 
198
263
  ### Platform
@@ -226,7 +291,7 @@ bundle install
226
291
  RAILS_ENV=development bundle exec bin/rake permissions:reset password=changeme
227
292
  ```
228
293
 
229
- * In foreman_openTofu source directory, check code syntax with rubocop and foreman rules:
294
+ * In the `foreman_opentofu` directory, check code syntax with rubocop and foreman rules:
230
295
 
231
296
  ```shell
232
297
  bundle exec rubocop
@@ -0,0 +1,136 @@
1
+ locales['foreman_opentofu'] = locales['foreman_opentofu'] || {}; locales['foreman_opentofu']['de_DE'] = {
2
+ "domain": "foreman_opentofu",
3
+ "locale_data": {
4
+ "foreman_opentofu": {
5
+ "": {
6
+ "Project-Id-Version": "foreman_opentofu 0.0.4",
7
+ "Report-Msgid-Bugs-To": "",
8
+ "PO-Revision-Date": "2026-02-16 11:45+0000",
9
+ "Last-Translator": "Markus Bucher <bucher@atix.de>, 2026",
10
+ "Language-Team": "German (Germany) (https://app.transifex.com/foreman/teams/114/de_DE/)",
11
+ "MIME-Version": "1.0",
12
+ "Content-Type": "text/plain; charset=UTF-8",
13
+ "Content-Transfer-Encoding": "8bit",
14
+ "Language": "de_DE",
15
+ "Plural-Forms": "nplurals=2; plural=(n != 1);",
16
+ "lang": "de_DE",
17
+ "domain": "foreman_opentofu",
18
+ "plural_forms": "nplurals=2; plural=(n != 1);"
19
+ },
20
+ "127.0.0.1": [
21
+ "127.0.0.1"
22
+ ],
23
+ "Add Interface": [
24
+ "Interface hinzufügen"
25
+ ],
26
+ "Add Volume": [
27
+ "Volume hinzufügen"
28
+ ],
29
+ "Cache slow calls to OpenTofu Compute resources to speed up page rendering": [
30
+ "Ergebnisse langsamer Abfragen zu OpenTofu zwischenspeichern um das Laden der Seiten zu beschleunigen"
31
+ ],
32
+ "Caching": [
33
+ "Zwischenspeicher"
34
+ ],
35
+ "Common fields": [
36
+ "Allgemeine Werte"
37
+ ],
38
+ "Disabled": [
39
+ "Deaktiviert"
40
+ ],
41
+ "Does this image support user data input (e.g. via cloud-init)?": [
42
+ "Unterstützt dieses Image die Eingabe von Benutzerdaten (z.B. via cloud-init)?"
43
+ ],
44
+ "Enable caching": [
45
+ "Caching aktivieren"
46
+ ],
47
+ "Enabled": [
48
+ "Aktiviert"
49
+ ],
50
+ "ID of the Image on the Hypervisor": [
51
+ "ID des Abbilds auf dem Hypervisor"
52
+ ],
53
+ "Image": [
54
+ "Abbild"
55
+ ],
56
+ "Image \\\"%{image}\\\" needs user data, but \\\"%{os}\\\" is not associated to any provisioning template of the kind user_data. Please associate it with a suitable template or uncheck 'User data' from the image definition.": [
57
+ "Abbild \\\"%{image}\\\" benötigt Benutzerdaten. Jedoch ist \\\"%{os}\\\" keine Bereitstellungsvorlage der Art user_data zugeordnet. Bitte weisen Sie eine geeignete Vorlage zu, oder deaktivieren sie \\\"Benutzerdaten\\\" in der Abbilddefinition."
58
+ ],
59
+ "Image ID": [
60
+ "Abbild ID"
61
+ ],
62
+ "Network interfaces": [
63
+ "Netzwerkinterface"
64
+ ],
65
+ "No networks found.": [
66
+ "Keine Netzwerke gefunden."
67
+ ],
68
+ "Number of Bits for the SSH-Key required to provision hosts on image-based providers.": [
69
+ "Bitanzahl des SSH-Schlüssels der für die abbildbasierte Bereitstellung von Hosts benötigt wird."
70
+ ],
71
+ "Number of seconds a run of OpenTofu command is allowed to report TfState back to the plugin.": [
72
+ "Anzahl der Sekunden in denen ein OpenTofu Befehl einen TfState an das Plugin zurücksenden darf."
73
+ ],
74
+ "OpenTofu": [
75
+ "OpenTofu"
76
+ ],
77
+ "OpenTofu Provider": [
78
+ "OpenTofu Provider"
79
+ ],
80
+ "OpenTofu Script template": [
81
+ "OpenTofu Script Vorlage"
82
+ ],
83
+ "OpenTofu Template": [
84
+ "OpenTofu Vorlage"
85
+ ],
86
+ "Password to authenticate with - used for SSH finish step.": [
87
+ "Passwort mit dem sich authentifiziert wird - benötigt, um den letzten Schritt mit SSH abzuschließen."
88
+ ],
89
+ "Please select an image": [
90
+ "Bitte Abbild auswählen"
91
+ ],
92
+ "Power change operations are not enabled on this host.": [
93
+ "Power-Operationen werden auf diesem Host nicht unterstützt"
94
+ ],
95
+ "SSH-Key Length": [
96
+ "SSH-Schlüssellänge"
97
+ ],
98
+ "TODO: Description of ForemanPluginTemplate.": [
99
+ ""
100
+ ],
101
+ "TfState Token Timeout": [
102
+ "TfState Token Timeout"
103
+ ],
104
+ "The user that is used to ssh into the instance, normally cloud-user, ec2-user, ubuntu, root etc": [
105
+ "Der Benutzer für die SSH-Verbindung zur Instanz. Normalerweise cloud-user, ec2-user, ubuntu, root, etc."
106
+ ],
107
+ "URL": [
108
+ "URL"
109
+ ],
110
+ "Unable to find template specified by %s setting": [
111
+ "Konnte Vorlage mit der %s-Einstellung nicht finden"
112
+ ],
113
+ "Unable to render provisioning template": [
114
+ "Bereitstellungsvorlage konnte nicht verarbeitet werden"
115
+ ],
116
+ "VM Config": [
117
+ "VM Konfiguration"
118
+ ],
119
+ "add new network interface": [
120
+ "neues Netzwerkinterface hinzufügen"
121
+ ],
122
+ "add new storage volume": [
123
+ "neues Speichervolume hinzufügen"
124
+ ],
125
+ "e.g. admin": [
126
+ "z.B. admin"
127
+ ],
128
+ "remove network interface": [
129
+ "Netzwerkinterface entfernen"
130
+ ],
131
+ "remove storage volume": [
132
+ "entferne Speichervolume"
133
+ ]
134
+ }
135
+ }
136
+ };
@@ -3,7 +3,7 @@
3
3
  "locale_data": {
4
4
  "foreman_opentofu": {
5
5
  "": {
6
- "Project-Id-Version": "foreman_opentofu 1.0.0",
6
+ "Project-Id-Version": "foreman_opentofu 0.0.4",
7
7
  "Report-Msgid-Bugs-To": "",
8
8
  "PO-Revision-Date": "2026-02-16 18:46+0000",
9
9
  "Last-Translator": "FULL NAME <EMAIL@ADDRESS>",
@@ -20,9 +20,60 @@
20
20
  "127.0.0.1": [
21
21
  ""
22
22
  ],
23
+ "Add Interface": [
24
+ ""
25
+ ],
26
+ "Add Volume": [
27
+ ""
28
+ ],
29
+ "Cache slow calls to OpenTofu Compute resources to speed up page rendering": [
30
+ ""
31
+ ],
32
+ "Caching": [
33
+ ""
34
+ ],
23
35
  "Common fields": [
24
36
  ""
25
37
  ],
38
+ "Disabled": [
39
+ ""
40
+ ],
41
+ "Does this image support user data input (e.g. via cloud-init)?": [
42
+ ""
43
+ ],
44
+ "Enable caching": [
45
+ ""
46
+ ],
47
+ "Enabled": [
48
+ ""
49
+ ],
50
+ "ID of the Image on the Hypervisor": [
51
+ ""
52
+ ],
53
+ "Image": [
54
+ ""
55
+ ],
56
+ "Image \\\"%{image}\\\" needs user data, but \\\"%{os}\\\" is not associated to any provisioning template of the kind user_data. Please associate it with a suitable template or uncheck 'User data' from the image definition.": [
57
+ ""
58
+ ],
59
+ "Image ID": [
60
+ ""
61
+ ],
62
+ "Network interfaces": [
63
+ ""
64
+ ],
65
+ "No networks found.": [
66
+ ""
67
+ ],
68
+ "Number of Bits for the SSH-Key required to provision hosts on image-based providers.": [
69
+ ""
70
+ ],
71
+ "Number of seconds a run of OpenTofu command is allowed to report TfState back to the plugin.": [
72
+ ""
73
+ ],
74
+ "OpenTofu": [
75
+ ""
76
+ ],
26
77
  "OpenTofu Provider": [
27
78
  ""
28
79
  ],
@@ -32,12 +83,27 @@
32
83
  "OpenTofu Template": [
33
84
  ""
34
85
  ],
35
- "Storage": [
86
+ "Password to authenticate with - used for SSH finish step.": [
87
+ ""
88
+ ],
89
+ "Please select an image": [
90
+ ""
91
+ ],
92
+ "Power change operations are not enabled on this host.": [
93
+ ""
94
+ ],
95
+ "SSH-Key Length": [
36
96
  ""
37
97
  ],
38
98
  "TODO: Description of ForemanPluginTemplate.": [
39
99
  ""
40
100
  ],
101
+ "TfState Token Timeout": [
102
+ ""
103
+ ],
104
+ "The user that is used to ssh into the instance, normally cloud-user, ec2-user, ubuntu, root etc": [
105
+ ""
106
+ ],
41
107
  "URL": [
42
108
  ""
43
109
  ],
@@ -50,8 +116,20 @@
50
116
  "VM Config": [
51
117
  ""
52
118
  ],
119
+ "add new network interface": [
120
+ ""
121
+ ],
122
+ "add new storage volume": [
123
+ ""
124
+ ],
53
125
  "e.g. admin": [
54
126
  ""
127
+ ],
128
+ "remove network interface": [
129
+ ""
130
+ ],
131
+ "remove storage volume": [
132
+ ""
55
133
  ]
56
134
  }
57
135
  }
@@ -0,0 +1,22 @@
1
+ module ForemanOpentofu
2
+ module Api
3
+ module V2
4
+ module HostsControllerPowerOverride
5
+ def power
6
+ if ForemanOpentofu::PowerCapability.power_change_disabled_for_host?(@host)
7
+ return render_error :custom_error, status: :unprocessable_entity, locals: { message: _('Power change operations are not enabled on this host.') }
8
+ end
9
+
10
+ super
11
+ end
12
+
13
+ def power_status
14
+ result = PowerManager::PowerStatus.safe_power_state(@host, timeout: params[:timeout])
15
+ result[:statusText] = _('Power change operations are not enabled on this host.') if ForemanOpentofu::PowerCapability.power_change_disabled_for_host?(@host)
16
+
17
+ render json: result
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,14 @@
1
+ module ForemanOpentofu
2
+ module HostsControllerPowerOverride
3
+ def power
4
+ if ForemanOpentofu::PowerCapability.power_change_disabled_for_host?(@host)
5
+ return process_error(
6
+ redirect: :back,
7
+ error_msg: _('Power change operations are not enabled on this host.')
8
+ )
9
+ end
10
+
11
+ super
12
+ end
13
+ end
14
+ end