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.
- checksums.yaml +4 -4
- data/README.md +133 -68
- data/app/assets/javascripts/foreman_opentofu/locale/de_DE/foreman_opentofu.js +136 -0
- data/app/assets/javascripts/foreman_opentofu/locale/en/foreman_opentofu.js +80 -2
- data/app/controllers/concerns/foreman_opentofu/api/v2/hosts_controller_power_override.rb +22 -0
- data/app/controllers/concerns/foreman_opentofu/hosts_controller_power_override.rb +14 -0
- data/app/lib/foreman_opentofu/concerns/base_template_scope_extensions.rb +62 -3
- data/app/models/concerns/foreman_opentofu/vm_command_collection_normalization.rb +64 -0
- data/app/models/foreman_opentofu/compute_vm.rb +47 -6
- data/app/models/foreman_opentofu/opentofu_vm_commands.rb +14 -5
- data/app/models/foreman_opentofu/tf_state.rb +3 -0
- data/app/models/foreman_opentofu/tofu.rb +69 -5
- data/app/overrides/compute_resources_vms/tofu_indexed_networks_fields.rb +7 -0
- data/app/overrides/compute_resources_vms/tofu_indexed_volumes_fields.rb +8 -0
- data/app/overrides/compute_resources_vms/tofu_remove_new_vm_from_removable_layout.rb +7 -0
- data/app/services/foreman_opentofu/app_wrapper.rb +26 -2
- data/app/services/foreman_opentofu/authorizer_power_override.rb +15 -0
- data/app/services/foreman_opentofu/key_pairs.rb +26 -0
- data/app/services/foreman_opentofu/opentofu_executer.rb +59 -9
- data/app/services/foreman_opentofu/power_capability.rb +14 -0
- data/app/services/foreman_opentofu/provider_type.rb +51 -2
- data/app/services/foreman_opentofu/tofu_key_pair.rb +24 -0
- data/app/views/compute_resources/form/_tofu.html.erb +3 -3
- data/app/views/compute_resources_vms/form/tofu/_base.html.erb +11 -15
- data/app/views/compute_resources_vms/form/tofu/_volume.html.erb +2 -0
- data/app/views/foreman_opentofu/compute_resources_vms/_indexed_networks_fields.html.erb +46 -0
- data/app/views/foreman_opentofu/compute_resources_vms/_indexed_volumes_fields.html.erb +28 -0
- data/app/views/foreman_opentofu/compute_resources_vms/form/_removable_layout.html.erb +5 -0
- data/app/views/foreman_opentofu/compute_resources_vms/form/tofu/_interfaces_fields.html.erb +13 -0
- data/app/views/foreman_opentofu/compute_resources_vms/form/tofu/_volumes_fields.html.erb +18 -0
- data/app/views/templates/provisioning/hetzner_provision_host.erb +38 -6
- data/app/views/templates/provisioning/nutanix_provision_default.erb +3 -2
- data/lib/foreman_opentofu/engine.rb +12 -2
- data/lib/foreman_opentofu/provider_types/hetzner.rb +86 -1
- data/lib/foreman_opentofu/provider_types/nutanix.rb +26 -0
- data/lib/foreman_opentofu/version.rb +1 -1
- data/lib/foreman_opentofu.rb +4 -0
- data/locale/de_DE/LC_MESSAGES/foreman_opentofu.mo +0 -0
- data/locale/de_DE/foreman_opentofu.po +137 -0
- data/locale/en/LC_MESSAGES/foreman_opentofu.mo +0 -0
- data/locale/en/foreman_opentofu.po +80 -3
- data/locale/foreman_opentofu.pot +149 -11
- data/selinux/Makefile +22 -0
- data/selinux/foreman_opentofu.fc +3 -0
- data/selinux/foreman_opentofu.if +0 -0
- data/selinux/foreman_opentofu.te +93 -0
- data/test/factories/compute_resources.rb +8 -0
- data/test/fixtures/snapshots/foreman_opentofu/base_template_scope_extensions_test/resource_block.txt +8 -0
- data/test/lib/foreman_opentofu/concerns/base_template_scope_extensions_test.rb +84 -0
- data/test/models/foreman_opentofu/opentofu_vm_commands_test.rb +70 -24
- data/test/models/foreman_opentofu/tf_state_test.rb +19 -0
- data/test/models/foreman_opentofu/tofu_test.rb +70 -0
- data/test/services/app_wrapper_test.rb +42 -1
- data/test/services/foreman_opentofu/provider_type_test.rb +103 -0
- data/test/services/key_pairs_test.rb +32 -0
- data/test/services/opentofu_executer_test.rb +161 -27
- data/test/services/tofu_key_pair_test.rb +31 -0
- metadata +36 -6
- data/locale/gemspec.rb +0 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 13aa21537aa49784d6b945e5e0169c20509c46e361e951b6db79a17d330559ef
|
|
4
|
+
data.tar.gz: e0f23b3286a236bd161421d8464518a9b47878d61e7ebd03ab41b361cb0b513f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f1459d8aa7ad4e99b3d43b2725093f7cdc06d7473073432ca8386f46b1d2db4a5ac3acad3ec7c3580830e2d13a11e25354713c9a702a1f3ac669a527a504137f
|
|
7
|
+
data.tar.gz: 4724e84ebc240ef60bdd95c65710fc3156f718628d38ba65570d8305df762be8883e00df13783002927589cdb2e7eed0304b98b414e5ac4e1edf9a48c5ca3d8c
|
data/README.md
CHANGED
|
@@ -1,20 +1,50 @@
|
|
|
1
1
|
[](https://github.com/ATIX-AG/foreman_opentofu/actions/workflows/ruby.yml)
|
|
2
2
|
|
|
3
|
-
#
|
|
3
|
+
# Foreman OpenTofu
|
|
4
4
|
|
|
5
|
-
[Foreman](http://theforeman.org/) plugin that adds that adds a generic
|
|
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
|
|
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
|
|
16
|
-
* Provider:
|
|
17
|
-
*
|
|
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
|
|
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
|
|
59
|
+
* The plugin renders and executes OpenTofu plans
|
|
30
60
|
|
|
31
|
-
*
|
|
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
|
|
65
|
+
Provider-specific details (for example Nutanix, Hetzner) are handled entirely through OpenTofu scripts.
|
|
36
66
|
|
|
37
|
-
###
|
|
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
|
|
56
|
-
|
|
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
|
|
77
|
-
|
|
78
|
-
```
|
|
79
|
-
[
|
|
80
|
-
{
|
|
81
|
-
|
|
82
|
-
{
|
|
83
|
-
|
|
84
|
-
{
|
|
85
|
-
|
|
86
|
-
{
|
|
87
|
-
|
|
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
|
|
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
|
-
```
|
|
156
|
+
```ruby
|
|
100
157
|
{
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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
|
-
|
|
110
|
-
|
|
166
|
+
entity: {
|
|
167
|
+
id: 'metadata.uuid'
|
|
111
168
|
}
|
|
112
169
|
},
|
|
113
|
-
|
|
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
|
|
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
|
-
```
|
|
206
|
+
```ruby
|
|
147
207
|
{
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
208
|
+
name: 'available_images', type: 'select',
|
|
209
|
+
options: {
|
|
210
|
+
data_source: {
|
|
211
|
+
name: 'hcloud_images',
|
|
212
|
+
arguments: { with_architecture: ['x86'] }
|
|
153
213
|
},
|
|
154
|
-
|
|
214
|
+
output_path_postfix: 'images'
|
|
155
215
|
}
|
|
156
216
|
}
|
|
157
217
|
```
|
|
158
218
|
|
|
219
|
+
###### available\_ssh\_keys
|
|
159
220
|
|
|
160
|
-
|
|
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
|
-
|
|
168
|
-
|
|
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
|
-
|
|
239
|
+
#### Protection against Accidental Resource Recreation
|
|
172
240
|
|
|
173
|
-
|
|
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
|
-
|
|
176
|
-
The
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
-
"
|
|
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
|