staypuft 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/staypuft/host_edit.js +114 -0
- data/app/controllers/staypuft/hosts_controller.rb +17 -0
- data/app/helpers/staypuft/application_helper.rb +2 -1
- data/app/lib/staypuft/network_query.rb +7 -1
- data/app/lib/staypuft/seeder.rb +69 -1
- data/app/models/staypuft/concerns/nic_fencing_extensions.rb +28 -0
- data/app/models/staypuft/deployment/ceph_service.rb +33 -0
- data/app/models/staypuft/deployment/cinder_service.rb +1 -3
- data/app/models/staypuft/deployment.rb +5 -3
- data/app/overrides/foreman_hosts_edit.rb +24 -0
- data/app/views/hosts/_fencing.html.erb +25 -0
- data/app/views/staypuft/steps/_cinder.html.erb +6 -4
- data/config/routes.rb +6 -0
- data/lib/staypuft/engine.rb +1 -0
- data/lib/staypuft/version.rb +1 -1
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb78ba28b433c78bd8f8d9a1f0cc5a4c4cc185a6
|
4
|
+
data.tar.gz: 0eb3ff52a83c0fa63e4dee33dfc37c2e6eeffeef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 959238ed73d99ddda11f7e4257a5163e12fccb6e9b42d31aeeda6d0eb746de40845305972a2003696d4838f3537a976f4b538861d7761a5b9995c195520f2b8b
|
7
|
+
data.tar.gz: 1632029a27cdc779f060aaf6f026cebcca45521620e83e3de78835fe2ddb58575e611387e3a63df8557ef4eccc9b111d5b5f13de2ed0226dda6ed3f6e8382e87
|
@@ -0,0 +1,114 @@
|
|
1
|
+
$(document).ready(function() {
|
2
|
+
update_fencing_form();
|
3
|
+
// NOTE: setTimeout is required to make sure this code runs after all event
|
4
|
+
// handlers are set, so they can be overridden.
|
5
|
+
setTimeout(function() {
|
6
|
+
override_ajax_submit();
|
7
|
+
}, 1);
|
8
|
+
});
|
9
|
+
|
10
|
+
function override_ajax_submit() {
|
11
|
+
// NOTE: method defined in app/assets/javascripts/host_edit.js but modified
|
12
|
+
// so the URL points to staypuft/hosts controller.
|
13
|
+
function submit_host(){
|
14
|
+
var url = window.location.pathname.replace(/\/edit$|\/new$/,'');
|
15
|
+
url = url.replace(/\/hosts/,'\/staypuft/hosts')
|
16
|
+
if(/\/clone$/.test(window.location.pathname)){ url = foreman_url('/staypuft/hosts'); }
|
17
|
+
$('#host_submit').attr('disabled', true);
|
18
|
+
stop_pooling = false;
|
19
|
+
$("body").css("cursor", "progress");
|
20
|
+
clear_errors();
|
21
|
+
animate_progress();
|
22
|
+
|
23
|
+
$.ajax({
|
24
|
+
type:'POST',
|
25
|
+
url: url,
|
26
|
+
data: $('form').serialize(),
|
27
|
+
success: function(response){
|
28
|
+
if(response.redirect){
|
29
|
+
window.location.replace(response.redirect);
|
30
|
+
}
|
31
|
+
else{
|
32
|
+
$("#host-progress").hide();
|
33
|
+
$('#content').replaceWith($("#content", response));
|
34
|
+
$(document.body).trigger('ContentLoad');
|
35
|
+
if($("[data-history-url]").exists()){
|
36
|
+
history.pushState({}, "Host show", $("[data-history-url]").data('history-url'));
|
37
|
+
}
|
38
|
+
}
|
39
|
+
},
|
40
|
+
error: function(response){
|
41
|
+
$('#content').html(response.responseText);
|
42
|
+
},
|
43
|
+
complete: function(){
|
44
|
+
stop_pooling = true;
|
45
|
+
$("body").css("cursor", "auto");
|
46
|
+
$('#host_submit').attr('disabled', false);
|
47
|
+
}
|
48
|
+
});
|
49
|
+
return false;
|
50
|
+
}
|
51
|
+
|
52
|
+
$(document).off('submit').on('submit',"[data-submit='progress_bar']", function() {
|
53
|
+
submit_host();
|
54
|
+
return false;
|
55
|
+
});
|
56
|
+
};
|
57
|
+
|
58
|
+
$(document).on('change', 'fieldset#interface', function() { update_fencing_form(); });
|
59
|
+
$(document).on('change', '#fencing', function() { update_bmc_interface_form(); });
|
60
|
+
|
61
|
+
function get_value_from_network_interface_form(fieldset, field, html_input_type) {
|
62
|
+
label = fieldset.find("label[for='" + field + "']");
|
63
|
+
html_input = label.parent().find(html_input_type);
|
64
|
+
|
65
|
+
return html_input;
|
66
|
+
};
|
67
|
+
|
68
|
+
function get_bmc_interface_form() {
|
69
|
+
return $('fieldset#interface').filter(function(index, fieldset){
|
70
|
+
type = get_value_from_network_interface_form($(fieldset), 'type', 'select');
|
71
|
+
return type.val() == 'Nic::BMC';
|
72
|
+
});
|
73
|
+
}
|
74
|
+
|
75
|
+
function update_fencing_form() {
|
76
|
+
bmc_fieldset = get_bmc_interface_form();
|
77
|
+
if (bmc_fieldset.length == 0) {
|
78
|
+
disable_fencing_form();
|
79
|
+
return;
|
80
|
+
} else {
|
81
|
+
enable_fencing_form();
|
82
|
+
}
|
83
|
+
|
84
|
+
selected_provider = get_value_from_network_interface_form(bmc_fieldset, 'provider', 'select');
|
85
|
+
|
86
|
+
ip = get_value_from_network_interface_form(bmc_fieldset, 'ip', 'input').val();
|
87
|
+
$('#host_fencing_attrs_fence_ipmilan_address').val(ip);
|
88
|
+
username = get_value_from_network_interface_form(bmc_fieldset, 'username', 'input').val();
|
89
|
+
$('#host_fencing_attrs_fence_ipmilan_username').val(username);
|
90
|
+
password = get_value_from_network_interface_form(bmc_fieldset, 'password', 'input').val();
|
91
|
+
$('#host_fencing_attrs_fence_ipmilan_password').val(password);
|
92
|
+
};
|
93
|
+
|
94
|
+
function update_bmc_interface_form() {
|
95
|
+
bmc_fieldset = get_bmc_interface_form();
|
96
|
+
selected_provider = get_value_from_network_interface_form(bmc_fieldset, 'provider', 'select');
|
97
|
+
|
98
|
+
ip = $('#host_fencing_attrs_fence_ipmilan_address').val();
|
99
|
+
get_value_from_network_interface_form(bmc_fieldset, 'ip', 'input').val(ip);
|
100
|
+
username = $('#host_fencing_attrs_fence_ipmilan_username').val();
|
101
|
+
get_value_from_network_interface_form(bmc_fieldset, 'username', 'input').val(username);
|
102
|
+
password = $('#host_fencing_attrs_fence_ipmilan_password').val();
|
103
|
+
get_value_from_network_interface_form(bmc_fieldset, 'password', 'input').val(password);
|
104
|
+
};
|
105
|
+
|
106
|
+
function disable_fencing_form() {
|
107
|
+
$('#fencing_form').hide();
|
108
|
+
$('#fencing_disabled_notice').show();
|
109
|
+
};
|
110
|
+
|
111
|
+
function enable_fencing_form() {
|
112
|
+
$('#fencing_disabled_notice').hide();
|
113
|
+
$('#fencing_form').show();
|
114
|
+
};
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Staypuft
|
2
|
+
class HostsController < ::HostsController
|
3
|
+
|
4
|
+
before_filter :set_fencing_params, only: 'update'
|
5
|
+
|
6
|
+
private
|
7
|
+
def set_fencing_params
|
8
|
+
fencing_params = params['host'].delete('fencing')
|
9
|
+
|
10
|
+
if fencing_params['attrs']['fencing_enabled'] == '1'
|
11
|
+
host_attrs = params['host']['interfaces_attributes'].values.find{|host_attrs| host_attrs['provider'] == 'IPMI'}
|
12
|
+
host_attrs.merge!(fencing_params)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
@@ -30,7 +30,8 @@ module Staypuft
|
|
30
30
|
text = options.delete(:text)
|
31
31
|
checked_value = options.delete(:checked_value)
|
32
32
|
unchecked_value = options.delete(:unchecked_value)
|
33
|
-
|
33
|
+
group_class = options.delete(:group_class)
|
34
|
+
content_tag(:div, :class => "checkbox #{group_class}") do
|
34
35
|
label_tag('') do
|
35
36
|
f.check_box(attr, options, checked_value, unchecked_value) + " #{text} "
|
36
37
|
end
|
@@ -49,6 +49,11 @@ module Staypuft
|
|
49
49
|
interface_hash_for_host(host, subnet_type_name)[:interface]
|
50
50
|
end
|
51
51
|
|
52
|
+
def network_address_for_host(host, subnet_type_name)
|
53
|
+
subnet = interface_hash_for_host(host, subnet_type_name)[:subnet]
|
54
|
+
subnet.network_address if subnet
|
55
|
+
end
|
56
|
+
|
52
57
|
def controllers
|
53
58
|
@controllers ||= @deployment.controller_hostgroup.hosts.order(:id)
|
54
59
|
end
|
@@ -81,7 +86,8 @@ module Staypuft
|
|
81
86
|
end
|
82
87
|
|
83
88
|
class Jail < Safemode::Jail
|
84
|
-
allow :ip_for_host, :interface_for_host, :
|
89
|
+
allow :ip_for_host, :interface_for_host, :network_address_for_host,
|
90
|
+
:controller_ip, :controller_ips, :controller_fqdns, :get_vip
|
85
91
|
end
|
86
92
|
|
87
93
|
private
|
data/app/lib/staypuft/seeder.rb
CHANGED
@@ -294,6 +294,20 @@ module Staypuft
|
|
294
294
|
# Keystone
|
295
295
|
keystonerc = 'true'
|
296
296
|
|
297
|
+
# Ceph
|
298
|
+
ceph_cluster_network = { :string => "<%= @host.deployment.network_query.network_address_for_host(@host, '#{Staypuft::SubnetType::STORAGE_CLUSTERING}') %>" }
|
299
|
+
# FIXME: this should actually be STORAGE instead of PXE, but only after we have a reliable way of identifying DNS names
|
300
|
+
# on the storage network
|
301
|
+
ceph_public_network = { :string => "<%= @host.deployment.network_query.network_address_for_host(@host, '#{Staypuft::SubnetType::PXE}') %>" }
|
302
|
+
ceph_fsid = { :string => '<%= @host.deployment.ceph.fsid %>' }
|
303
|
+
ceph_images_key = { :string => '<%= @host.deployment.ceph.images_key %>' }
|
304
|
+
ceph_volumes_key = { :string => '<%= @host.deployment.ceph.volumes_key %>' }
|
305
|
+
# FIXME: this should move to STORAGE from PXE like above
|
306
|
+
ceph_mon_host = { :array => "<%= @host.deployment.network_query.controller_ips('#{Staypuft::SubnetType::PXE}') %>" }
|
307
|
+
# FIXME: This is currently the hostnames (which maps to fqdns on the PXE network) -- eventually we want DNS names
|
308
|
+
# on the Storage network
|
309
|
+
ceph_mon_initial_members = { :array => "<%= @host.deployment.ceph.mon_initial_members %>" }
|
310
|
+
|
297
311
|
# effective_value grabs shared password if deployment is in shared password mode,
|
298
312
|
# otherwise use the service-specific one
|
299
313
|
admin_pw = { :string => '<%= @host.deployment.passwords.effective_value(:admin) %>' }
|
@@ -341,9 +355,26 @@ module Staypuft
|
|
341
355
|
controller_priv_host = { :string => "<%= d = @host.deployment; d.ha? ? nil : d.network_query.controller_ip('#{Staypuft::SubnetType::MANAGEMENT}') %>"}
|
342
356
|
controller_pub_host = { :string => "<%= d = @host.deployment; d.ha? ? nil : d.network_query.controller_ip('#{Staypuft::SubnetType::PUBLIC_API}') %>"}
|
343
357
|
|
358
|
+
fencing_type = { :string => '<%= @host.bmc_nic.attrs["fencing_type"] if @host.bmc_nic && @host.bmc_nic.fencing_enabled? %>' }
|
359
|
+
fence_ipmilan_address = { :string => '<%= @host.bmc_nic.ip if @host.bmc_nic && @host.bmc_nic.fencing_enabled? %>' }
|
360
|
+
fence_ipmilan_username = { :string => '<%= @host.bmc_nic.username if @host.bmc_nic && @host.bmc_nic.fencing_enabled? %>' }
|
361
|
+
fence_ipmilan_password = { :string => '<%= @host.bmc_nic.password if @host.bmc_nic && @host.bmc_nic.fencing_enabled? %>' }
|
362
|
+
fence_ipmilan_interval = { :string => '<%= "60s" if @host.bmc_nic && @host.bmc_nic.fencing_enabled? %>' }
|
363
|
+
fence_ipmilan_hostlist = { :string => '<%= "" if @host.bmc_nic && @host.bmc_nic.fencing_enabled? %>' }
|
364
|
+
fence_ipmilan_host_to_address = { :array => '<%= [] if @host.bmc_nic && @host.bmc_nic.fencing_enabled? %>' }
|
365
|
+
fence_ipmilan_expose_lanplus = { :string => '<%= @host.bmc_nic.expose_lanplus? if @host.bmc_nic && @host.bmc_nic.fencing_enabled? %>' }
|
366
|
+
fence_ipmilan_lanplus_options = { :string => '<%= @host.bmc_nic.attrs["fence_ipmilan_lanplus_options"] if @host.bmc_nic && @host.bmc_nic.fencing_enabled? %>' }
|
367
|
+
|
344
368
|
{
|
345
369
|
'quickstack::nova_network::controller' => {
|
346
370
|
'amqp_provider' => amqp_provider,
|
371
|
+
'ceph_cluster_network' => ceph_cluster_network,
|
372
|
+
'ceph_public_network' => ceph_public_network,
|
373
|
+
'ceph_fsid' => ceph_fsid,
|
374
|
+
'ceph_images_key' => ceph_images_key,
|
375
|
+
'ceph_volumes_key' => ceph_volumes_key,
|
376
|
+
'ceph_mon_host' => ceph_mon_host,
|
377
|
+
'ceph_mon_initial_members' => ceph_mon_initial_members,
|
347
378
|
'cinder_backend_gluster' => cinder_backend_gluster,
|
348
379
|
'cinder_backend_gluster_name' => cinder_backend_gluster_name,
|
349
380
|
'cinder_backend_iscsi' => cinder_backend_iscsi,
|
@@ -406,6 +437,13 @@ module Staypuft
|
|
406
437
|
'controller_pub_host' => controller_pub_host },
|
407
438
|
'quickstack::neutron::controller' => {
|
408
439
|
'amqp_provider' => amqp_provider,
|
440
|
+
'ceph_cluster_network' => ceph_cluster_network,
|
441
|
+
'ceph_public_network' => ceph_public_network,
|
442
|
+
'ceph_fsid' => ceph_fsid,
|
443
|
+
'ceph_images_key' => ceph_images_key,
|
444
|
+
'ceph_volumes_key' => ceph_volumes_key,
|
445
|
+
'ceph_mon_host' => ceph_mon_host,
|
446
|
+
'ceph_mon_initial_members' => ceph_mon_initial_members,
|
409
447
|
'tenant_network_type' => tenant_network_type,
|
410
448
|
'ml2_network_vlan_ranges' => ml2_network_vlan_ranges,
|
411
449
|
'ml2_tenant_network_types' => ml2_tenant_network_types,
|
@@ -482,6 +520,13 @@ module Staypuft
|
|
482
520
|
'include_neutron' => neutron,
|
483
521
|
'neutron' => neutron,
|
484
522
|
'ceilometer_user_password' => ceilometer_user_pw,
|
523
|
+
'ceph_cluster_network' => ceph_cluster_network,
|
524
|
+
'ceph_public_network' => ceph_public_network,
|
525
|
+
'ceph_fsid' => ceph_fsid,
|
526
|
+
'ceph_images_key' => ceph_images_key,
|
527
|
+
'ceph_volumes_key' => ceph_volumes_key,
|
528
|
+
'ceph_mon_host' => ceph_mon_host,
|
529
|
+
'ceph_mon_initial_members' => ceph_mon_initial_members,
|
485
530
|
'cinder_db_password' => cinder_db_pw,
|
486
531
|
'cinder_user_password' => cinder_user_pw,
|
487
532
|
'glance_db_password' => glance_db_pw,
|
@@ -535,7 +580,16 @@ module Staypuft
|
|
535
580
|
'lb_backend_server_addrs' => { :array => "<%= @host.deployment.network_query.controller_ips('#{Staypuft::SubnetType::MANAGEMENT}') %>" },
|
536
581
|
'lb_backend_server_names' => { :array => '<%= @host.deployment.network_query.controller_fqdns %>' } },
|
537
582
|
'quickstack::pacemaker::common' => {
|
538
|
-
'pacemaker_cluster_members' => { :string => "<%= @host.deployment.network_query.controller_ips('#{Staypuft::SubnetType::MANAGEMENT}').join(' ') %>" }
|
583
|
+
'pacemaker_cluster_members' => { :string => "<%= @host.deployment.network_query.controller_ips('#{Staypuft::SubnetType::MANAGEMENT}').join(' ') %>" },
|
584
|
+
'fencing_type' => fencing_type,
|
585
|
+
'fence_ipmilan_address' => fence_ipmilan_address,
|
586
|
+
'fence_ipmilan_username' => fence_ipmilan_username,
|
587
|
+
'fence_ipmilan_password' => fence_ipmilan_password,
|
588
|
+
'fence_ipmilan_interval' => fence_ipmilan_interval,
|
589
|
+
'fence_ipmilan_hostlist' => fence_ipmilan_hostlist,
|
590
|
+
'fence_ipmilan_host_to_address' => fence_ipmilan_host_to_address,
|
591
|
+
'fence_ipmilan_expose_lanplus' => fence_ipmilan_expose_lanplus,
|
592
|
+
'fence_ipmilan_lanplus_options' => fence_ipmilan_lanplus_options },
|
539
593
|
'quickstack::pacemaker::neutron' => {
|
540
594
|
'ml2_network_vlan_ranges' => ml2_network_vlan_ranges,
|
541
595
|
'ml2_tenant_network_types' => ml2_tenant_network_types,
|
@@ -618,6 +672,13 @@ module Staypuft
|
|
618
672
|
'quickstack::nova_network::compute' => {
|
619
673
|
'amqp_provider' => amqp_provider,
|
620
674
|
'ceilometer' => ceilometer,
|
675
|
+
'ceph_cluster_network' => ceph_cluster_network,
|
676
|
+
'ceph_public_network' => ceph_public_network,
|
677
|
+
'ceph_fsid' => ceph_fsid,
|
678
|
+
'ceph_images_key' => ceph_images_key,
|
679
|
+
'ceph_volumes_key' => ceph_volumes_key,
|
680
|
+
'ceph_mon_host' => ceph_mon_host,
|
681
|
+
'ceph_mon_initial_members' => ceph_mon_initial_members,
|
621
682
|
'cinder_backend_gluster' => cinder_backend_gluster,
|
622
683
|
'cinder_backend_nfs' => cinder_backend_nfs,
|
623
684
|
'cinder_backend_rbd' => cinder_backend_rbd,
|
@@ -646,6 +707,13 @@ module Staypuft
|
|
646
707
|
'quickstack::neutron::compute' => {
|
647
708
|
'amqp_provider' => amqp_provider,
|
648
709
|
'ceilometer' => ceilometer,
|
710
|
+
'ceph_cluster_network' => ceph_cluster_network,
|
711
|
+
'ceph_public_network' => ceph_public_network,
|
712
|
+
'ceph_fsid' => ceph_fsid,
|
713
|
+
'ceph_images_key' => ceph_images_key,
|
714
|
+
'ceph_volumes_key' => ceph_volumes_key,
|
715
|
+
'ceph_mon_host' => ceph_mon_host,
|
716
|
+
'ceph_mon_initial_members' => ceph_mon_initial_members,
|
649
717
|
'cinder_backend_gluster' => cinder_backend_gluster,
|
650
718
|
'cinder_backend_nfs' => cinder_backend_nfs,
|
651
719
|
'cinder_backend_rbd' => cinder_backend_rbd,
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module Staypuft
|
2
|
+
module Concerns
|
3
|
+
module NicFencingExtensions
|
4
|
+
extend ActiveSupport::Concern
|
5
|
+
|
6
|
+
included do
|
7
|
+
attr_accessible :attrs
|
8
|
+
end
|
9
|
+
|
10
|
+
def fencing_enabled?
|
11
|
+
attrs['fencing_enabled'] == '1'
|
12
|
+
end
|
13
|
+
|
14
|
+
def expose_lanplus?
|
15
|
+
attrs['fence_ipmilan_expose_lanplus'] == '1'
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
class ::Host::Managed::Jail < Safemode::Jail
|
23
|
+
allow :bmc_nic
|
24
|
+
end
|
25
|
+
|
26
|
+
class ::Nic::Base::Jail < Safemode::Jail
|
27
|
+
allow :fencing_enabled?, :attrs, :username, :password, :expose_lanplus?
|
28
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module Staypuft
|
2
|
+
class Deployment::CephService < Deployment::AbstractParamScope
|
3
|
+
def self.param_scope
|
4
|
+
'ceph'
|
5
|
+
end
|
6
|
+
|
7
|
+
param_attr :fsid, :volumes_key, :images_key
|
8
|
+
|
9
|
+
|
10
|
+
class Jail < Safemode::Jail
|
11
|
+
allow :fsid, :volumes_key, :images_key, :mon_initial_members
|
12
|
+
end
|
13
|
+
|
14
|
+
def set_defaults
|
15
|
+
self.fsid = SecureRandom.uuid
|
16
|
+
key = ` ceph-authtool --gen-print-key`
|
17
|
+
key.chomp! if key
|
18
|
+
self.volumes_key = key
|
19
|
+
key = ` ceph-authtool --gen-print-key`
|
20
|
+
key.chomp! if key
|
21
|
+
self.images_key = key
|
22
|
+
end
|
23
|
+
|
24
|
+
def mon_initial_members
|
25
|
+
fqdns = deployment.network_query.controller_fqdns.map {|fqdn| fqdn.split(".").first}
|
26
|
+
end
|
27
|
+
|
28
|
+
def param_hash
|
29
|
+
{ "fsid" => fsid, "volumes_key" => volumes_key, "images_key" => images_key }
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
end
|
@@ -145,9 +145,7 @@ module Staypuft
|
|
145
145
|
|
146
146
|
def at_least_one_backend_selected
|
147
147
|
params = BACKEND_TYPE_PARAMS.clone
|
148
|
-
if self.deployment.ha?
|
149
|
-
params.delete :backend_lvm
|
150
|
-
end
|
148
|
+
params.delete :backend_lvm if self.deployment.ha?
|
151
149
|
unless params.detect(lambda { false }) { |field| self.send(field) == "true" }
|
152
150
|
errors.add :base, _("At least one storage backend must be selected")
|
153
151
|
end
|
@@ -13,7 +13,7 @@ module Staypuft
|
|
13
13
|
|
14
14
|
# supporting import/export
|
15
15
|
EXPORT_PARAMS = [:amqp_provider, :networking, :layout_name, :platform]
|
16
|
-
EXPORT_SERVICES = [:nova, :neutron, :glance, :cinder, :passwords]
|
16
|
+
EXPORT_SERVICES = [:nova, :neutron, :glance, :cinder, :passwords, :ceph]
|
17
17
|
|
18
18
|
attr_accessible :description, :name, :layout_id, :layout,
|
19
19
|
:amqp_provider, :layout_name, :networking, :platform
|
@@ -60,7 +60,8 @@ module Staypuft
|
|
60
60
|
[:neutron, :@neutron_service, NeutronService],
|
61
61
|
[:glance, :@glance_service, GlanceService],
|
62
62
|
[:cinder, :@cinder_service, CinderService],
|
63
|
-
[:passwords, :@passwords, Passwords]
|
63
|
+
[:passwords, :@passwords, Passwords],
|
64
|
+
[:ceph, :@ceph, CephService]]
|
64
65
|
|
65
66
|
SCOPES.each do |name, ivar, scope_class|
|
66
67
|
define_method name do
|
@@ -90,6 +91,7 @@ module Staypuft
|
|
90
91
|
self.glance.set_defaults
|
91
92
|
self.cinder.set_defaults
|
92
93
|
self.passwords.set_defaults
|
94
|
+
self.ceph.set_defaults
|
93
95
|
self.layout = Layout.where(:name => self.layout_name,
|
94
96
|
:networking => self.networking).first
|
95
97
|
end
|
@@ -195,7 +197,7 @@ module Staypuft
|
|
195
197
|
|
196
198
|
class Jail < Safemode::Jail
|
197
199
|
allow :amqp_provider, :networking, :layout_name, :platform, :nova_networking?, :neutron_networking?,
|
198
|
-
:nova, :neutron, :glance, :cinder, :passwords, :ha?, :non_ha?,
|
200
|
+
:nova, :neutron, :glance, :cinder, :passwords, :ceph, :ha?, :non_ha?,
|
199
201
|
:hide_ceph_notification?, :network_query
|
200
202
|
end
|
201
203
|
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# older deface requires code prefix for erb tags
|
2
|
+
if Gem.loaded_specs['deface'].version >= Gem::Version.new('1.0.0')
|
3
|
+
erb_tag = 'erb[loud]'
|
4
|
+
else
|
5
|
+
erb_tag = 'code[erb-loud]'
|
6
|
+
end
|
7
|
+
|
8
|
+
Deface::Override.new(:virtual_path => "hosts/_form",
|
9
|
+
:name => "include_custom_js_for_hosts_edit",
|
10
|
+
:insert_after => "erb[loud]:contains('form_for')",
|
11
|
+
:text => "<%= javascript 'staypuft/host_edit'%>"
|
12
|
+
)
|
13
|
+
|
14
|
+
Deface::Override.new(:virtual_path => "hosts/_form",
|
15
|
+
:name => "add_fencing_tab_to_hosts_edit",
|
16
|
+
:insert_after => "li > a[href='#network']",
|
17
|
+
:text => "<li><a href='#fencing' data-toggle='tab'><%= _('Fencing') %></a></li>"
|
18
|
+
)
|
19
|
+
|
20
|
+
Deface::Override.new(:virtual_path => "hosts/_unattended",
|
21
|
+
:name => "add_fencing_form_to_hosts_edit",
|
22
|
+
:insert_after => "#network",
|
23
|
+
:text => "<div class='tab-pane' id='fencing'><%= render 'hosts/fencing', :host => @host, :f => f %></div>"
|
24
|
+
)
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<div id="fencing_form">
|
2
|
+
<%= f.fields_for :fencing do |fencing_fields| %>
|
3
|
+
<%= fencing_fields.fields_for :attrs do |attrs_fields| %>
|
4
|
+
<%= checkbox_f attrs_fields, :fencing_enabled,
|
5
|
+
label: _("Enable Fencing") %>
|
6
|
+
<%= select_f attrs_fields, :fencing_type, [_("IPMI")], :to_s, :to_s,
|
7
|
+
{ include_blank: true },
|
8
|
+
{ label: _("Type") } %>
|
9
|
+
<%= text_f attrs_fields, :fence_ipmilan_address,
|
10
|
+
label: _("IP Address") %>
|
11
|
+
<%= text_f attrs_fields, :fence_ipmilan_username,
|
12
|
+
label: _("Username")%>
|
13
|
+
<%= password_f attrs_fields, :fence_ipmilan_password,
|
14
|
+
label: _("Password"),
|
15
|
+
placeholder: '********' %>
|
16
|
+
<%= checkbox_f attrs_fields, :fence_ipmilan_expose_lanplus,
|
17
|
+
label: _("Expose Lanplus") %>
|
18
|
+
<%= text_f attrs_fields, :fence_ipmilan_lanplus_options,
|
19
|
+
label: _("Lanplus Options") %>
|
20
|
+
<% end %>
|
21
|
+
<% end %>
|
22
|
+
</div>
|
23
|
+
<div id="fencing_disabled_notice" style="display: none;">
|
24
|
+
<%= _("Fencing is disabled. To enable, first you need to add a BMC interface to the Host.") %>
|
25
|
+
</div>
|
@@ -7,7 +7,7 @@
|
|
7
7
|
<%= check_box_f_non_inline(p, :backend_nfs,
|
8
8
|
:checked_value => 'true',
|
9
9
|
:unchecked_value => 'false',
|
10
|
-
:text =>
|
10
|
+
:text => _(Staypuft::Deployment::CinderService::DriverBackend::LABELS['nfs']))
|
11
11
|
%>
|
12
12
|
<div class="cinder_nfs_uri col-md-offset-1 hide">
|
13
13
|
|
@@ -20,19 +20,21 @@
|
|
20
20
|
<%= check_box_f_non_inline(p, :backend_lvm,
|
21
21
|
:checked_value => 'true',
|
22
22
|
:unchecked_value => 'false',
|
23
|
-
:
|
23
|
+
:checked => @deployment.cinder.lvm_backend?,
|
24
|
+
:group_class => @deployment.ha? ? "hide" : "",
|
25
|
+
:text => _(Staypuft::Deployment::CinderService::DriverBackend::LABELS['lvm']))
|
24
26
|
%>
|
25
27
|
|
26
28
|
<%= check_box_f_non_inline(p, :backend_ceph,
|
27
29
|
:checked_value => 'true',
|
28
30
|
:unchecked_value => 'false',
|
29
|
-
:text =>
|
31
|
+
:text => _(Staypuft::Deployment::CinderService::DriverBackend::LABELS['ceph']))
|
30
32
|
%>
|
31
33
|
|
32
34
|
<%= check_box_f_non_inline(p, :backend_eqlx,
|
33
35
|
:checked_value => 'true',
|
34
36
|
:unchecked_value => 'false',
|
35
|
-
:text =>
|
37
|
+
:text => _(Staypuft::Deployment::CinderService::DriverBackend::LABELS['equallogic']))
|
36
38
|
%>
|
37
39
|
<div class="cinder_equallogic col-md-offset-1 hide">
|
38
40
|
<div id="eqlxs" class="cinder_equallogic_picker">
|
data/config/routes.rb
CHANGED
data/lib/staypuft/engine.rb
CHANGED
@@ -38,6 +38,7 @@ module Staypuft
|
|
38
38
|
::Hostgroup.send :include, Staypuft::Concerns::HostgroupExtensions
|
39
39
|
::Environment.send :include, Staypuft::Concerns::EnvironmentExtensions
|
40
40
|
::LookupKey.send :include, Staypuft::Concerns::LookupKeyExtensions
|
41
|
+
::Nic::Base.send :include, Staypuft::Concerns::NicFencingExtensions
|
41
42
|
|
42
43
|
# preload all the Foreman's lib files but only in production
|
43
44
|
if Rails.env.production?
|
data/lib/staypuft/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: staypuft
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Staypuft team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: foreman-tasks
|
@@ -88,6 +88,7 @@ extensions: []
|
|
88
88
|
extra_rdoc_files: []
|
89
89
|
files:
|
90
90
|
- app/assets/javascripts/staypuft/nics_assignment.js
|
91
|
+
- app/assets/javascripts/staypuft/host_edit.js
|
91
92
|
- app/assets/javascripts/staypuft/staypuft.js
|
92
93
|
- app/assets/javascripts/staypuft/subnets_assignment.js
|
93
94
|
- app/assets/stylesheets/staypuft/bootstrap_and_overrides.css.scss
|
@@ -95,6 +96,7 @@ files:
|
|
95
96
|
- app/assets/stylesheets/staypuft/staypuft.css.scss
|
96
97
|
- app/controllers/staypuft/application_controller.rb
|
97
98
|
- app/controllers/staypuft/subnet_typings_controller.rb
|
99
|
+
- app/controllers/staypuft/hosts_controller.rb
|
98
100
|
- app/controllers/staypuft/interface_assignments_controller.rb
|
99
101
|
- app/controllers/staypuft/steps_controller.rb
|
100
102
|
- app/controllers/staypuft/deployments_controller.rb
|
@@ -103,6 +105,7 @@ files:
|
|
103
105
|
- app/models/staypuft/interface_assigner.rb
|
104
106
|
- app/models/staypuft/role.rb
|
105
107
|
- app/models/staypuft/deployment/vlan_range_values_validator.rb
|
108
|
+
- app/models/staypuft/deployment/ceph_service.rb
|
106
109
|
- app/models/staypuft/deployment/nova_service.rb
|
107
110
|
- app/models/staypuft/deployment/cinder_service.rb
|
108
111
|
- app/models/staypuft/deployment/abstract_param_scope.rb
|
@@ -117,6 +120,7 @@ files:
|
|
117
120
|
- app/models/staypuft/concerns/vip_nic_scopes.rb
|
118
121
|
- app/models/staypuft/concerns/hostgroup_extensions.rb
|
119
122
|
- app/models/staypuft/concerns/puppetclass_extensions.rb
|
123
|
+
- app/models/staypuft/concerns/nic_fencing_extensions.rb
|
120
124
|
- app/models/staypuft/concerns/host_details_helper.rb
|
121
125
|
- app/models/staypuft/concerns/subnet_ip_management.rb
|
122
126
|
- app/models/staypuft/concerns/environment_extensions.rb
|
@@ -133,6 +137,7 @@ files:
|
|
133
137
|
- app/models/staypuft/deployment_role_hostgroup.rb
|
134
138
|
- app/models/setting/staypuft_provisioning.rb
|
135
139
|
- app/overrides/customize_foreman_tasks_show_page.rb
|
140
|
+
- app/overrides/foreman_hosts_edit.rb
|
136
141
|
- app/overrides/hide_subscription_manager_passwords.rb
|
137
142
|
- app/lib/actions/staypuft/hostgroup/ordered_deploy.rb
|
138
143
|
- app/lib/actions/staypuft/hostgroup/deploy.rb
|
@@ -150,6 +155,7 @@ files:
|
|
150
155
|
- app/lib/staypuft/seeder.rb
|
151
156
|
- app/lib/staypuft/exception.rb
|
152
157
|
- app/lib/staypuft/deployment_param_exporter.rb
|
158
|
+
- app/views/hosts/_fencing.html.erb
|
153
159
|
- app/views/staypuft/steps/_nova.html.erb
|
154
160
|
- app/views/staypuft/steps/_neutron_non_ha.html.erb
|
155
161
|
- app/views/staypuft/steps/services_overview.html.erb
|