staypuft 0.0.16 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/app/assets/javascripts/staypuft/staypuft.js +8 -4
- data/app/controllers/staypuft/deployments_controller.rb +33 -5
- data/app/controllers/staypuft/steps_controller.rb +1 -1
- data/app/lib/staypuft/deployment_param_exporter.rb +37 -0
- data/app/lib/staypuft/deployment_param_importer.rb +46 -0
- data/app/models/staypuft/concerns/hostgroup_extensions.rb +1 -1
- data/app/models/staypuft/deployment.rb +19 -2
- data/app/models/staypuft/service/ui_params.rb +10 -35
- data/app/models/staypuft/service.rb +6 -1
- data/app/views/staypuft/deployments/_import_form.html.erb +11 -0
- data/app/views/staypuft/deployments/show.html.erb +43 -7
- data/app/views/staypuft/steps/deployment_settings.html.erb +8 -0
- data/config/routes.rb +2 -0
- data/db/migrate/20140602121501_add_amqp_provider_to_staypuft_deployment.rb +13 -0
- data/db/seeds.rb +17 -15
- data/lib/staypuft/version.rb +1 -1
- metadata +63 -69
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 3838e8c00d0d5bb0470cfb8ec3ead91142f0dec7
|
4
|
+
data.tar.gz: ea81452c4bd0eb33f7d3e80483130b203b865683
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 68f8d5ba659d5126bb79d7545b50a05c3f4e63403b3454524c03b0bd2bde8bcfa8d0477c791ffbdc1eba53472a33536cb5d051eee8013e9f42320236cf5347c9
|
7
|
+
data.tar.gz: 3735abe4f8ab42404e9e1e05fea550bc1f9b20687702c38024d5af5c6c77f3c0db95b7cf9611e7b3ffae7a92b65ce0cd651177bc643f8c18dc3c5e2efa0d039a
|
@@ -12,15 +12,19 @@
|
|
12
12
|
//
|
13
13
|
//= require_tree .
|
14
14
|
|
15
|
-
$(function() {
|
15
|
+
$(function () {
|
16
16
|
// Check all checkboxes in table
|
17
|
-
$('#check_all').on('change', function(e) {
|
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
20
|
$('td input:checkbox', table).closest("tr").toggleClass("info", this.checked);
|
21
21
|
});
|
22
22
|
|
23
|
-
$("tr.checkbox_highlight input:checkbox").on('change', function(e) {
|
24
|
-
$(this).closest("tr")
|
23
|
+
$("tr.checkbox_highlight input:checkbox").on('change', function (e) {
|
24
|
+
var tr = $(this).closest("tr");
|
25
|
+
tr.toggleClass("info", this.checked);
|
26
|
+
if (tr.hasClass("deployed")) {
|
27
|
+
tr.toggleClass("danger", !this.checked);
|
28
|
+
}
|
25
29
|
});
|
26
30
|
});
|
@@ -9,7 +9,8 @@ module Staypuft
|
|
9
9
|
def new
|
10
10
|
base_hostgroup = Hostgroup.get_base_hostgroup
|
11
11
|
|
12
|
-
deployment = Deployment.new(:name => Deployment::NEW_NAME_PREFIX+SecureRandom.hex
|
12
|
+
deployment = Deployment.new(:name => Deployment::NEW_NAME_PREFIX+SecureRandom.hex,
|
13
|
+
:amqp_provider => Deployment::AMQP_RABBITMQ)
|
13
14
|
deployment.layout = Layout.where(:name => "Distributed",
|
14
15
|
:networking => "neutron").first
|
15
16
|
deployment_hostgroup = ::Hostgroup.new name: deployment.name, parent: base_hostgroup
|
@@ -53,8 +54,9 @@ module Staypuft
|
|
53
54
|
end
|
54
55
|
|
55
56
|
def associate_host
|
56
|
-
deployment
|
57
|
-
hostgroup
|
57
|
+
deployment = Deployment.find(params[:id])
|
58
|
+
hostgroup = ::Hostgroup.find params[:hostgroup_id]
|
59
|
+
deployment_in_progress = ForemanTasks::Lock.locked?(deployment, nil)
|
58
60
|
|
59
61
|
targeted_hosts = ::Host::Base.find Array(params[:host_ids])
|
60
62
|
assigned_hosts = hostgroup.hosts
|
@@ -76,14 +78,40 @@ module Staypuft
|
|
76
78
|
end
|
77
79
|
|
78
80
|
hosts_to_remove.each do |host|
|
79
|
-
host.
|
80
|
-
|
81
|
+
if host.open_stack_deployed? && deployment_in_progress
|
82
|
+
# do not remove
|
83
|
+
else
|
84
|
+
host.hostgroup = nil
|
85
|
+
host.environment = Environment.get_discovery
|
86
|
+
host.save!
|
87
|
+
host.setBuild
|
88
|
+
end
|
81
89
|
end
|
82
90
|
|
83
91
|
redirect_to show_with_hostgroup_selected_deployment_path(
|
84
92
|
id: deployment, hostgroup_id: hostgroup)
|
85
93
|
end
|
86
94
|
|
95
|
+
def export_config
|
96
|
+
@deployment = Deployment.find(params[:id])
|
97
|
+
send_data DeploymentParamExporter.new(@deployment).to_hash.to_yaml,
|
98
|
+
:type => "application/x-yaml", :disposition => 'attachment',
|
99
|
+
:filename => @deployment.name + '.yml'
|
100
|
+
end
|
101
|
+
|
102
|
+
def import_config
|
103
|
+
@deployment = Deployment.find(params[:id])
|
104
|
+
unless params[:deployment_config_file].nil?
|
105
|
+
new_config = YAML.load_file(params[:deployment_config_file].path)
|
106
|
+
DeploymentParamImporter.new(@deployment).import(new_config)
|
107
|
+
|
108
|
+
flash[:notice] = "Updated parameter values"
|
109
|
+
else
|
110
|
+
flash[:error] = "No import file specified"
|
111
|
+
end
|
112
|
+
redirect_to deployment_path(@deployment)
|
113
|
+
end
|
114
|
+
|
87
115
|
private
|
88
116
|
|
89
117
|
def assign_host_to_hostgroup(discovered_host, hostgroup)
|
@@ -25,7 +25,7 @@ module Staypuft
|
|
25
25
|
@deployment.form_step = Deployment::STEP_SETTINGS unless @deployment.form_complete?
|
26
26
|
@deployment.update_attributes(params[:staypuft_deployment])
|
27
27
|
@deployment.update_hostgroup_list
|
28
|
-
@deployment.
|
28
|
+
@deployment.set_custom_params
|
29
29
|
end
|
30
30
|
when :services_selection
|
31
31
|
@deployment.form_step = Deployment::STEP_SELECTION unless @deployment.form_complete?
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module Staypuft
|
2
|
+
class DeploymentParamExporter
|
3
|
+
def initialize(deployment)
|
4
|
+
@deployment = deployment
|
5
|
+
end
|
6
|
+
|
7
|
+
def to_hash
|
8
|
+
{"deployment" => {"name" => @deployment.name, "services" => services}}
|
9
|
+
end
|
10
|
+
|
11
|
+
def services
|
12
|
+
@deployment.services_hostgroup_map.map { |one_service, hostgroup| service(one_service, hostgroup) }
|
13
|
+
end
|
14
|
+
|
15
|
+
def service(one_service, hostgroup)
|
16
|
+
{ 'name' => one_service.name, 'params' => params(one_service, hostgroup) }
|
17
|
+
end
|
18
|
+
|
19
|
+
def params(one_service, hostgroup)
|
20
|
+
one_service.ui_params_for_form(hostgroup).map do |param_hash|
|
21
|
+
param param_hash
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def param(param_hash)
|
26
|
+
value = param_hash[:hostgroup].current_param_value_str(param_hash[:param_key])
|
27
|
+
# force encoding needed to prevent to_yaml from outputting some strings as binary
|
28
|
+
value.force_encoding("UTF-8") if value.is_a? String
|
29
|
+
|
30
|
+
{ 'key' => param_hash[:param_key].key,
|
31
|
+
'role' => param_hash[:role].name,
|
32
|
+
'puppetclass' => param_hash[:puppetclass].name,
|
33
|
+
'value' => value }
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
module Staypuft
|
2
|
+
class DeploymentParamImporter
|
3
|
+
def initialize(deployment)
|
4
|
+
@deployment = deployment
|
5
|
+
end
|
6
|
+
|
7
|
+
def import(in_hash)
|
8
|
+
hostgroups = {}
|
9
|
+
puppetclasses = {}
|
10
|
+
deployment_node = in_hash['deployment']
|
11
|
+
unless deployment_node.nil? || (services = deployment_node['services']).nil?
|
12
|
+
services.each do |service_hash|
|
13
|
+
handle_service(service_hash, hostgroups, puppetclasses)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def handle_service(service_hash, hostgroups, puppetclasses)
|
19
|
+
unless (service_params = service_hash['params']).nil?
|
20
|
+
service_params.each do |param_hash|
|
21
|
+
handle_param(param_hash, hostgroups, puppetclasses)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def handle_param(param_hash, hostgroups, puppetclasses)
|
27
|
+
hostgroup = hostgroups[param_hash['role']]
|
28
|
+
if hostgroup.nil?
|
29
|
+
drh = DeploymentRoleHostgroup.includes(:hostgroup, :role).
|
30
|
+
where(:deployment_id => @deployment.id,
|
31
|
+
"staypuft_roles.name" => param_hash['role']).first
|
32
|
+
hostgroup = drh.hostgroup unless drh.nil?
|
33
|
+
end
|
34
|
+
puppetclass = (puppetclasses[param_hash['puppetclass']] ||=
|
35
|
+
Puppetclass.where(:name => param_hash['puppetclass']).first)
|
36
|
+
key = param_hash['key']
|
37
|
+
value = param_hash['value']
|
38
|
+
# skip if either hostgroup or puppetclass are nil
|
39
|
+
unless hostgroup.nil? || puppetclass.nil? || key.nil? || value.nil?
|
40
|
+
hostgroup.set_param_value_if_changed(puppetclass,
|
41
|
+
key,
|
42
|
+
value)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -3,7 +3,7 @@ module Staypuft::Concerns::HostgroupExtensions
|
|
3
3
|
|
4
4
|
included do
|
5
5
|
has_one :deployment_role_hostgroup, :dependent => :destroy, :class_name => 'Staypuft::DeploymentRoleHostgroup'
|
6
|
-
has_one :parent_deployment, :through => :deployment_role_hostgroup, :class_name => 'Staypuft::Deployment'
|
6
|
+
has_one :parent_deployment, :through => :deployment_role_hostgroup, :class_name => 'Staypuft::Deployment', :source => :deployment
|
7
7
|
has_one :role, :through => :deployment_role_hostgroup, :class_name => 'Staypuft::Role'
|
8
8
|
|
9
9
|
has_one :deployment, :class_name => 'Staypuft::Deployment', through: :deployment_role_hostgroup
|
@@ -10,7 +10,14 @@ module Staypuft
|
|
10
10
|
|
11
11
|
NEW_NAME_PREFIX="uninitialized_"
|
12
12
|
|
13
|
-
|
13
|
+
# amqp providers
|
14
|
+
AMQP_RABBITMQ = "rabbitmq"
|
15
|
+
AMQP_QPID = "qpid"
|
16
|
+
AMQP_PROVIDERS = [AMQP_RABBITMQ, AMQP_QPID]
|
17
|
+
AMQP_PROVIDER_LABELS = {AMQP_RABBITMQ => "RabbitMQ",
|
18
|
+
AMQP_QPID => "Qpid" }
|
19
|
+
|
20
|
+
attr_accessible :description, :name, :layout_id, :layout, :amqp_provider
|
14
21
|
after_save :update_hostgroup_name
|
15
22
|
after_validation :check_form_complete
|
16
23
|
|
@@ -38,6 +45,8 @@ module Staypuft
|
|
38
45
|
validates :layout, :presence => true
|
39
46
|
validates :hostgroup, :presence => true
|
40
47
|
|
48
|
+
validates :amqp_provider, :presence => true, :inclusion => {:in => AMQP_PROVIDERS }
|
49
|
+
|
41
50
|
# TODO(mtaylor)
|
42
51
|
# Use conditional validations to validate the deployment multi-step form.
|
43
52
|
# deployment.form_step should be used to check the form step the user is
|
@@ -89,9 +98,11 @@ module Staypuft
|
|
89
98
|
# If layout networking is set to 'neutron', then set include_neutron and
|
90
99
|
# neutron on the hostgroup if it includes the "quickstack::pacemaker::params"
|
91
100
|
# puppetclass
|
92
|
-
def
|
101
|
+
def set_custom_params
|
93
102
|
child_hostgroups.each do |the_hostgroup|
|
94
103
|
the_hostgroup.puppetclasses.each do |pclass|
|
104
|
+
|
105
|
+
# set params relating to neutron/nova networking choice
|
95
106
|
if pclass.class_params.where(:key => "include_neutron").first
|
96
107
|
the_hostgroup.set_param_value_if_changed(pclass, "include_neutron",
|
97
108
|
layout.networking == 'neutron')
|
@@ -100,6 +111,12 @@ module Staypuft
|
|
100
111
|
the_hostgroup.set_param_value_if_changed(pclass, "neutron",
|
101
112
|
layout.networking == 'neutron')
|
102
113
|
end
|
114
|
+
|
115
|
+
# set params relating to rabbitmq/qpid amqp choice
|
116
|
+
if pclass.class_params.where(:key => "amqp_server").first
|
117
|
+
the_hostgroup.set_param_value_if_changed(pclass, "amqp_server",
|
118
|
+
amqp_provider)
|
119
|
+
end
|
103
120
|
end
|
104
121
|
end
|
105
122
|
end
|
@@ -4,13 +4,14 @@
|
|
4
4
|
# just grab the first puppetclass from the matching hostgroup
|
5
5
|
|
6
6
|
Staypuft::Service::UI_PARAMS = {
|
7
|
-
'
|
8
|
-
'
|
9
|
-
'
|
10
|
-
'
|
11
|
-
'
|
12
|
-
'
|
13
|
-
'
|
7
|
+
'AMQP (non-HA)' => ['amqp_server',
|
8
|
+
'amqp_host',
|
9
|
+
'amqp_username',
|
10
|
+
'amqp_password',
|
11
|
+
'amqp_ca',
|
12
|
+
'amqp_cert',
|
13
|
+
'amqp_key',
|
14
|
+
'amqp_nssdb_password'],
|
14
15
|
'MySQL' => ['mysql_ca',
|
15
16
|
'mysql_cert',
|
16
17
|
'mysql_host',
|
@@ -87,7 +88,7 @@ Staypuft::Service::UI_PARAMS = {
|
|
87
88
|
'Cinder (controller)' => ['cinder_backend_gluster',
|
88
89
|
'cinder_backend_iscsi',
|
89
90
|
'cinder_db_password',
|
90
|
-
'
|
91
|
+
'cinder_gluster_peers',
|
91
92
|
'cinder_gluster_volume',
|
92
93
|
'cinder_user_password'],
|
93
94
|
'Heat' => ['heat_cfn',
|
@@ -96,31 +97,5 @@ Staypuft::Service::UI_PARAMS = {
|
|
96
97
|
'heat_user_password',
|
97
98
|
'heat_auth_encrypt_key'],
|
98
99
|
'Ceilometer' => ['ceilometer_metering_secret',
|
99
|
-
'ceilometer_user_password'
|
100
|
-
],
|
101
|
-
'Neutron - L3' => ['controller_priv_host',
|
102
|
-
'enable_tunneling',
|
103
|
-
'external_network_bridge',
|
104
|
-
'fixed_network_range',
|
105
|
-
'mysql_ca',
|
106
|
-
'mysql_host',
|
107
|
-
'neutron_db_password',
|
108
|
-
'neutron_metadata_proxy_secret',
|
109
|
-
'neutron_user_password',
|
110
|
-
'nova_db_password',
|
111
|
-
'nova_user_password',
|
112
|
-
'qpid_host',
|
113
|
-
'qpid_username',
|
114
|
-
'qpid_password',
|
115
|
-
'ssl',
|
116
|
-
'tenant_network_type',
|
117
|
-
'tunnel_id_ranges',
|
118
|
-
'verbose'],
|
119
|
-
'OVS' => ['ovs_bridge_mappings',
|
120
|
-
'ovs_bridge_uplinks',
|
121
|
-
'ovs_tunnel_iface',
|
122
|
-
'ovs_tunnel_network',
|
123
|
-
'ovs_tunnel_types',
|
124
|
-
'ovs_vlan_ranges',
|
125
|
-
'ovs_vxlan_udp_port'] }
|
100
|
+
'ceilometer_user_password'] }
|
126
101
|
|
@@ -13,6 +13,7 @@ module Staypuft
|
|
13
13
|
|
14
14
|
def ui_params_for_form(hostgroup)
|
15
15
|
return [] if (hostgroup.nil?)
|
16
|
+
role = hostgroup.role
|
16
17
|
if hostgroup.puppetclasses.blank?
|
17
18
|
params_from_hash = []
|
18
19
|
else
|
@@ -27,13 +28,17 @@ module Staypuft
|
|
27
28
|
end
|
28
29
|
param_lookup_key = param_puppetclass.class_params.where(:key => param_key).first
|
29
30
|
param_lookup_key.nil? ? nil : { :hostgroup => hostgroup,
|
31
|
+
:role => role,
|
30
32
|
:puppetclass => param_puppetclass,
|
31
33
|
:param_key => param_lookup_key }
|
32
34
|
end.compact
|
33
35
|
end
|
34
36
|
params_from_service = self.puppetclasses.collect do |pclass|
|
35
37
|
pclass.class_params.collect do |class_param|
|
36
|
-
{ :hostgroup => hostgroup,
|
38
|
+
{ :hostgroup => hostgroup,
|
39
|
+
:role => role,
|
40
|
+
:puppetclass => pclass,
|
41
|
+
:param_key => class_param }
|
37
42
|
end
|
38
43
|
end.flatten
|
39
44
|
params_from_hash + params_from_service
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<%= form_tag(import_config_deployment_path(@deployment.id),
|
2
|
+
multipart: true,
|
3
|
+
class: 'col-md-12',
|
4
|
+
id: 'import_config_form') do |f| %>
|
5
|
+
<%= file_field_tag :deployment_config_file,
|
6
|
+
class: 'btn btn-default deployment_config_file' %>
|
7
|
+
<br/>
|
8
|
+
<%= submit_tag _("Import Config"), :class => "btn btn-primary btn-sm pull-right" %>
|
9
|
+
<br/>
|
10
|
+
<br/>
|
11
|
+
<% end %>
|
@@ -7,7 +7,29 @@
|
|
7
7
|
else
|
8
8
|
deployment_steps_path(deployment_id: @deployment)
|
9
9
|
end) %>
|
10
|
-
|
10
|
+
<div class="btn-group dropdown keep-open">
|
11
|
+
<button type="button" class="btn btn-default dropdown-toggle" role="button" href="#"
|
12
|
+
data-toggle="dropdown" data-target="#">
|
13
|
+
<%= _('Configuration') %>
|
14
|
+
<span class="caret"></span>
|
15
|
+
</button>
|
16
|
+
<ul class="dropdown-menu dropdown keep-open" role="menu">
|
17
|
+
<li><%= link_to(_("Summary"), summary_deployment_path(@deployment.id), :class => '') %></li>
|
18
|
+
<li>
|
19
|
+
<%= link_to(icon_text("cloud-upload", _("Import")),
|
20
|
+
{},
|
21
|
+
{ :remote => true,
|
22
|
+
:rel => 'popover',
|
23
|
+
:data => { 'content' => "#{render partial: 'import_form'}",
|
24
|
+
'original-title' => _('Import Config'),
|
25
|
+
'placement' => 'left', } }) %>
|
26
|
+
</li>
|
27
|
+
<li>
|
28
|
+
<%= link_to(icon_text("cloud-download", _("Export")),
|
29
|
+
export_config_deployment_path(@deployment.id)) %>
|
30
|
+
</li>
|
31
|
+
</ul>
|
32
|
+
</div>
|
11
33
|
|
12
34
|
<% if Rails.env.development? %>
|
13
35
|
<div class="btn-group">
|
@@ -41,6 +63,8 @@
|
|
41
63
|
:'data-toggle' => "modal",
|
42
64
|
:'data-target' => "#deploy_modal") %>
|
43
65
|
<% end %>
|
66
|
+
|
67
|
+
|
44
68
|
<%= help_path %>
|
45
69
|
<% end %>
|
46
70
|
|
@@ -86,20 +110,25 @@
|
|
86
110
|
<%= check_box_tag :check_all %>
|
87
111
|
</th>
|
88
112
|
<th><%= sort :name, :as => _('Name') %></th>
|
113
|
+
<th class="hidden-s hidden-xs"><%= _('Deployed?') %></th>
|
89
114
|
<th class="hidden-s hidden-xs"><%= sort :mac, :as => _('MAC Address') %></th>
|
90
115
|
<th class="hidden-s hidden-xs"><%= sort :type, :as => _('Type') %></th>
|
91
116
|
</tr>
|
92
117
|
</thead>
|
93
118
|
<tbody>
|
94
119
|
<% child_hostgroup.own_and_free_hosts.each do |host| %>
|
95
|
-
<tr class="
|
120
|
+
<tr class="<%= ['checkbox_highlight',
|
121
|
+
('success' if child_hostgroup.host_ids.include?(host.id)),
|
122
|
+
('deployed' if host.open_stack_deployed?)
|
123
|
+
].compact.join(' ') %>">
|
96
124
|
<td class="ca">
|
125
|
+
<% disabled = ForemanTasks::Lock.locked?(@deployment, nil) && host.open_stack_deployed? %>
|
97
126
|
<%= check_box_tag 'host_ids[]',
|
98
127
|
host.id,
|
99
128
|
child_hostgroup.host_ids.include?(host.id),
|
100
|
-
:
|
101
|
-
:disabled
|
102
|
-
<%= hidden_field_tag 'host_ids[]', host.id if
|
129
|
+
id: "host_ids_#{host.id}",
|
130
|
+
disabled: disabled %>
|
131
|
+
<%= hidden_field_tag 'host_ids[]', host.id if disabled %>
|
103
132
|
</td>
|
104
133
|
<td class="ellipsis">
|
105
134
|
<% case host %>
|
@@ -111,6 +140,13 @@
|
|
111
140
|
<%= host.name %>
|
112
141
|
<% end %>
|
113
142
|
</td>
|
143
|
+
<td class="hidden-s hidden-xs">
|
144
|
+
<% if host.open_stack_deployed? %>
|
145
|
+
<span class="glyphicon glyphicon-cloud"></span>
|
146
|
+
<% else %>
|
147
|
+
<span class="glyphicon glyphicon-minus"></span>
|
148
|
+
<% end %>
|
149
|
+
</td>
|
114
150
|
<td class="hidden-s hidden-xs"><%= host.mac %></td>
|
115
151
|
<td class="hidden-s hidden-xs"><%= host.type %></td>
|
116
152
|
</tr>
|
@@ -148,9 +184,9 @@
|
|
148
184
|
<button type="button" class="btn btn-default" data-dismiss="modal"><%= _("Cancel") %></button>
|
149
185
|
<%= display_link_if_authorized(_("Deploy"),
|
150
186
|
hash_for_deploy_deployment_path,
|
151
|
-
:class
|
187
|
+
:class => 'btn btn-primary',
|
152
188
|
:method => :post,
|
153
|
-
:data
|
189
|
+
:data => { :disable_with => _("Deploying...") }) %>
|
154
190
|
</div>
|
155
191
|
</div>
|
156
192
|
</div>
|
@@ -21,6 +21,14 @@
|
|
21
21
|
<% end %>
|
22
22
|
</div>
|
23
23
|
</div>
|
24
|
+
<div class="form-group">
|
25
|
+
<label class="col-md-2 control-label" for="layout_id"><%= _("AMQP Provider") %></label>
|
26
|
+
<div class="col-md-6">
|
27
|
+
<% Staypuft::Deployment::AMQP_PROVIDER_LABELS.each do |provider_value, provider_label| %>
|
28
|
+
<%= radio_button_f_non_inline(f, :amqp_provider, :checked => provider_value == @deployment.amqp_provider,:value=>provider_value, :text=> provider_label) %>
|
29
|
+
<% end %>
|
30
|
+
</div>
|
31
|
+
</div>
|
24
32
|
</div>
|
25
33
|
</div>
|
26
34
|
|
data/config/routes.rb
CHANGED
@@ -0,0 +1,13 @@
|
|
1
|
+
class AddAmqpProviderToStaypuftDeployment < ActiveRecord::Migration
|
2
|
+
Deployment = Class.new(ActiveRecord::Base) do
|
3
|
+
self.table_name = 'staypuft_deployments'
|
4
|
+
end
|
5
|
+
|
6
|
+
def change
|
7
|
+
add_column :staypuft_deployments, :amqp_provider, :string
|
8
|
+
|
9
|
+
Deployment.update_all :amqp_provider => 'rabbitmq'
|
10
|
+
|
11
|
+
change_column :staypuft_deployments, :amqp_provider, :string, :null => false
|
12
|
+
end
|
13
|
+
end
|
data/db/seeds.rb
CHANGED
@@ -67,9 +67,10 @@ params = {
|
|
67
67
|
'mysql_shared_storage_type' => 'nfs',
|
68
68
|
'mysql_resource_group_name' => 'mysqlgrp',
|
69
69
|
'mysql_clu_member_addrs' => '192.168.203.11 192.168.203.12 192.168.203.13',
|
70
|
-
|
71
|
-
'
|
72
|
-
'
|
70
|
+
"amqp_server" => 'rabbitmq',
|
71
|
+
'amqp_host' => '172.16.0.1',
|
72
|
+
'amqp_username' => 'openstack',
|
73
|
+
'amqp_password' => SecureRandom.hex,
|
73
74
|
'admin_email' => "admin@#{Facter.value(:domain)}",
|
74
75
|
'neutron_metadata_proxy_secret' => SecureRandom.hex,
|
75
76
|
'enable_ovs_agent' => 'true',
|
@@ -100,15 +101,17 @@ params = {
|
|
100
101
|
'mysql_ca' => '/etc/ipa/ca.crt',
|
101
102
|
'mysql_cert' => '/etc/pki/tls/certs/PRIV_HOST-mysql.crt',
|
102
103
|
'mysql_key' => '/etc/pki/tls/private/PRIV_HOST-mysql.key',
|
103
|
-
'
|
104
|
-
'
|
105
|
-
'
|
104
|
+
'amqp_ca' => '/etc/ipa/ca.crt',
|
105
|
+
'amqp_cert' => '/etc/pki/tls/certs/PRIV_HOST-amqp.crt',
|
106
|
+
'amqp_key' => '/etc/pki/tls/private/PRIV_HOST-amqp.key',
|
106
107
|
'horizon_ca' => '/etc/ipa/ca.crt',
|
107
108
|
'horizon_cert' => '/etc/pki/tls/certs/PUB_HOST-horizon.crt',
|
108
109
|
'horizon_key' => '/etc/pki/tls/private/PUB_HOST-horizon.key',
|
109
|
-
'
|
110
|
+
'amqp_nssdb_password' => SecureRandom.hex,
|
110
111
|
'fence_xvm_key_file_password' => SecureRandom.hex,
|
111
112
|
'use_qemu_for_poc' => 'false',
|
113
|
+
'secret_key' => SecureRandom.hex,
|
114
|
+
'admin_token' => SecureRandom.hex,
|
112
115
|
}
|
113
116
|
|
114
117
|
get_key_type = lambda do |value|
|
@@ -137,7 +140,7 @@ layouts = {
|
|
137
140
|
|
138
141
|
# services don't have puppetclasses yet, since they aren't broken out on the back end
|
139
142
|
services = {
|
140
|
-
:
|
143
|
+
:non_ha_amqp => { :name => 'AMQP (non-HA)', :class => [] },
|
141
144
|
:mysql => { :name => 'MySQL', :class => [] },
|
142
145
|
:non_ha_keystone => { :name => 'Keystone (non-HA)', :class => [] },
|
143
146
|
:nova_controller => { :name => 'Nova (Controller)', :class => [] },
|
@@ -147,8 +150,7 @@ services = {
|
|
147
150
|
:cinder_node => { :name => 'Cinder (node)', :class => ['quickstack::storage_backend::lvm_cinder'] },
|
148
151
|
:heat => { :name => 'Heat', :class => [] },
|
149
152
|
:ceilometer => { :name => 'Ceilometer', :class => [] },
|
150
|
-
:
|
151
|
-
:ovs => { :name => 'OVS', :class => [] },
|
153
|
+
:neutron_networker => { :name => 'Neutron Networker', :class => ['quickstack::neutron::networker'] },
|
152
154
|
:nova_compute => { :name => 'Nova-compute', :class => ['quickstack::nova_network::compute'] },
|
153
155
|
:neutron_compute => { :name => 'Neutron-compute', :class => ['quickstack::neutron::compute'] },
|
154
156
|
:swift => { :name => 'Swift (node)', :class => ['quickstack::swift::storage'] },
|
@@ -207,7 +209,7 @@ roles = [
|
|
207
209
|
{ :name => 'Controller (Nova)',
|
208
210
|
:class => 'quickstack::nova_network::controller',
|
209
211
|
:layouts => [[:non_ha_nova, 1]],
|
210
|
-
:services => [:
|
212
|
+
:services => [:non_ha_amqp, :mysql, :non_ha_keystone, :nova_controller, :non_ha_glance,
|
211
213
|
:cinder_controller, :heat, :ceilometer] },
|
212
214
|
{ :name => 'Compute (Nova)',
|
213
215
|
:class => [],
|
@@ -216,17 +218,17 @@ roles = [
|
|
216
218
|
{ :name => 'Controller (Neutron)',
|
217
219
|
:class => 'quickstack::neutron::controller',
|
218
220
|
:layouts => [[:non_ha_neutron, 1]],
|
219
|
-
:services => [:
|
221
|
+
:services => [:non_ha_amqp, :mysql, :non_ha_keystone, :neutron_controller, :non_ha_glance,
|
220
222
|
:cinder_controller, :heat, :ceilometer] },
|
221
223
|
{ :name => 'Compute (Neutron)',
|
222
224
|
:class => [],
|
223
225
|
:layouts => [[:ha_neutron, 10], [:non_ha_neutron, 10]],
|
224
226
|
:services => [:neutron_compute] },
|
225
227
|
{ :name => 'Neutron Networker',
|
226
|
-
:class =>
|
228
|
+
:class => [],
|
227
229
|
:layouts => [[:non_ha_neutron, 3]],
|
228
|
-
:services => [:
|
229
|
-
{ :name => '
|
230
|
+
:services => [:neutron_networker] },
|
231
|
+
{ :name => 'Cinder Block Storage',
|
230
232
|
:class => [],
|
231
233
|
:layouts => [[:ha_nova, 2], [:ha_neutron, 2], [:non_ha_nova, 2], [:non_ha_neutron, 2]],
|
232
234
|
:services => [:cinder_node] },
|
data/lib/staypuft/version.rb
CHANGED
metadata
CHANGED
@@ -1,20 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: staypuft
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
5
|
-
prerelease:
|
4
|
+
version: 0.1.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Staypuft team
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2014-
|
11
|
+
date: 2014-06-04 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: foreman-tasks
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - ~>
|
20
18
|
- !ruby/object:Gem::Version
|
@@ -22,7 +20,6 @@ dependencies:
|
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
24
|
- - ~>
|
28
25
|
- !ruby/object:Gem::Version
|
@@ -30,7 +27,6 @@ dependencies:
|
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: dynflow
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
31
|
- - ~>
|
36
32
|
- !ruby/object:Gem::Version
|
@@ -38,7 +34,6 @@ dependencies:
|
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
38
|
- - ~>
|
44
39
|
- !ruby/object:Gem::Version
|
@@ -46,23 +41,20 @@ dependencies:
|
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: wicked
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- -
|
45
|
+
- - '>='
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: '0'
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- -
|
52
|
+
- - '>='
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: '0'
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: foreman_discovery
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
59
|
- - ~>
|
68
60
|
- !ruby/object:Gem::Version
|
@@ -70,7 +62,6 @@ dependencies:
|
|
70
62
|
type: :runtime
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
66
|
- - ~>
|
76
67
|
- !ruby/object:Gem::Version
|
@@ -82,69 +73,73 @@ executables: []
|
|
82
73
|
extensions: []
|
83
74
|
extra_rdoc_files: []
|
84
75
|
files:
|
85
|
-
- app/
|
86
|
-
- app/assets/stylesheets/staypuft/bootstrap_and_overrides.css.scss
|
87
|
-
- app/assets/stylesheets/staypuft/staypuft.css.scss
|
88
|
-
- app/controllers/staypuft/application_controller.rb
|
89
|
-
- app/controllers/staypuft/deployments_controller.rb
|
90
|
-
- app/controllers/staypuft/steps_controller.rb
|
76
|
+
- app/overrides/hide_subscription_manager_passwords.rb
|
91
77
|
- app/helpers/staypuft/application_helper.rb
|
92
78
|
- app/helpers/staypuft/deployments_helper.rb
|
93
|
-
- app/
|
94
|
-
- app/
|
95
|
-
- app/
|
96
|
-
- app/
|
97
|
-
- app/
|
98
|
-
- app/lib/actions/staypuft/host/puppet_run.rb
|
99
|
-
- app/lib/actions/staypuft/host/wait_until_host_ready.rb
|
100
|
-
- app/lib/actions/staypuft/host/wait_until_installed.rb
|
101
|
-
- app/lib/actions/staypuft/hostgroup/deploy.rb
|
102
|
-
- app/lib/actions/staypuft/hostgroup/ordered_deploy.rb
|
103
|
-
- app/lib/actions/staypuft/middleware/as_current_user.rb
|
104
|
-
- app/lib/staypuft/exception.rb
|
105
|
-
- app/models/setting/staypuft_provisioning.rb
|
106
|
-
- app/models/staypuft/concerns/environment_extensions.rb
|
107
|
-
- app/models/staypuft/concerns/host_open_stack_affiliation.rb
|
108
|
-
- app/models/staypuft/concerns/host_orchestration_build_hook.rb
|
109
|
-
- app/models/staypuft/concerns/hostgroup_extensions.rb
|
110
|
-
- app/models/staypuft/concerns/puppetclass_extensions.rb
|
79
|
+
- app/assets/javascripts/staypuft/staypuft.js
|
80
|
+
- app/assets/stylesheets/staypuft/staypuft.css.scss
|
81
|
+
- app/assets/stylesheets/staypuft/bootstrap_and_overrides.css.scss
|
82
|
+
- app/models/staypuft/service.rb
|
83
|
+
- app/models/staypuft/role_class.rb
|
111
84
|
- app/models/staypuft/deployment.rb
|
85
|
+
- app/models/staypuft/role_service.rb
|
112
86
|
- app/models/staypuft/deployment_role_hostgroup.rb
|
113
87
|
- app/models/staypuft/layout.rb
|
88
|
+
- app/models/staypuft/service_class.rb
|
89
|
+
- app/models/staypuft/concerns/host_orchestration_build_hook.rb
|
90
|
+
- app/models/staypuft/concerns/hostgroup_extensions.rb
|
91
|
+
- app/models/staypuft/concerns/host_open_stack_affiliation.rb
|
92
|
+
- app/models/staypuft/concerns/puppetclass_extensions.rb
|
93
|
+
- app/models/staypuft/concerns/environment_extensions.rb
|
114
94
|
- app/models/staypuft/layout_role.rb
|
115
|
-
- app/models/staypuft/role.rb
|
116
|
-
- app/models/staypuft/role_class.rb
|
117
|
-
- app/models/staypuft/role_service.rb
|
118
95
|
- app/models/staypuft/service/ui_params.rb
|
119
|
-
- app/models/staypuft/
|
120
|
-
- app/models/
|
121
|
-
- app/
|
96
|
+
- app/models/staypuft/role.rb
|
97
|
+
- app/models/setting/staypuft_provisioning.rb
|
98
|
+
- app/lib/staypuft/deployment_param_importer.rb
|
99
|
+
- app/lib/staypuft/exception.rb
|
100
|
+
- app/lib/staypuft/deployment_param_exporter.rb
|
101
|
+
- app/lib/actions/staypuft/middleware/as_current_user.rb
|
102
|
+
- app/lib/actions/staypuft/hostgroup/deploy.rb
|
103
|
+
- app/lib/actions/staypuft/hostgroup/ordered_deploy.rb
|
104
|
+
- app/lib/actions/staypuft/host/deploy.rb
|
105
|
+
- app/lib/actions/staypuft/host/build.rb
|
106
|
+
- app/lib/actions/staypuft/host/wait_until_host_ready.rb
|
107
|
+
- app/lib/actions/staypuft/host/puppet_run.rb
|
108
|
+
- app/lib/actions/staypuft/host/create.rb
|
109
|
+
- app/lib/actions/staypuft/host/wait_until_installed.rb
|
110
|
+
- app/lib/actions/staypuft/deployment/deploy.rb
|
111
|
+
- app/lib/actions/staypuft/deployment/populate.rb
|
112
|
+
- app/controllers/staypuft/steps_controller.rb
|
113
|
+
- app/controllers/staypuft/deployments_controller.rb
|
114
|
+
- app/controllers/staypuft/application_controller.rb
|
122
115
|
- app/views/staypuft/deployments/index.html.erb
|
123
116
|
- app/views/staypuft/deployments/show.html.erb
|
117
|
+
- app/views/staypuft/deployments/_import_form.html.erb
|
124
118
|
- app/views/staypuft/deployments/summary.html.erb
|
125
119
|
- app/views/staypuft/layouts/staypuft.html.erb
|
126
|
-
- app/views/staypuft/steps/_title.html.erb
|
127
120
|
- app/views/staypuft/steps/deployment_settings.html.erb
|
128
|
-
- app/views/staypuft/steps/services_configuration.html.erb
|
129
121
|
- app/views/staypuft/steps/services_selection.html.erb
|
130
|
-
-
|
122
|
+
- app/views/staypuft/steps/_title.html.erb
|
123
|
+
- app/views/staypuft/steps/services_configuration.html.erb
|
131
124
|
- config/staypuft.local.rb
|
125
|
+
- config/routes.rb
|
126
|
+
- db/migrate/20140312050615_create_staypuft_role_classes.rb
|
132
127
|
- db/migrate/20140309021811_create_staypuft_layouts.rb
|
133
|
-
- db/migrate/
|
128
|
+
- db/migrate/20140310203855_create_staypuft_role_services.rb
|
134
129
|
- db/migrate/20140310023613_create_staypuft_roles.rb
|
135
|
-
- db/migrate/
|
130
|
+
- db/migrate/20140325211410_add_role_to_staypuft_deployment_role_hostgroup.rb
|
131
|
+
- db/migrate/20140326032027_drop_staypuft_hostgroup_roles.rb
|
132
|
+
- db/migrate/20140602121501_add_amqp_provider_to_staypuft_deployment.rb
|
136
133
|
- db/migrate/20140310194221_create_staypuft_services.rb
|
137
|
-
- db/migrate/20140310203855_create_staypuft_role_services.rb
|
138
|
-
- db/migrate/20140312044533_create_staypuft_deployment_role_hostgroups.rb
|
139
134
|
- db/migrate/20140312050001_create_staypuft_hostgroup_roles.rb
|
140
|
-
- db/migrate/
|
141
|
-
- db/migrate/20140312051144_create_staypuft_service_classes.rb
|
142
|
-
- db/migrate/20140315031754_add_networking_to_staypuft_layout.rb
|
135
|
+
- db/migrate/20140310174152_create_staypuft_layout_roles.rb
|
143
136
|
- db/migrate/20140318163222_add_deploy_order_to_staypuft_layout_role.rb
|
144
|
-
- db/migrate/20140325211410_add_role_to_staypuft_deployment_role_hostgroup.rb
|
145
|
-
- db/migrate/20140326032027_drop_staypuft_hostgroup_roles.rb
|
146
137
|
- db/migrate/20140507103716_add_form_step_to_staypuft_deployment.rb
|
147
138
|
- db/migrate/20140513124807_change_column_default_form_step_on_staypuft_deployment.rb
|
139
|
+
- db/migrate/20140315031754_add_networking_to_staypuft_layout.rb
|
140
|
+
- db/migrate/20140312051144_create_staypuft_service_classes.rb
|
141
|
+
- db/migrate/20140312044533_create_staypuft_deployment_role_hostgroups.rb
|
142
|
+
- db/migrate/20140310004533_create_staypuft_deployments.rb
|
148
143
|
- db/seeds.rb
|
149
144
|
- lib/staypuft/engine.rb
|
150
145
|
- lib/staypuft/version.rb
|
@@ -153,40 +148,39 @@ files:
|
|
153
148
|
- LICENSE
|
154
149
|
- Rakefile
|
155
150
|
- README.md
|
156
|
-
- test/factories/staypuft_factories.rb
|
157
|
-
- test/integration/navigation_test.rb
|
158
|
-
- test/staypuft_test.rb
|
159
151
|
- test/test_helper.rb
|
160
|
-
- test/
|
152
|
+
- test/staypuft_test.rb
|
161
153
|
- test/unit/staypuft_test.rb
|
154
|
+
- test/integration/navigation_test.rb
|
155
|
+
- test/factories/staypuft_factories.rb
|
156
|
+
- test/test_plugin_helper.rb
|
162
157
|
homepage: https://github.com/theforeman/staypuft
|
163
158
|
licenses: []
|
159
|
+
metadata: {}
|
164
160
|
post_install_message:
|
165
161
|
rdoc_options: []
|
166
162
|
require_paths:
|
167
163
|
- lib
|
168
164
|
required_ruby_version: !ruby/object:Gem::Requirement
|
169
|
-
none: false
|
170
165
|
requirements:
|
171
|
-
- -
|
166
|
+
- - '>='
|
172
167
|
- !ruby/object:Gem::Version
|
173
168
|
version: '0'
|
174
169
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
175
|
-
none: false
|
176
170
|
requirements:
|
177
|
-
- -
|
171
|
+
- - '>='
|
178
172
|
- !ruby/object:Gem::Version
|
179
173
|
version: '0'
|
180
174
|
requirements: []
|
181
175
|
rubyforge_project:
|
182
|
-
rubygems_version:
|
176
|
+
rubygems_version: 2.0.3
|
183
177
|
signing_key:
|
184
|
-
specification_version:
|
178
|
+
specification_version: 4
|
185
179
|
summary: OpenStack Foreman Installer
|
186
180
|
test_files:
|
187
|
-
- test/factories/staypuft_factories.rb
|
188
|
-
- test/integration/navigation_test.rb
|
189
|
-
- test/staypuft_test.rb
|
190
181
|
- test/test_helper.rb
|
191
|
-
- test/
|
182
|
+
- test/staypuft_test.rb
|
192
183
|
- test/unit/staypuft_test.rb
|
184
|
+
- test/integration/navigation_test.rb
|
185
|
+
- test/factories/staypuft_factories.rb
|
186
|
+
- test/test_plugin_helper.rb
|