Skip to content

Commit b3caa83

Browse files
committed
[provisioner] Add autoyast self update option
1 parent 5c1b677 commit b3caa83

File tree

7 files changed

+26
-1
lines changed

7 files changed

+26
-1
lines changed

chef/cookbooks/provisioner/recipes/update_nodes.rb

+2
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,8 @@ def find_node_boot_mac_addresses(node, admin_data_net)
333333
web_port: web_port,
334334
packages: packages,
335335
repos: repos,
336+
self_update: node[:provisioner][:self_update],
337+
self_update_url: node[:provisioner][:self_update_url],
336338
rootpw_hash: node[:provisioner][:root_password_hash] || "",
337339
timezone: timezone,
338340
boot_device: (mnode[:crowbar_wall][:boot_device] rescue nil),

chef/cookbooks/provisioner/templates/default/autoyast.xml.erb

+3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
<import_gpg_key config:type="boolean">true</import_gpg_key>
2727
</signature-handling>
2828
<storage/>
29+
<% if @self_update %>
30+
<self_update_url><%= @self_update_url %></self_update_url>
31+
<% end %>
2932
</general>
3033
<add-on>
3134
<add_on_products config:type="list">
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
def upgrade(ta, td, a, d)
2+
a["self_update"] = ta["self_update"]
3+
a["self_update_url"] = ta["self_update_url"]
4+
return a, d
5+
end
6+
7+
def downgrade(ta, td, a, d)
8+
delete a["self_update"]
9+
delete a["self_update_url"]
10+
return a, d
11+
end

chef/data_bags/crowbar/template-provisioner.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
"access_keys": "",
1010
"shell_prompt": "USER@HOST:CWD SUFFIX",
1111
"enable_pxe": true,
12+
"self_update": false,
13+
"self_update_url": "",
1214
"discovery": {
1315
"append": ""
1416
},
@@ -199,7 +201,7 @@
199201
"provisioner": {
200202
"crowbar-revision": 0,
201203
"crowbar-applied": false,
202-
"schema-revision": 101,
204+
"schema-revision": 102,
203205
"element_states": {
204206
"provisioner-server": [ "readying", "ready", "applying" ],
205207
"provisioner-base": [ "hardware-installing", "readying", "ready", "applying" ]

chef/data_bags/crowbar/template-provisioner.schema

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
"access_keys": { "type": "str", "required": true },
2020
"shell_prompt": { "type": "str", "required": true },
2121
"enable_pxe": { "type": "bool", "required": true },
22+
"self_update": { "type": "bool", "required": true },
23+
"self_update_url": { "type": "str", "required": true },
2224
"web_port": { "type": "int", "required": true },
2325
"keep_existing_hostname": { "type": "bool", "required": true },
2426
"timezone": { "type": "str", "required": true },

crowbar_framework/app/views/barclamp/provisioner/_edit_attributes.html.haml

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
%span.help-block
88
= t(".access_keys_hint")
99

10+
= boolean_field :self_update
11+
= string_field :self_update_url
12+
1013
= string_field :shell_prompt
1114
%span.help-block
1215
= t(".shell_prompt_hint")

crowbar_framework/config/locales/provisioner/en.yml

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ en:
2121
edit_attributes:
2222
access_keys: 'Additional SSH keys'
2323
access_keys_hint: 'Each SSH key must be on its own line'
24+
self_update: 'AutoYaST Self-update'
25+
self_update_url: 'AutoYaST Self-update URL'
2426
shell_prompt: 'Custom Shell Prompt'
2527
shell_prompt_hint: 'You can use the placeholders USER, ALIAS, HOST, FQDN, CWD and SUFFIX to customize the shell prompt on all nodes. Add a \n for a new line within the prompt.'
2628
serial_console: 'Serial Console'

0 commit comments

Comments
 (0)