Skip to content

Commit

Permalink
[provisioner] Add autoyast self update option
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasbock committed Nov 24, 2016
1 parent 5c1b677 commit b3caa83
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 1 deletion.
2 changes: 2 additions & 0 deletions chef/cookbooks/provisioner/recipes/update_nodes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,8 @@ def find_node_boot_mac_addresses(node, admin_data_net)
web_port: web_port,
packages: packages,
repos: repos,
self_update: node[:provisioner][:self_update],
self_update_url: node[:provisioner][:self_update_url],
rootpw_hash: node[:provisioner][:root_password_hash] || "",
timezone: timezone,
boot_device: (mnode[:crowbar_wall][:boot_device] rescue nil),
Expand Down
3 changes: 3 additions & 0 deletions chef/cookbooks/provisioner/templates/default/autoyast.xml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
<import_gpg_key config:type="boolean">true</import_gpg_key>
</signature-handling>
<storage/>
<% if @self_update %>
<self_update_url><%= @self_update_url %></self_update_url>
<% end %>
</general>
<add-on>
<add_on_products config:type="list">
Expand Down
11 changes: 11 additions & 0 deletions chef/data_bags/crowbar/migrate/provisioner/102_self_update.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
def upgrade(ta, td, a, d)
a["self_update"] = ta["self_update"]
a["self_update_url"] = ta["self_update_url"]
return a, d
end

def downgrade(ta, td, a, d)
delete a["self_update"]
delete a["self_update_url"]
return a, d
end
4 changes: 3 additions & 1 deletion chef/data_bags/crowbar/template-provisioner.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
"access_keys": "",
"shell_prompt": "USER@HOST:CWD SUFFIX",
"enable_pxe": true,
"self_update": false,
"self_update_url": "",
"discovery": {
"append": ""
},
Expand Down Expand Up @@ -199,7 +201,7 @@
"provisioner": {
"crowbar-revision": 0,
"crowbar-applied": false,
"schema-revision": 101,
"schema-revision": 102,
"element_states": {
"provisioner-server": [ "readying", "ready", "applying" ],
"provisioner-base": [ "hardware-installing", "readying", "ready", "applying" ]
Expand Down
2 changes: 2 additions & 0 deletions chef/data_bags/crowbar/template-provisioner.schema
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
"access_keys": { "type": "str", "required": true },
"shell_prompt": { "type": "str", "required": true },
"enable_pxe": { "type": "bool", "required": true },
"self_update": { "type": "bool", "required": true },
"self_update_url": { "type": "str", "required": true },
"web_port": { "type": "int", "required": true },
"keep_existing_hostname": { "type": "bool", "required": true },
"timezone": { "type": "str", "required": true },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
%span.help-block
= t(".access_keys_hint")

= boolean_field :self_update
= string_field :self_update_url

= string_field :shell_prompt
%span.help-block
= t(".shell_prompt_hint")
Expand Down
2 changes: 2 additions & 0 deletions crowbar_framework/config/locales/provisioner/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ en:
edit_attributes:
access_keys: 'Additional SSH keys'
access_keys_hint: 'Each SSH key must be on its own line'
self_update: 'AutoYaST Self-update'
self_update_url: 'AutoYaST Self-update URL'
shell_prompt: 'Custom Shell Prompt'
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.'
serial_console: 'Serial Console'
Expand Down

0 comments on commit b3caa83

Please sign in to comment.