Skip to content

Commit 8f70db2

Browse files
committed
[provisioner] Add autoyast self update option
1 parent c8f5af2 commit 8f70db2

File tree

7 files changed

+33
-1
lines changed

7 files changed

+33
-1
lines changed

chef/cookbooks/provisioner/recipes/update_nodes.rb

+3
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ def find_node_boot_mac_addresses(node, admin_data_net)
290290
append << "ifcfg=dhcp4 netwait=60"
291291
append << "squash=0" # workaround bsc#962397
292292
append << "autoupgrade=1" if mnode[:state] == "os-upgrading"
293+
append << "self_update"
293294

294295
target_platform_distro = os.gsub(/-.*$/, "")
295296
target_platform_version = os.gsub(/^.*-/, "")
@@ -333,6 +334,8 @@ def find_node_boot_mac_addresses(node, admin_data_net)
333334
web_port: web_port,
334335
packages: packages,
335336
repos: repos,
337+
self_update_url: node[:provisioner][:self_update_url].gsub(
338+
/<ADMINWEB>/, "#{admin_ip}:#{web_port}"),
336339
rootpw_hash: node[:provisioner][:root_password_hash] || "",
337340
timezone: timezone,
338341
boot_device: (mnode[:crowbar_wall][:boot_device] rescue nil),

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

+15
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,22 @@
2626
<import_gpg_key config:type="boolean">true</import_gpg_key>
2727
</signature-handling>
2828
<storage/>
29+
<% unless @self_update_url.nil? || @self_update_url.empty? -%>
30+
<self_update_url><%= @self_update_url %></self_update_url>
31+
<% end -%>
2932
</general>
33+
<report>
34+
<errors>
35+
<log config:type="boolean">true</log>
36+
<show config:type="boolean">true</show>
37+
<timeout config:type="integer">10</timeout>
38+
</errors>
39+
<warnings>
40+
<log config:type="boolean">true</log>
41+
<show config:type="boolean">true</show>
42+
<timeout config:type="integer">10</timeout>
43+
</warnings>
44+
</report>
3045
<add-on>
3146
<add_on_products config:type="list">
3247
<% @repos.keys.sort.each do |name| %>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
def upgrade(ta, td, a, d)
2+
a["self_update_url"] = ta["self_update_url"]
3+
return a, d
4+
end
5+
6+
def downgrade(ta, td, a, d)
7+
delete a["self_update_url"]
8+
return a, d
9+
end

chef/data_bags/crowbar/template-provisioner.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"access_keys": "",
1010
"shell_prompt": "USER@HOST:CWD SUFFIX",
1111
"enable_pxe": true,
12+
"self_update_url": "",
1213
"discovery": {
1314
"append": ""
1415
},
@@ -199,7 +200,7 @@
199200
"provisioner": {
200201
"crowbar-revision": 0,
201202
"crowbar-applied": false,
202-
"schema-revision": 101,
203+
"schema-revision": 102,
203204
"element_states": {
204205
"provisioner-server": [ "readying", "ready", "applying" ],
205206
"provisioner-base": [ "hardware-installing", "readying", "ready", "applying" ]

chef/data_bags/crowbar/template-provisioner.schema

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"access_keys": { "type": "str", "required": true },
2020
"shell_prompt": { "type": "str", "required": true },
2121
"enable_pxe": { "type": "bool", "required": true },
22+
"self_update_url": { "type": "str", "required": true },
2223
"web_port": { "type": "int", "required": true },
2324
"keep_existing_hostname": { "type": "bool", "required": true },
2425
"timezone": { "type": "str", "required": true },

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

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

10+
= string_field :self_update_url
11+
1012
= string_field :shell_prompt
1113
%span.help-block
1214
= t(".shell_prompt_hint")

crowbar_framework/config/locales/provisioner/en.yml

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ 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_url: 'AutoYaST Self-update URL (The alias <ADMINWEB> can be used to specify the admin node)'
2425
shell_prompt: 'Custom Shell Prompt'
2526
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.'
2627
serial_console: 'Serial Console'

0 commit comments

Comments
 (0)