Browse Source

Update plugin for MOS 9.0

Change-Id: I6fc0573ec1519a4cd3b4b9d3c6536910485dd66c
Nadya Shakhat 3 years ago
parent
commit
6e4d9213d2

+ 24
- 0
deployment_scripts/puppet/manifests/create_redis_ocf.pp View File

@@ -0,0 +1,24 @@
1
+include 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
+
17
+file { $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
+}

+ 74
- 31
deployment_scripts/puppet/modules/redis/manifests/main.pp View File

@@ -58,6 +58,7 @@ class redis::main (
58 58
 ) {
59 59
 
60 60
   include ceilometer::params
61
+  include aodh::params
61 62
   include redis::params
62 63
 
63 64
   case $::osfamily {
@@ -142,18 +143,24 @@ class redis::main (
142 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 152
   service { 'ceilometer-agent-central':
146
-    ensure  => 'running',
147
-    name    => $::ceilometer::params::agent_central_service_name,
148
-    enable  => true,
153
+    ensure     => 'running',
154
+    name       => $::ceilometer::params::agent_central_service_name,
155
+    enable     => true,
149 156
     hasstatus  => true,
150 157
     hasrestart => true,
151 158
   }
152 159
 
153
-  service { 'ceilometer-alarm-evaluator':
154
-    ensure  => 'running',
155
-    name    => $::ceilometer::params::alarm_evaluator_service_name,
156
-    enable  => true,
160
+  service { 'aodh-evaluator':
161
+    ensure     => 'running',
162
+    name       => $::aodh::params::evaluator_service_name,
163
+    enable     => true,
157 164
     hasstatus  => true,
158 165
     hasrestart => true,
159 166
   }
@@ -166,38 +173,74 @@ class redis::main (
166 173
     hasrestart => true,
167 174
   }
168 175
 
169
-  pacemaker_wrappers::service { $::ceilometer::params::agent_central_service_name :
170
-    complex_type    => 'clone',
171
-    ms_metadata     => { 'interleave' => true },
172
-    primitive_type  => 'ceilometer-agent-central',
173
-    metadata        => $metadata,
174
-    parameters      => { 'user' => 'ceilometer' },
175
-    operations      => $operations,
176
+  pacemaker::service { $::ceilometer::params::agent_central_service_name :
177
+    complex_type     => 'clone',
178
+    complex_metadata => { 'interleave' => true },
179
+    primitive_type   => 'ceilometer-agent-central',
180
+    metadata         => $metadata,
181
+    parameters       => { 'user' => 'ceilometer' },
182
+    operations       => $operations,
176 183
   }
177 184
 
178
-  pacemaker_wrappers::service { $::ceilometer::params::alarm_evaluator_service_name :
179
-    complex_type    => 'clone',
180
-    ms_metadata     => { 'interleave' => true },
181
-    primitive_type  => 'ceilometer-alarm-evaluator',
182
-    metadata        => $metadata,
183
-    parameters      => { 'user' => 'ceilometer' },
184
-    operations      => $operations,
185
+  pacemaker::service { $::aodh::params::evaluator_service_name :
186
+    complex_type     => 'clone',
187
+    complex_metadata => { 'interleave' => true },
188
+    primitive_type   => 'aodh-evaluator',
189
+    metadata         => $metadata,
190
+    parameters       => { 'user' => 'aodh' },
191
+    operations       => $operations,
185 192
   }
186 193
 
187
-  pacemaker_wrappers::service { 'redis-server' :
188
-    ocf_script_file => 'redis/ocf/redis-server',
189
-    complex_type    => 'clone',
190
-    ms_metadata     => { 'interleave' => true },
191
-    primitive_type  => 'redis-server',
192
-    operations      => $operations,
194
+  pacemaker::service { 'redis-server' :
195
+    ocf_script_file  => 'redis/ocf/redis-server',
196
+    complex_type     => 'clone',
197
+    complex_metadata => { 'interleave' => true },
198
+    primitive_type   => 'redis-server',
199
+    operations       => $operations,
193 200
   }
194 201
 
195
-  Pacemaker_wrappers::Service['redis-server'] ->
196
-  Pacemaker_wrappers::Service["$::ceilometer::params::agent_central_service_name"] ->
197
-  Pacemaker_wrappers::Service["$::ceilometer::params::alarm_evaluator_service_name"]
202
+  # During deploy of plugin we need to update resource type from simple to
203
+  # clone, but this is not working with current implementation of pcmk_resource
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 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 244
   Ceilometer_config <||> ~> Service['ceilometer-agent-notification']
202 245
 
203 246
 }

+ 39
- 1
deployment_tasks.yaml View File

@@ -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 37
 - id: ceilometer_redis
2 38
   type: puppet
3
-  groups: [primary-controller, controller]
39
+  groups: [controller]
4 40
   required_for: [deploy_end]
5 41
   requires: [ceilometer-controller]
42
+  cross-depends:
43
+    - name: primary_ceilometer_redis
6 44
   parameters:
7 45
     puppet_manifest: "puppet/manifests/controller.pp"
8 46
     puppet_modules: "puppet/modules:/etc/puppet/modules"

+ 2
- 7
metadata.yaml View File

@@ -7,7 +7,7 @@ version: 1.0.2
7 7
 # Description
8 8
 description: Ceilometer extension that provides a workload-partitioning and HA for ceilometer services
9 9
 # Required fuel version
10
-fuel_version: ['7.0','8.0']
10
+fuel_version: ['9.0']
11 11
 # Specify license of your plugin
12 12
 licenses: ['Apache License Version 2.0']
13 13
 # Specify author or company name
@@ -20,12 +20,7 @@ groups: []
20 20
 # The plugin is compatible with releases in the list
21 21
 releases:
22 22
   - os: ubuntu
23
-    version: 2015.1.0-7.0
24
-    mode: ['ha']
25
-    deployment_scripts_path: deployment_scripts/
26
-    repository_path: repositories/ubuntu
27
-  - os: ubuntu
28
-    version: liberty-8.0
23
+    version: mitaka-9.0
29 24
     mode: ['ha']
30 25
     deployment_scripts_path: deployment_scripts/
31 26
     repository_path: repositories/ubuntu

Loading…
Cancel
Save