summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBogdan Dobrelya <bdobrelia@mirantis.com>2015-11-05 13:35:05 +0100
committerBogdan Dobrelya <bdobrelia@mirantis.com>2015-11-13 10:47:51 +0100
commit231addb8bfc6dbb03d447f04599fcc8c67f0c99d (patch)
treea00b9fbcfc34d1ceef38219bcaaaa4d8dfbe5d94
parent7ce61a71bb998e66df7c514dfdae396ec0410a59 (diff)
Support for Fuel 6.1-8.0
* Rework plugin deployment tasks to fetch data from hiera * Make YAML file path with fencing settings customizable in UI * Instead of deployment_tasks.yaml, use tasks.yaml, otherwise there is no tasks added for the plugin in nailgun for some strange reason Change-Id: I959ec9f7104629dbf6329d552a670ad4f33ddc7f Signed-off-by: Bogdan Dobrelya <bdobrelia@mirantis.com>
Notes
Notes (review): Verified+2: Jenkins Code-Review+2: Bogdan Dobrelya <bdobrelia@mirantis.com> Workflow+1: Bogdan Dobrelya <bdobrelia@mirantis.com> Submitted-by: Jenkins Submitted-at: Fri, 13 Nov 2015 11:18:49 +0000 Reviewed-on: https://review.openstack.org/244763 Project: openstack/fuel-plugin-ha-fencing Branch: refs/heads/master
-rw-r--r--.gitignore1
-rw-r--r--README.md15
-rw-r--r--deployment_scripts/ha_fencing_deploy.pp34
-rw-r--r--deployment_scripts/ha_fencing_hiera_override.pp29
-rw-r--r--deployment_scripts/puppet/manifests/site.pp27
-rw-r--r--deployment_scripts/puppet/modules/pcs_fencing/manifests/fencing_primitives.pp13
-rw-r--r--environment_config.yaml6
-rw-r--r--metadata.yaml34
-rw-r--r--tasks.yaml24
9 files changed, 138 insertions, 45 deletions
diff --git a/.gitignore b/.gitignore
index d2b3a5f..c8b8df8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,6 +4,7 @@ deployment_scripts/puppet/modules/pacemaker
4deployment_scripts/puppet/modules/stdlib 4deployment_scripts/puppet/modules/stdlib
5.build 5.build
6tmp 6tmp
7*.rpm
7*.fp 8*.fp
8 9
9# Editors 10# Editors
diff --git a/README.md b/README.md
index b4a061e..a6d909a 100644
--- a/README.md
+++ b/README.md
@@ -47,7 +47,7 @@ Setup
47 47
48### Installing Fencing plugin 48### Installing Fencing plugin
49 49
50Please refer to the [plugins dev guide](http://docs.mirantis.com/fuel/fuel-6.0/plugin-dev.html#what-is-pluggable-architecture) 50Please refer to the [plugins dev guide](http://docs.mirantis.com/fuel/fuel-6.1/plugin-dev.html#what-is-pluggable-architecture)
51Note that in order to build this plugin the following tools must present: 51Note that in order to build this plugin the following tools must present:
52* rsync 52* rsync
53* wget 53* wget
@@ -125,7 +125,7 @@ Note that in order to build this plugin the following tools must present:
125 parameters should be specified as FQDN names in case of RedHat OS family and as a 125 parameters should be specified as FQDN names in case of RedHat OS family and as a
126 short names in case of Debian OS family. That is related to the node naming rules in 126 short names in case of Debian OS family. That is related to the node naming rules in
127 Pacemaker cluster in different OS types. 127 Pacemaker cluster in different OS types.
128 128
129* Put created fencing configuration YAML files as ``/etc/pcs_fencing.yaml`` 129* Put created fencing configuration YAML files as ``/etc/pcs_fencing.yaml``
130 for corresponding controller nodes. 130 for corresponding controller nodes.
131 131
@@ -199,6 +199,7 @@ versioning for plugin releases are as follows:
199Plugin :: Fuel version 199Plugin :: Fuel version
2006.0.0 -> 6.0 2006.0.0 -> 6.0
2016.0.1 -> 6.0.1 2016.0.1 -> 6.0.1
2028.0.0 -> 6.1, 7.0, 8.0
202``` 203```
203 204
204Known Issues 205Known Issues
@@ -259,13 +260,21 @@ corosync service. And if corosync service hangs on stop and have to be killed an
259restarted - make it fast, otherwise another STONITH action triggered by dead corosync 260restarted - make it fast, otherwise another STONITH action triggered by dead corosync
260process would arrive. 261process would arrive.
261 262
263Note, this issue should not be relevant since the Fuel 6.1 release containing
264the pacemaker 1.1.12
265
262Release Notes 266Release Notes
263------------- 267-------------
264 268
265*** 6.0.0 *** 269*** 6.0.0 ***
266 270
267* This is the initial release of this plugin. 271* This is the initial release of this plugin.
268 272
269*** 6.0.1 *** 273*** 6.0.1 ***
270 274
271* Add support of the Fuel 6.0.1 275* Add support of the Fuel 6.0.1
276
277*** 8.0.0 ***
278
279* Add support of the Fuel 6.1, 7.0, 8.0
280* Use rpm for the plugin package distribution
diff --git a/deployment_scripts/ha_fencing_deploy.pp b/deployment_scripts/ha_fencing_deploy.pp
new file mode 100644
index 0000000..3f3916d
--- /dev/null
+++ b/deployment_scripts/ha_fencing_deploy.pp
@@ -0,0 +1,34 @@
1notice('MODULAR: ha_fencing/ha_fencing_deploy.pp')
2
3$role = hiera('role', '')
4$primary_controller = $role ? {
5 'primary-controller'=>true, default=>false }
6$is_controller = $role ? {
7 'controller'=>true, default=>false }
8
9if ($is_controller or $primary_controller) {
10 include stdlib
11 # Fetch fencing policy and settings
12 $ha_fencing_hash = hiera_hash('ha_fencing', {})
13 $fence_policy = $ha_fencing_hash['fence_policy']
14 $fencing_enabled = $fence_policy ? {
15 'disabled'=>false, 'reboot'=>true,
16 'poweroff'=>true, default=>false }
17
18 if $fencing_enabled {
19 $fence_primitives = hiera_hash('fence_primitives', {})
20 $fence_topology = hiera_hash('fence_topology', {})
21
22 $nodes = hiera('nodes', {})
23 $controllers = concat(
24 filter_nodes($nodes,'role','primary-controller'),
25 filter_nodes($nodes,'role','controller'))
26
27 class { '::pcs_fencing::fencing_primitives':
28 fence_primitives => $fence_primitives,
29 fence_topology => $fence_topology,
30 nodes => $controllers,
31 primary_controller => $primary_controller,
32 }
33 }
34}
diff --git a/deployment_scripts/ha_fencing_hiera_override.pp b/deployment_scripts/ha_fencing_hiera_override.pp
new file mode 100644
index 0000000..55da3c3
--- /dev/null
+++ b/deployment_scripts/ha_fencing_hiera_override.pp
@@ -0,0 +1,29 @@
1notice('MODULAR: ha_fencing/ha_fencing_hiera_override.pp')
2
3$ha_fencing_hash = hiera('ha_fencing', undef)
4$hiera_dir = '/etc/hiera/override'
5$plugin_name = 'ha_fencing'
6$plugin_yaml = "${plugin_name}.yaml"
7
8if $ha_fencing_hash {
9 $yaml_additional_config = pick(
10 $ha_fencing_hash['yaml_additional_config'], {})
11
12 file {'/etc/hiera/override':
13 ensure => directory,
14 } ->
15 file { "${hiera_dir}/${plugin_yaml}":
16 ensure => file,
17 source => $yaml_additional_config,
18 }
19
20 package {'ruby-deep-merge':
21 ensure => 'installed',
22 }
23
24 file_line {"${plugin_name}_hiera_override":
25 path => '/etc/hiera.yaml',
26 line => " - override/${plugin_name}",
27 after => ' - override/module/%{calling_module}',
28 }
29}
diff --git a/deployment_scripts/puppet/manifests/site.pp b/deployment_scripts/puppet/manifests/site.pp
deleted file mode 100644
index 0b9b5d0..0000000
--- a/deployment_scripts/puppet/manifests/site.pp
+++ /dev/null
@@ -1,27 +0,0 @@
1$fuel_settings = parseyaml($astute_settings_yaml)
2
3$primary_controller = $::fuel_settings['role'] ? { 'primary-controller'=>true, default=>false }
4$is_controller = $::fuel_settings['role'] ? { 'controller'=>true, default=>false }
5
6if ($is_controller or $primary_controller) {
7 # Fetch fencing policy and settings
8 $fence_policy = $::fuel_settings['ha_fencing']['fence_policy']
9 $fencing_enabled = $fence_policy ? { 'disabled'=>false, 'reboot'=>true, 'poweroff'=>true, default=>false }
10
11 if $fencing_enabled {
12 $fencing_settings = parseyaml($fencing_settings_yaml)
13 $fence_primitives = $::fencing_settings['fence_primitives']
14 $fence_topology = $::fencing_settings['fence_topology']
15
16 $nodes_hash = $::fuel_settings['nodes']
17 $controllers = concat(filter_nodes($nodes_hash,'role','primary-controller'), filter_nodes($nodes_hash,'role','controller'))
18
19 include stdlib
20 class { '::pcs_fencing::fencing_primitives':
21 fence_primitives => $fence_primitives,
22 fence_topology => $fence_topology,
23 nodes => $controllers,
24 primary_controller => $primary_controller,
25 }
26 }
27}
diff --git a/deployment_scripts/puppet/modules/pcs_fencing/manifests/fencing_primitives.pp b/deployment_scripts/puppet/modules/pcs_fencing/manifests/fencing_primitives.pp
index e138330..780ba0e 100644
--- a/deployment_scripts/puppet/modules/pcs_fencing/manifests/fencing_primitives.pp
+++ b/deployment_scripts/puppet/modules/pcs_fencing/manifests/fencing_primitives.pp
@@ -40,9 +40,11 @@ class pcs_fencing::fencing_primitives (
40 case $::osfamily { 40 case $::osfamily {
41 'RedHat': { 41 'RedHat': {
42 $names = filter_hash($nodes, 'fqdn') 42 $names = filter_hash($nodes, 'fqdn')
43 $prov = 'pcs'
43 } 44 }
44 'Debian': { 45 'Debian': {
45 $names = filter_hash($nodes, 'name') 46 $names = filter_hash($nodes, 'name')
47 $prov = 'crm'
46 } 48 }
47 default: { 49 default: {
48 fail("Unsupported osfamily: ${::osfamily} operatingsystem: ${::operatingsystem}, module ${module_name} only support osfamily RedHat and Debian") 50 fail("Unsupported osfamily: ${::osfamily} operatingsystem: ${::operatingsystem}, module ${module_name} only support osfamily RedHat and Debian")
@@ -56,12 +58,19 @@ class pcs_fencing::fencing_primitives (
56 58
57 if $primary_controller { 59 if $primary_controller {
58 cs_fencetopo { 'fencing_topology': 60 cs_fencetopo { 'fencing_topology':
61 #TODO(bogdando) make crm/pcs providers
59 ensure => present, 62 ensure => present,
60 fence_topology => $fence_topology, 63 fence_topology => $fence_topology,
61 nodes => $names, 64 nodes => $names,
62 } 65 }
63 cs_property { 'stonith-enabled': value => 'true' } 66 cs_property { 'stonith-enabled':
64 cs_property { 'cluster-recheck-interval': value => '3min' } 67 value => 'true',
68 provider => $prov,
69 }
70 cs_property { 'cluster-recheck-interval':
71 value => '3min',
72 provider => $prov,
73 }
65 } 74 }
66 75
67 package {'fence-agents':} 76 package {'fence-agents':}
diff --git a/environment_config.yaml b/environment_config.yaml
index fd34816..986472d 100644
--- a/environment_config.yaml
+++ b/environment_config.yaml
@@ -5,3 +5,9 @@ attributes:
5 description: 'Pick a type of HA fencing policy' 5 description: 'Pick a type of HA fencing policy'
6 weight: 25 6 weight: 25
7 type: "text" 7 type: "text"
8 yaml_additional_config:
9 value: '/etc/pcs_fencing.yaml'
10 label: 'Yaml settings file for fencing configuration'
11 description: 'Pick a Yaml file for fencing config'
12 weight: 25
13 type: "text"
diff --git a/metadata.yaml b/metadata.yaml
index c1228db..65c73db 100644
--- a/metadata.yaml
+++ b/metadata.yaml
@@ -2,33 +2,51 @@
2name: ha_fencing 2name: ha_fencing
3title: HA fencing for Pacemaker cluster 3title: HA fencing for Pacemaker cluster
4# Plugin version 4# Plugin version
5version: 6.0.1 5version: 8.0.0
6# Description 6# Description
7description: Enables STONITH of the failed nodes in Corosync & Pacemaker cluster 7description: Enables STONITH of the failed nodes in Corosync & Pacemaker cluster
8# Required fuel version 8# Required fuel version
9fuel_version: ['6.0', '6.0.1'] 9fuel_version: ['6.1', '7.0', '8.0']
10 10# Specify license of your plugin
11licenses: ['Apache License Version 2.0']
12# Specify author or company name
13authors: ['Bogdan Dobrelya','Mirantis']
14# A link to the plugin's page
15homepage: 'https://github.com/openstack/fuel-plugin-ha-fencing'
16# Specify a group which your plugin implements, possible options:
17# network, storage, storage::cinder, storage::glance, hypervisor
18groups: [network]
11# The plugin is compatible with releases in the list 19# The plugin is compatible with releases in the list
12releases: 20releases:
13 - os: ubuntu 21 - os: ubuntu
14 version: 2014.2-6.0 22 version: 2014.2.2-6.1
15 mode: ['ha'] 23 mode: ['ha']
16 deployment_scripts_path: deployment_scripts/ 24 deployment_scripts_path: deployment_scripts/
17 repository_path: repositories/ubuntu 25 repository_path: repositories/ubuntu
18 - os: centos 26 - os: centos
19 version: 2014.2-6.0 27 version: 2014.2.2-6.1
20 mode: ['ha'] 28 mode: ['ha']
21 deployment_scripts_path: deployment_scripts/ 29 deployment_scripts_path: deployment_scripts/
22 repository_path: repositories/centos 30 repository_path: repositories/centos
23 - os: ubuntu 31 - os: ubuntu
24 version: 2014.2.2-6.0.1 32 version: 2015.1.0-7.0
25 mode: ['ha'] 33 mode: ['ha']
26 deployment_scripts_path: deployment_scripts/ 34 deployment_scripts_path: deployment_scripts/
27 repository_path: repositories/ubuntu 35 repository_path: repositories/ubuntu
28 - os: centos 36 - os: centos
29 version: 2014.2.2-6.0.1 37 version: 2015.1.0-7.0
38 mode: ['ha']
39 deployment_scripts_path: deployment_scripts/
40 repository_path: repositories/centos
41 - os: ubuntu
42 version: 2015.1.0-8.0
43 mode: ['ha']
44 deployment_scripts_path: deployment_scripts/
45 repository_path: repositories/ubuntu
46 - os: centos
47 version: 2015.1.0-8.0
30 mode: ['ha'] 48 mode: ['ha']
31 deployment_scripts_path: deployment_scripts/ 49 deployment_scripts_path: deployment_scripts/
32 repository_path: repositories/centos 50 repository_path: repositories/centos
33# Version of plugin package 51# Version of plugin package
34package_version: '1.0.0' 52package_version: '2.0.0'
diff --git a/tasks.yaml b/tasks.yaml
index 7fa6f2e..11ec776 100644
--- a/tasks.yaml
+++ b/tasks.yaml
@@ -1,8 +1,22 @@
1# Deployment is required for controllers 1# Deployment tasks
2- role: ['controller'] 2- id: ha-fencing-hiera-override
3 role: ['primary-controller', 'controller']
3 stage: post_deployment 4 stage: post_deployment
5 requires: [post_deployment_start]
6 required_for: [post_deployment_end]
4 type: puppet 7 type: puppet
5 parameters: 8 parameters:
6 puppet_manifest: puppet/manifests/site.pp 9 puppet_manifest: "ha_fencing_hiera_override.pp"
7 puppet_modules: puppet/modules 10 puppet_modules: "puppet/modules"
8 timeout: 720 11 timeout: 120
12
13- id: ha-fencing-deploy
14 role: ['primary-controller', 'controller']
15 stage: post_deployment
16 requires: [post_deployment_start, ha-fencing-hiera-override]
17 required_for: [post_deployment_end]
18 type: puppet
19 parameters:
20 puppet_manifest: "ha_fencing_deploy.pp"
21 puppet_modules: "puppet/modules"
22 timeout: 600