staypuft 0.0.3 → 0.0.4
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.
- data/app/assets/javascripts/staypuft/staypuft.js +5 -0
- data/app/assets/stylesheets/staypuft/bootstrap_and_overrides.css.scss +42 -1
- data/app/assets/stylesheets/staypuft/staypuft.css.scss +4 -0
- data/app/controllers/staypuft/deployments_controller.rb +10 -53
- data/app/lib/actions/staypuft/host/wait_until_host_ready.rb +0 -18
- data/app/models/{settings/staypuft.rb → setting/staypuft_provisioning.rb} +4 -4
- data/app/models/staypuft/concerns/hostgroup_extensions.rb +5 -21
- data/app/models/staypuft/deployment.rb +3 -3
- data/app/models/staypuft/service.rb +21 -7
- data/app/views/staypuft/deployments/show.html.erb +43 -41
- data/db/seeds.rb +7 -8
- data/lib/staypuft/engine.rb +18 -0
- data/lib/staypuft/version.rb +1 -1
- metadata +3 -3
@@ -17,5 +17,10 @@ $(function() {
|
|
17
17
|
$('#check_all').on('change', function(e) {
|
18
18
|
var table = $(e.target).closest('table');
|
19
19
|
$('td input:checkbox', table).attr('checked', e.target.checked);
|
20
|
+
$('td input:checkbox', table).closest("tr").toggleClass("info", this.checked);
|
21
|
+
});
|
22
|
+
|
23
|
+
$("tr.checkbox_highlight input:checkbox").on('change', function(e) {
|
24
|
+
$(this).closest("tr").toggleClass("info", this.checked);
|
20
25
|
});
|
21
26
|
});
|
@@ -1,5 +1,46 @@
|
|
1
|
+
@import "bootstrap/variables";
|
1
2
|
@import "bootstrap/mixins";
|
2
|
-
|
3
|
+
|
4
|
+
// BEGIN Override non functioning table row backgrounds with table-stripped, remove
|
5
|
+
// when Bootstrap is updated to 3.1 and higher
|
6
|
+
@mixin table-row-variant($state, $background) {
|
7
|
+
// Exact selectors below required to override `.table-striped` and prevent
|
8
|
+
// inheritance to nested tables.
|
9
|
+
.table > thead > tr,
|
10
|
+
.table > tbody > tr,
|
11
|
+
.table > tfoot > tr {
|
12
|
+
> td.#{$state},
|
13
|
+
> th.#{$state},
|
14
|
+
&.#{$state} > td,
|
15
|
+
&.#{$state} > th {
|
16
|
+
background-color: $background;
|
17
|
+
}
|
18
|
+
}
|
19
|
+
|
20
|
+
// Hover states for `.table-hover`
|
21
|
+
// Note: this is not available for cells or rows within `thead` or `tfoot`.
|
22
|
+
.table-hover > tbody > tr {
|
23
|
+
> td.#{$state}:hover,
|
24
|
+
> th.#{$state}:hover,
|
25
|
+
&.#{$state}:hover > td,
|
26
|
+
&:hover > .#{$state},
|
27
|
+
&.#{$state}:hover > th {
|
28
|
+
background-color: darken($background, 5%);
|
29
|
+
}
|
30
|
+
}
|
31
|
+
}
|
32
|
+
// Table backgrounds
|
33
|
+
//
|
34
|
+
// Exact selectors below required to override `.table-striped` and prevent
|
35
|
+
// inheritance to nested tables.
|
36
|
+
|
37
|
+
// Generate the contextual variants
|
38
|
+
@include table-row-variant('active', $table-bg-active);
|
39
|
+
@include table-row-variant('info', $state-info-bg);
|
40
|
+
@include table-row-variant('success', $state-success-bg);
|
41
|
+
@include table-row-variant('danger', $state-danger-bg);
|
42
|
+
@include table-row-variant('warning', $state-warning-bg);
|
43
|
+
// END of the table-stripped backgrounds fix
|
3
44
|
|
4
45
|
.well {
|
5
46
|
padding: 19px 36px;
|
@@ -13,14 +13,13 @@ module Staypuft
|
|
13
13
|
return
|
14
14
|
end
|
15
15
|
|
16
|
-
|
17
|
-
base_hostgroup = Hostgroup.where(:name => 'base_hostgroup').first or
|
16
|
+
base_hostgroup = Hostgroup.where(:name => Setting[:base_hostgroup]).first or
|
18
17
|
raise 'missing base_hostgroup'
|
19
18
|
|
20
|
-
deployment
|
21
|
-
deployment.layout
|
22
|
-
|
23
|
-
deployment_hostgroup
|
19
|
+
deployment = Deployment.new(:name => Deployment::NEW_NAME_PREFIX+SecureRandom.hex)
|
20
|
+
deployment.layout = Layout.where(:name => "Distributed",
|
21
|
+
:networking => "neutron").first
|
22
|
+
deployment_hostgroup = ::Hostgroup.new name: deployment.name, parent: base_hostgroup
|
24
23
|
deployment_hostgroup.save!
|
25
24
|
|
26
25
|
deployment.hostgroup = deployment_hostgroup
|
@@ -56,57 +55,15 @@ module Staypuft
|
|
56
55
|
hostgroup = ::Hostgroup.find params[:hostgroup_id]
|
57
56
|
hosts = Array(::Host::Base.find *params[:host_ids])
|
58
57
|
hosts.each do |host|
|
59
|
-
host
|
60
|
-
host.
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
"managed" => "true",
|
65
|
-
"type" => "Host::Managed",
|
66
|
-
"domain_id" => "1",
|
67
|
-
"subnet_id" => "2",
|
68
|
-
"interfaces_attributes" =>
|
69
|
-
{ "new_interfaces" =>
|
70
|
-
{ "_destroy" => "false",
|
71
|
-
"type" => "Nic::Managed",
|
72
|
-
"mac" => "",
|
73
|
-
"name" => "",
|
74
|
-
"domain_id" => "",
|
75
|
-
"ip" => "",
|
76
|
-
"provider" => "IPMI" } },
|
77
|
-
"architecture_id" => "1",
|
78
|
-
"operatingsystem_id" => "2",
|
79
|
-
"provision_method" => "build",
|
80
|
-
"build" => "0",
|
81
|
-
"medium_id" => "7",
|
82
|
-
"ptable_id" => "6",
|
83
|
-
"disk" => "",
|
84
|
-
"root_pass" => "",
|
85
|
-
"enabled" => "1",
|
86
|
-
"overwrite" => "false" }
|
87
|
-
# host.type = 'Host::Managed'
|
88
|
-
# # host.name = 'a' + rand(1000).to_s
|
89
|
-
# host.managed = true
|
90
|
-
# host.build = true
|
91
|
-
host.hostgroup_id = hostgroup.id
|
58
|
+
host = host.becomes(::Host::Managed)
|
59
|
+
host.type = 'Host::Managed'
|
60
|
+
host.managed = true
|
61
|
+
host.build = false
|
62
|
+
host.hostgroup = hostgroup
|
92
63
|
host.save!
|
93
|
-
#
|
94
|
-
# host.build = false
|
95
|
-
# host.save!
|
96
64
|
end
|
97
65
|
redirect_to deployment_path(id: ::Staypuft::Deployment.first)
|
98
66
|
end
|
99
67
|
|
100
68
|
end
|
101
|
-
|
102
|
-
def self.test
|
103
|
-
User.current = User.first
|
104
|
-
discovered = Host::Discovered.first
|
105
|
-
host = discovered.becomes Host::Managed
|
106
|
-
hostgroup = Hostgroup.find(17)
|
107
|
-
host.hostgroup = hostgroup
|
108
|
-
p host.name
|
109
|
-
$host = host
|
110
|
-
host.save!
|
111
|
-
end
|
112
69
|
end
|
@@ -60,24 +60,6 @@ module Actions
|
|
60
60
|
fail(::Staypuft::Exception, "Latest Puppet Run Contains Failures for Host: #{host.id}")
|
61
61
|
end
|
62
62
|
end
|
63
|
-
|
64
|
-
def host_ready?(host_id)
|
65
|
-
host = ::Host.find(host_id)
|
66
|
-
host.reports.order('reported_at DESC').any? do |report|
|
67
|
-
check_for_failures(report)
|
68
|
-
report_change?(report)
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
def report_change?(report)
|
73
|
-
report.status['applied'] > 0
|
74
|
-
end
|
75
|
-
|
76
|
-
def check_for_failures(report)
|
77
|
-
#if report.status['failed'] > 0
|
78
|
-
# fail(::Staypuft::Exception, "Latest Puppet Run Contains Failures for Host with Report: #{report.id}")
|
79
|
-
#end
|
80
|
-
end
|
81
63
|
end
|
82
64
|
end
|
83
65
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class Setting::
|
1
|
+
class Setting::StaypuftProvisioning < ::Setting
|
2
2
|
BLANK_ATTRS << "base_hostgroup"
|
3
3
|
|
4
4
|
def self.load_defaults
|
@@ -8,10 +8,10 @@ class Setting::Staypuft < ::Setting
|
|
8
8
|
# fixme: not sure about the best way to store AR objects in settings.
|
9
9
|
# for now, since we know type, store ID. It might be good to add custom
|
10
10
|
# get/set code to decode the ID value into a hostgroup (which methods to call?)
|
11
|
-
|
11
|
+
self.transaction do
|
12
12
|
[
|
13
|
-
self.set("base_hostgroup", _("The base hostgroup which contains the base provisioning config"),
|
14
|
-
].compact.each { |s| self.create s.update(:category => "Setting::
|
13
|
+
self.set("base_hostgroup", _("The base hostgroup which contains the base provisioning config"), 'base_hostgroup')
|
14
|
+
].compact.each { |s| self.create s.update(:category => "Setting::StaypuftProvisioning")}
|
15
15
|
end
|
16
16
|
|
17
17
|
true
|
@@ -43,28 +43,12 @@ module Staypuft::Concerns::HostgroupExtensions
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def own_and_free_hosts
|
46
|
-
# TODO update to Discovered
|
47
|
-
Host::Base.where(
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
module ClassMethods
|
52
|
-
Gem::Version.new(SETTINGS[:version].to_s.gsub(/-develop$/, '')) < Gem::Version.new('1.5') or
|
53
|
-
Rails.logger.warn 'remove nest method, nesting Hostgroups is fixed in Foreman 1.5, use just parent_id'
|
54
|
-
|
55
|
-
def nest(name, parent)
|
56
|
-
new = parent.dup
|
57
|
-
new.parent_id = parent.id
|
58
|
-
new.name = name
|
59
|
-
|
60
|
-
new.puppetclasses = parent.puppetclasses
|
61
|
-
new.locations = parent.locations
|
62
|
-
new.organizations = parent.organizations
|
63
|
-
|
64
|
-
# Clone any parameters as well
|
65
|
-
new.group_parameters.each { |param| parent.group_parameters << param.dup }
|
66
|
-
new
|
46
|
+
# TODO update to Discovered only?
|
47
|
+
Host::Base.where('hostgroup_id = ? OR hostgroup_id IS NULL', id)
|
67
48
|
end
|
68
49
|
end
|
69
50
|
|
51
|
+
Gem::Version.new(SETTINGS[:version].to_s.gsub(/-develop$/, '')) < Gem::Version.new('1.5') and
|
52
|
+
Rails.logger.warn 'Foreman 1.5 is required for nesting of Hostgroups to work properly,' +
|
53
|
+
"please upgrade or expect failures.\n#{__FILE__}:#{__LINE__}"
|
70
54
|
end
|
@@ -14,7 +14,7 @@ module Staypuft
|
|
14
14
|
:source => :hostgroup
|
15
15
|
has_many :roles, :through => :deployment_role_hostgroups
|
16
16
|
|
17
|
-
validates
|
17
|
+
validates :name, :presence => true, :uniqueness => true
|
18
18
|
|
19
19
|
validates :layout, :presence => true
|
20
20
|
validates :hostgroup, :presence => true
|
@@ -35,8 +35,8 @@ module Staypuft
|
|
35
35
|
def update_hostgroup_list
|
36
36
|
old_role_hostgroups_arr = deployment_role_hostgroups.to_a
|
37
37
|
layout.layout_roles.each do |layout_role|
|
38
|
-
role_hostgroup = deployment_role_hostgroups.where(:role_id=>layout_role.role).first_or_initialize do |drh|
|
39
|
-
drh.hostgroup = Hostgroup.
|
38
|
+
role_hostgroup = deployment_role_hostgroups.where(:role_id => layout_role.role).first_or_initialize do |drh|
|
39
|
+
drh.hostgroup = Hostgroup.new(name: layout_role.role.name, parent: hostgroup)
|
40
40
|
end
|
41
41
|
|
42
42
|
role_hostgroup.hostgroup.add_puppetclasses_from_resource(layout_role.role)
|
@@ -24,7 +24,10 @@ module Staypuft
|
|
24
24
|
"controller_admin_host", "controller_priv_host",
|
25
25
|
"controller_pub_host", "freeipa", "horizon_ca",
|
26
26
|
"horizon_cert", "horizon_key", "horizon_secret_key",
|
27
|
-
"nova_db_password", "nova_user_password", "ssl"
|
27
|
+
"nova_db_password", "nova_user_password", "ssl",
|
28
|
+
"swift_admin_password", "swift_ringserver_ip",
|
29
|
+
"swift_shared_secret", "swift_storage_device",
|
30
|
+
"swift_storage_ips"],
|
28
31
|
"Neutron (Controller)" => ["admin_email", "admin_password",
|
29
32
|
"cisco_nexus_plugin", "cisco_vswitch_plugin",
|
30
33
|
"controller_admin_host", "controller_priv_host",
|
@@ -42,7 +45,10 @@ module Staypuft
|
|
42
45
|
"nova_user_password", "ovs_vlan_ranges",
|
43
46
|
"provider_vlan_auto_create", "provider_vlan_auto_trunk",
|
44
47
|
"ssl", "tenant_network_type", "tunnel_id_ranges",
|
45
|
-
"verbose"
|
48
|
+
"verbose",
|
49
|
+
"swift_admin_password", "swift_ringserver_ip",
|
50
|
+
"swift_shared_secret", "swift_storage_device",
|
51
|
+
"swift_storage_ips"],
|
46
52
|
"Glance"=> ["glance_db_password", "glance_user_password"],
|
47
53
|
"Cinder"=> ["cinder_backend_gluster", "cinder_backend_iscsi",
|
48
54
|
"cinder_db_password", "cinder_gluster_servers",
|
@@ -50,9 +56,17 @@ module Staypuft
|
|
50
56
|
"Heat"=> ["heat_cfn", "heat_cloudwatch", "heat_db_password", "heat_user_password"],
|
51
57
|
"Ceilometer"=> ["ceilometer_metering_secret", "ceilometer_user_password"
|
52
58
|
],
|
53
|
-
"Neutron - L3" => [
|
59
|
+
"Neutron - L3" => ["controller_priv_host", "enable_tunneling",
|
60
|
+
"external_network_bridge", "fixed_network_range",
|
61
|
+
"mysql_ca", "mysql_host", "neutron_db_password",
|
62
|
+
"neutron_metadata_proxy_secret", "neutron_user_password",
|
63
|
+
"nova_db_password", "nova_user_password",
|
64
|
+
"qpid_host", "ssl",
|
65
|
+
"tenant_network_type", "tunnel_id_ranges", "verbose"],
|
54
66
|
"DHCP" => [],
|
55
|
-
"OVS" => [
|
67
|
+
"OVS" => ["ovs_bridge_mappings", "ovs_bridge_uplinks",
|
68
|
+
"ovs_tunnel_iface", "ovs_tunnel_types", "ovs_vlan_ranges",
|
69
|
+
"ovs_vxlan_udp_port" ],
|
56
70
|
"Nova-compute" => ["admin_password", "auto_assign_floating_ip",
|
57
71
|
"ceilometer_metering_secret", "ceilometer_user_password",
|
58
72
|
"cinder_backend_gluster", "controller_priv_host",
|
@@ -73,9 +87,9 @@ module Staypuft
|
|
73
87
|
"ovs_vxlan_udp_port", "qpid_host", "ssl",
|
74
88
|
"tenant_network_type", "tunnel_id_ranges", "verbose"],
|
75
89
|
"Neutron-ovs-agent"=> [],
|
76
|
-
"Swift" => ["
|
77
|
-
"
|
78
|
-
|
90
|
+
"Swift" => ["swift_all_ips", "swift_ext4_device", "swift_local_interface",
|
91
|
+
"swift_loopback", "swift_ring_server", "swift_shared_secret"]
|
92
|
+
|
79
93
|
}
|
80
94
|
|
81
95
|
def ui_params_for_form(hostgroup = self.hostgroups.first)
|
@@ -2,24 +2,25 @@
|
|
2
2
|
|
3
3
|
<% content_for(:title_actions) do %>
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
5
|
+
<% if Rails.env.development? %>
|
6
|
+
<div class="btn-group">
|
7
|
+
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
8
|
+
<%= _('Populate with') %>
|
9
|
+
<span class="caret"></span>
|
10
|
+
</button>
|
11
|
+
<ul class="dropdown-menu" role="menu">
|
12
|
+
<li>
|
13
|
+
<%= display_link_if_authorized(_("Real assigned Hosts"), hash_for_populate_deployment_path(assign: true)) %>
|
14
|
+
</li>
|
15
|
+
<li>
|
16
|
+
<%= display_link_if_authorized(_("Real unassigned Hosts"), hash_for_populate_deployment_path) %>
|
17
|
+
</li>
|
18
|
+
<li>
|
19
|
+
<%= display_link_if_authorized(_("Fake unassigned Hosts"), hash_for_populate_deployment_path(:fake => true)) %>
|
20
|
+
</li>
|
21
|
+
</ul>
|
22
|
+
</div>
|
23
|
+
<% end %>
|
23
24
|
|
24
25
|
|
25
26
|
<%= display_link_if_authorized(_("Deploy"), hash_for_deploy_deployment_path, :class => 'btn-success') %>
|
@@ -32,12 +33,9 @@
|
|
32
33
|
<% @deployment.child_hostgroups.each_with_index do |child_hostgroup, i| %>
|
33
34
|
<li class="<%= 'active' if i == 0 %>">
|
34
35
|
<a href="#<%= child_hostgroup.name.parameterize.underscore %>" data-toggle="tab" class="roles_list">
|
35
|
-
<div class="col-xs-2 text-center">
|
36
|
-
|
37
|
-
<div class="col-xs-2 text-center">
|
38
|
-
<span class="glyphicon glyphicon-warning-sign"></span><span>0</span></div>
|
39
|
-
<div class="col-xs-2 text-center">
|
40
|
-
<span class="glyphicon glyphicon-time"></span><span>0</span></div>
|
36
|
+
<div class="col-xs-2 text-center"><span class="glyphicon glyphicon-ok"></span><span><%= child_hostgroup.hosts.count %></span></div>
|
37
|
+
<div class="col-xs-2 text-center"><span class="glyphicon glyphicon-warning-sign"></span><span>0</span></div>
|
38
|
+
<div class="col-xs-2 text-center"><span class="glyphicon glyphicon-time"></span><span>0</span></div>
|
41
39
|
<div class="col-xs-6"><%= child_hostgroup.name %></div>
|
42
40
|
<span class="clearfix"></span>
|
43
41
|
</a>
|
@@ -49,30 +47,34 @@
|
|
49
47
|
<% @deployment.child_hostgroups.each_with_index do |child_hostgroup, i| %>
|
50
48
|
<div class="tab-pane <%= 'active' if i == 0 %>" id="<%= child_hostgroup.name.parameterize.underscore %>">
|
51
49
|
<h3><%= _("Hosts") %></h3>
|
52
|
-
<%= form_tag(associate_host_deployments_path, class: 'form-horizontal well') do |f| %>
|
50
|
+
<%= form_tag(associate_host_deployments_path, class: 'form-horizontal well association') do |f| %>
|
53
51
|
<p>
|
54
52
|
<%= submit_tag _("Apply"), :class => "btn btn-primary btn-sm" %>
|
55
53
|
</p>
|
56
54
|
<%= hidden_field_tag :hostgroup_id, child_hostgroup.id %>
|
57
55
|
<table class="table table-bordered table-striped table-condensed">
|
58
|
-
<
|
59
|
-
<th>
|
60
|
-
<%= check_box_tag :check_all %>
|
61
|
-
</th>
|
62
|
-
<th><%= sort :label, :as => _('Host MAC Address') %></th>
|
63
|
-
<th><%= sort :label, :as => _('Host IP Address') %></th>
|
64
|
-
<th><%= _('Type') %></th>
|
65
|
-
</tr>
|
66
|
-
<% child_hostgroup.own_and_free_hosts.each do |host| %>
|
56
|
+
<thead>
|
67
57
|
<tr>
|
68
|
-
<
|
69
|
-
<%= check_box_tag
|
70
|
-
</
|
71
|
-
<
|
72
|
-
<
|
73
|
-
<
|
58
|
+
<th class="ca">
|
59
|
+
<%= check_box_tag :check_all %>
|
60
|
+
</th>
|
61
|
+
<th><%= sort :name, :as => _('Name') %></th>
|
62
|
+
<th class="hidden-s hidden-xs"><%= sort :mac, :as => _('MAC Address') %></th>
|
63
|
+
<th class="hidden-s hidden-xs"><%= sort :type, :as => _('Type') %></th>
|
74
64
|
</tr>
|
75
|
-
|
65
|
+
</thead>
|
66
|
+
<tbody>
|
67
|
+
<% child_hostgroup.own_and_free_hosts.each do |host| %>
|
68
|
+
<tr class="checkbox_highlight <%= "success" if child_hostgroup.host_ids.include?(host.id) %>">
|
69
|
+
<td class="ca">
|
70
|
+
<%= check_box_tag "host_ids[]", host.id, child_hostgroup.host_ids.include?(host.id), :id => "host_ids_#{host.id}" %>
|
71
|
+
</td>
|
72
|
+
<td class="ellipsis"><%= host.name %></td>
|
73
|
+
<td class="hidden-s hidden-xs"><%= host.mac %></td>
|
74
|
+
<td class="hidden-s hidden-xs"><%= host.type %></td>
|
75
|
+
</tr>
|
76
|
+
<% end %>
|
77
|
+
</tbody>
|
76
78
|
</table>
|
77
79
|
<% end %>
|
78
80
|
</div>
|
data/db/seeds.rb
CHANGED
@@ -62,7 +62,7 @@ params = {
|
|
62
62
|
"mysql_resource_group_name" => 'mysqlgrp',
|
63
63
|
"mysql_clu_member_addrs" => '192.168.203.11 192.168.203.12 192.168.203.13',
|
64
64
|
"qpid_host" => '172.16.0.1',
|
65
|
-
"admin_email" => "admin@#{Facter.domain}",
|
65
|
+
"admin_email" => "admin@#{Facter.value(:domain)}",
|
66
66
|
"neutron_metadata_proxy_secret" => SecureRandom.hex,
|
67
67
|
"enable_ovs_agent" => "true",
|
68
68
|
"ovs_vlan_ranges" => '',
|
@@ -193,7 +193,7 @@ roles = [
|
|
193
193
|
:services=>[:neutron_compute, :neutron_ovs_agent]},
|
194
194
|
{:name=>"Neutron Networker",
|
195
195
|
:class=>"quickstack::neutron::networker",
|
196
|
-
:layouts=>[[:ha_neutron, 2]],
|
196
|
+
:layouts=>[[:ha_neutron, 2], [:non_ha_neutron, 2]],
|
197
197
|
:services=>[:neutron_l3, :dhcp, :ovs]},
|
198
198
|
{:name=>"LVM Block Storage",
|
199
199
|
:class=>"quickstack::storage_backend::lvm_cinder",
|
@@ -202,7 +202,11 @@ roles = [
|
|
202
202
|
{:name=>"Load Balancer",
|
203
203
|
:class=>"quickstack::load_balancer",
|
204
204
|
:layouts=>[[:ha_nova, 4], [:ha_neutron, 4]],
|
205
|
-
:services=>[]}
|
205
|
+
:services=>[]},
|
206
|
+
{:name=>"Swift Storage Node",
|
207
|
+
:class=>"quickstack::swift::storage",
|
208
|
+
:layouts=>[[:non_ha_nova, 5], [:non_ha_neutron, 5]],
|
209
|
+
:services=>[:swift]}
|
206
210
|
]
|
207
211
|
|
208
212
|
roles.each do |r|
|
@@ -228,11 +232,6 @@ roles.each do |r|
|
|
228
232
|
|
229
233
|
role.description = r[:description]
|
230
234
|
r[:services].each do |key|
|
231
|
-
role.id
|
232
|
-
services[key]
|
233
|
-
services[key][:obj]
|
234
|
-
services[key][:obj].id
|
235
|
-
Staypuft::RoleService.where(:role_id => role.id, :service_id => services[key][:obj].id).first
|
236
235
|
Staypuft::RoleService.where(:role_id => role.id, :service_id => services[key][:obj].id).first_or_create!
|
237
236
|
end
|
238
237
|
role.save!
|
data/lib/staypuft/engine.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
module Staypuft
|
2
2
|
ENGINE_NAME = "staypuft"
|
3
3
|
class Engine < ::Rails::Engine
|
4
|
+
engine_name Staypuft::ENGINE_NAME
|
4
5
|
|
5
6
|
config.autoload_paths += Dir["#{config.root}/app/lib"]
|
6
7
|
|
@@ -42,6 +43,23 @@ module Staypuft
|
|
42
43
|
app.config.assets.precompile += %w(staypuft/staypuft.css staypuft/staypuft.js)
|
43
44
|
end
|
44
45
|
|
46
|
+
initializer "load default settings" do |app|
|
47
|
+
if (Setting.table_exists? rescue(false))
|
48
|
+
Setting::StaypuftProvisioning.load_defaults
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
initializer 'staypuft.configure_assets', :group => :assets do
|
53
|
+
SETTINGS[:staypuft] = {
|
54
|
+
:assets => {
|
55
|
+
:precompile => [
|
56
|
+
'staypuft/staypuft.js',
|
57
|
+
'staypuft/staypuft.css'
|
58
|
+
],
|
59
|
+
}
|
60
|
+
}
|
61
|
+
end
|
62
|
+
|
45
63
|
end
|
46
64
|
|
47
65
|
def table_name_prefix
|
data/lib/staypuft/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: staypuft
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-04-
|
12
|
+
date: 2014-04-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: foreman-tasks
|
@@ -103,7 +103,7 @@ files:
|
|
103
103
|
- app/lib/actions/staypuft/hostgroup/ordered_deploy.rb
|
104
104
|
- app/lib/actions/staypuft/middleware/as_current_user.rb
|
105
105
|
- app/lib/staypuft/exception.rb
|
106
|
-
- app/models/
|
106
|
+
- app/models/setting/staypuft_provisioning.rb
|
107
107
|
- app/models/staypuft/concerns/host_orchestration_build_hook.rb
|
108
108
|
- app/models/staypuft/concerns/hostgroup_extensions.rb
|
109
109
|
- app/models/staypuft/concerns/puppetclass_extensions.rb
|