summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNadya Shakhat <nprivalova@mirantis.com>2016-04-29 17:38:22 +0300
committerNadya Shakhat <nprivalova@mirantis.com>2016-07-13 14:59:09 +0300
commit6e4d9213d24d14b06ac6dc65084e46b3b7ed837e (patch)
tree5cbc16454bbe411393e65cf45f759831c8352461
parent5e6601c98fe79587fa891e76e839a499fbdea112 (diff)
Update plugin for MOS 9.0
Notes
Notes (review): Code-Review+1: Mykyta Karpin <mkarpin@mirantis.com> Code-Review+2: Nadya Shakhat <nprivalova@mirantis.com> Workflow+1: Nadya Shakhat <nprivalova@mirantis.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Thu, 14 Jul 2016 12:02:29 +0000 Reviewed-on: https://review.openstack.org/314611 Project: openstack/fuel-plugin-ceilometer-redis Branch: refs/heads/master
-rw-r--r--deployment_scripts/puppet/manifests/create_redis_ocf.pp24
-rw-r--r--deployment_scripts/puppet/modules/redis/manifests/main.pp105
-rw-r--r--deployment_tasks.yaml40
-rw-r--r--metadata.yaml9
4 files changed, 139 insertions, 39 deletions
diff --git a/deployment_scripts/puppet/manifests/create_redis_ocf.pp b/deployment_scripts/puppet/manifests/create_redis_ocf.pp
new file mode 100644
index 0000000..1c71971
--- /dev/null
+++ b/deployment_scripts/puppet/manifests/create_redis_ocf.pp
@@ -0,0 +1,24 @@
1include redis::params
2
3$ensure = 'present'
4$service_name = $redis::params::service
5$ocf_root_path = '/usr/lib/ocf'
6$handler_root_path = '/usr/local/bin'
7$primitive_provider = 'fuel'
8$primitive_type = $redis::params::service
9$ocf_script_name = "${service_name}-ocf-file"
10$ocf_script_file = 'redis/ocf/redis-server'
11$ocf_handler_name = "ocf_handler_${service_name}"
12$ocf_dir_path = "${ocf_root_path}/resource.d"
13$ocf_script_path = "${ocf_dir_path}/${primitive_provider}/${$primitive_type}"
14$ocf_handler_path = "${handler_root_path}/${ocf_handler_name}"
15
16
17file { $ocf_script_name :
18 ensure => $ensure,
19 path => $ocf_script_path,
20 mode => '0755',
21 owner => 'root',
22 group => 'root',
23 source => "puppet:///modules/${ocf_script_file}",
24}
diff --git a/deployment_scripts/puppet/modules/redis/manifests/main.pp b/deployment_scripts/puppet/modules/redis/manifests/main.pp
index c820760..86976f8 100644
--- a/deployment_scripts/puppet/modules/redis/manifests/main.pp
+++ b/deployment_scripts/puppet/modules/redis/manifests/main.pp
@@ -58,6 +58,7 @@ class redis::main (
58) { 58) {
59 59
60 include ceilometer::params 60 include ceilometer::params
61 include aodh::params
61 include redis::params 62 include redis::params
62 63
63 case $::osfamily { 64 case $::osfamily {
@@ -142,18 +143,24 @@ class redis::main (
142 'coordination/check_watchers' : value => $timeout; 143 'coordination/check_watchers' : value => $timeout;
143 } 144 }
144 145
146 aodh_config {
147 'coordination/backend_url' : value => redis_backend_url($redis_hosts, $redis_sentinel_port, $timeout, $master_name);
148 'coordination/heartbeat' : value => '1.0';
149 'coordination/check_watchers' : value => $timeout;
150 }
151
145 service { 'ceilometer-agent-central': 152 service { 'ceilometer-agent-central':
146 ensure => 'running', 153 ensure => 'running',
147 name => $::ceilometer::params::agent_central_service_name, 154 name => $::ceilometer::params::agent_central_service_name,
148 enable => true, 155 enable => true,
149 hasstatus => true, 156 hasstatus => true,
150 hasrestart => true, 157 hasrestart => true,
151 } 158 }
152 159
153 service { 'ceilometer-alarm-evaluator': 160 service { 'aodh-evaluator':
154 ensure => 'running', 161 ensure => 'running',
155 name => $::ceilometer::params::alarm_evaluator_service_name, 162 name => $::aodh::params::evaluator_service_name,
156 enable => true, 163 enable => true,
157 hasstatus => true, 164 hasstatus => true,
158 hasrestart => true, 165 hasrestart => true,
159 } 166 }
@@ -166,38 +173,74 @@ class redis::main (
166 hasrestart => true, 173 hasrestart => true,
167 } 174 }
168 175
169 pacemaker_wrappers::service { $::ceilometer::params::agent_central_service_name : 176 pacemaker::service { $::ceilometer::params::agent_central_service_name :
170 complex_type => 'clone', 177 complex_type => 'clone',
171 ms_metadata => { 'interleave' => true }, 178 complex_metadata => { 'interleave' => true },
172 primitive_type => 'ceilometer-agent-central', 179 primitive_type => 'ceilometer-agent-central',
173 metadata => $metadata, 180 metadata => $metadata,
174 parameters => { 'user' => 'ceilometer' }, 181 parameters => { 'user' => 'ceilometer' },
175 operations => $operations, 182 operations => $operations,
176 } 183 }
177 184
178 pacemaker_wrappers::service { $::ceilometer::params::alarm_evaluator_service_name : 185 pacemaker::service { $::aodh::params::evaluator_service_name :
179 complex_type => 'clone', 186 complex_type => 'clone',
180 ms_metadata => { 'interleave' => true }, 187 complex_metadata => { 'interleave' => true },
181 primitive_type => 'ceilometer-alarm-evaluator', 188 primitive_type => 'aodh-evaluator',
182 metadata => $metadata, 189 metadata => $metadata,
183 parameters => { 'user' => 'ceilometer' }, 190 parameters => { 'user' => 'aodh' },
184 operations => $operations, 191 operations => $operations,
185 } 192 }
186 193
187 pacemaker_wrappers::service { 'redis-server' : 194 pacemaker::service { 'redis-server' :
188 ocf_script_file => 'redis/ocf/redis-server', 195 ocf_script_file => 'redis/ocf/redis-server',
189 complex_type => 'clone', 196 complex_type => 'clone',
190 ms_metadata => { 'interleave' => true }, 197 complex_metadata => { 'interleave' => true },
191 primitive_type => 'redis-server', 198 primitive_type => 'redis-server',
192 operations => $operations, 199 operations => $operations,
193 } 200 }
194 201
195 Pacemaker_wrappers::Service['redis-server'] -> 202 # During deploy of plugin we need to update resource type from simple to
196 Pacemaker_wrappers::Service["$::ceilometer::params::agent_central_service_name"] -> 203 # clone, but this is not working with current implementation of pcmk_resource
197 Pacemaker_wrappers::Service["$::ceilometer::params::alarm_evaluator_service_name"] 204 # type (https://bugs.launchpad.net/fuel/+bug/1580660), that's why we need a
205 # workaround below, this dirty workaround should be removed once
206 # https://bugs.launchpad.net/fuel/+bug/1580660 is fixed.
207 $old_ceilometer_primitive_exists=inline_template("<%= `if pcs resource show | grep -q '^ p_ceilometer-agent-central'; then /bin/echo true; fi;`%>")
208 $old_aodh_primitive_exists=inline_template("<%= `if pcs resource show | grep -q '^ p_aodh-evaluator'; then /bin/echo true; fi;`%>")
209
210 if $old_ceilometer_primitive_exists {
211
212 notify { "Ceilometer agent central simple primitive exists and will be removed": }
213
214 exec { 'remove_old_resource_central_agent':
215 path => '/usr/sbin:/usr/bin:/sbin:/bin',
216 command => 'pcs resource delete p_ceilometer-agent-central --wait=120',
217 }
218 Exec['remove_old_resource_central_agent'] ->
219 Pacemaker::Service['redis-server'] ->
220 Pacemaker::Service["$::ceilometer::params::agent_central_service_name"]
221 } else {
222 Pacemaker::Service['redis-server'] ->
223 Pacemaker::Service["$::ceilometer::params::agent_central_service_name"]
224 }
225
226 if $old_aodh_primitive_exists {
227
228 notify { "Aodh evaluator simple primitive exists and will be removed": }
229
230 exec { 'remove_old_resource_aodh_evaluator':
231 path => '/usr/sbin:/usr/bin:/sbin:/bin',
232 command => 'pcs resource delete p_aodh-evaluator --wait=120',
233 }
234 Exec['remove_old_resource_aodh_evaluator'] ->
235 Pacemaker::Service['redis-server'] ->
236 Pacemaker::Service["$::aodh::params::evaluator_service_name"]
237 } else {
238 Pacemaker::Service['redis-server'] ->
239 Pacemaker::Service["$::aodh::params::evaluator_service_name"]
240 }
198 241
199 Ceilometer_config <||> ~> Service["$::ceilometer::params::agent_central_service_name"] 242 Ceilometer_config <||> ~> Service["$::ceilometer::params::agent_central_service_name"]
200 Ceilometer_config <||> ~> Service["$::ceilometer::params::alarm_evaluator_service_name"] 243 Aodh_config <||> ~> Service["$::aodh::params::evaluator_service_name"]
201 Ceilometer_config <||> ~> Service['ceilometer-agent-notification'] 244 Ceilometer_config <||> ~> Service['ceilometer-agent-notification']
202 245
203} 246}
diff --git a/deployment_tasks.yaml b/deployment_tasks.yaml
index df65581..5d5c407 100644
--- a/deployment_tasks.yaml
+++ b/deployment_tasks.yaml
@@ -1,8 +1,46 @@
1## we must upload ocf scripts on all controllers before
2## create clone resources.
3- id: primary_create_redis_ocf
4 type: puppet
5 groups: [primary-controller]
6 required_for: [deploy_end]
7 requires: [ceilometer-controller]
8 parameters:
9 puppet_manifest: "puppet/manifests/create_redis_ocf.pp"
10 puppet_modules: "puppet/modules:/etc/puppet/modules"
11 timeout: 180
12
13- id: create_redis_ocf
14 type: puppet
15 groups: [controller]
16 required_for: [deploy_end]
17 requires: [ceilometer-controller]
18 cross-depends:
19 - name: primary_create_redis_ocf
20 parameters:
21 puppet_manifest: "puppet/manifests/create_redis_ocf.pp"
22 puppet_modules: "puppet/modules:/etc/puppet/modules"
23 timeout: 180
24
25- id: primary_ceilometer_redis
26 type: puppet
27 groups: [primary-controller]
28 required_for: [deploy_end]
29 requires: [ceilometer-controller]
30 cross-depends:
31 - name: create_redis_ocf
32 parameters:
33 puppet_manifest: "puppet/manifests/controller.pp"
34 puppet_modules: "puppet/modules:/etc/puppet/modules"
35 timeout: 3600
36
1- id: ceilometer_redis 37- id: ceilometer_redis
2 type: puppet 38 type: puppet
3 groups: [primary-controller, controller] 39 groups: [controller]
4 required_for: [deploy_end] 40 required_for: [deploy_end]
5 requires: [ceilometer-controller] 41 requires: [ceilometer-controller]
42 cross-depends:
43 - name: primary_ceilometer_redis
6 parameters: 44 parameters:
7 puppet_manifest: "puppet/manifests/controller.pp" 45 puppet_manifest: "puppet/manifests/controller.pp"
8 puppet_modules: "puppet/modules:/etc/puppet/modules" 46 puppet_modules: "puppet/modules:/etc/puppet/modules"
diff --git a/metadata.yaml b/metadata.yaml
index 875480c..8dd01ff 100644
--- a/metadata.yaml
+++ b/metadata.yaml
@@ -7,7 +7,7 @@ version: 1.0.2
7# Description 7# Description
8description: Ceilometer extension that provides a workload-partitioning and HA for ceilometer services 8description: Ceilometer extension that provides a workload-partitioning and HA for ceilometer services
9# Required fuel version 9# Required fuel version
10fuel_version: ['7.0','8.0'] 10fuel_version: ['9.0']
11# Specify license of your plugin 11# Specify license of your plugin
12licenses: ['Apache License Version 2.0'] 12licenses: ['Apache License Version 2.0']
13# Specify author or company name 13# Specify author or company name
@@ -20,12 +20,7 @@ groups: []
20# The plugin is compatible with releases in the list 20# The plugin is compatible with releases in the list
21releases: 21releases:
22 - os: ubuntu 22 - os: ubuntu
23 version: 2015.1.0-7.0 23 version: mitaka-9.0
24 mode: ['ha']
25 deployment_scripts_path: deployment_scripts/
26 repository_path: repositories/ubuntu
27 - os: ubuntu
28 version: liberty-8.0
29 mode: ['ha'] 24 mode: ['ha']
30 deployment_scripts_path: deployment_scripts/ 25 deployment_scripts_path: deployment_scripts/
31 repository_path: repositories/ubuntu 26 repository_path: repositories/ubuntu