
Several changes to deprecate the MidoNet's zookeeper module. Deric's Zookeeper: https://github.com/deric/puppet-zookeeper Is well mantained and it has much more functionality. So the commit replaces the dependencies and sets some changes to adapt to the new module. I have kept the ::midonet::zookeeper manifest to maintain backwards compatiblity with tools that use MidoNet 2015.01 version. So the ::midonet::zookeeper manifest is just a gangway to the actual's deric one now. Change-Id: I6e6ebe8c9fea2e3d3195d9890b1c89362bd23d58
100 lines
2.8 KiB
Puppet
100 lines
2.8 KiB
Puppet
# == Class: ::midonet::zookeeper
|
|
#
|
|
# Install and run the zookeeper module.
|
|
#
|
|
# === Parameters
|
|
#
|
|
# [*servers*]
|
|
# Full list of ZooKeeper servers that run in the same cluster.
|
|
# [*server_id*]
|
|
# Identifier of this ZooKeeper server in the cluster.
|
|
#
|
|
# === Examples
|
|
#
|
|
# The easiest way to run the class is:
|
|
#
|
|
# include ::midonet::zookeeper
|
|
#
|
|
# And puppet will install a local zookeeper without cluster. For a
|
|
# clustered zookeeper, the way you have to define your puppet site, is:
|
|
#
|
|
#
|
|
# ... on Node1
|
|
#
|
|
# class {'::midonet::zookeeper':
|
|
# servers => [{'id' => 1
|
|
# 'host' => 'node_1'},
|
|
# {'id' => 2,
|
|
# 'host' => 'node_2'},
|
|
# {'id' => 3,
|
|
# 'host' => 'node_3'}],
|
|
# server_id => 1}
|
|
#
|
|
# ... on Node2
|
|
#
|
|
# class {'::midonet::zookeeper':
|
|
# servers => [{'id' => 1
|
|
# 'host' => 'node_1'},
|
|
# {'id' => 2,
|
|
# 'host' => 'node_2'},
|
|
# {'id' => 3,
|
|
# 'host' => 'node_3'}],
|
|
# server_id => 2}
|
|
#
|
|
# ... on Node3
|
|
#
|
|
# class {'::midonet::zookeeper':
|
|
# servers => [{'id' => 1,
|
|
# 'host' => 'node_1'},
|
|
# {'id' => 2,
|
|
# 'host' => 'node_2'},
|
|
# {'id' => 3,
|
|
# 'host' => 'node_3'}],
|
|
# server_id => 3}
|
|
#
|
|
# defining the same servers for each puppet node, but using a different
|
|
# server_id for each one. NOTE: node_X can be hostnames or IP addresses.
|
|
#
|
|
# you can alternatively use the Hiera.yaml style
|
|
#
|
|
# ::midonet::zookeeper::servers:
|
|
# - id: 1
|
|
# host: 'node_1'
|
|
# - id: 2
|
|
# host: 'node_2'
|
|
# - id: 3
|
|
# host: 'node_3'
|
|
# ::midonet::zookeeper::server_id: '1'
|
|
#
|
|
# This module is a passthrough to already existent 'deric-zookeeper'
|
|
# https://forge.puppetlabs.com/deric/zookeeper
|
|
#
|
|
# === Authors
|
|
#
|
|
# Midonet (http://midonet.org)
|
|
#
|
|
# === Copyright
|
|
#
|
|
# Copyright (c) 2015 Midokura SARL, All Rights Reserved.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
#
|
|
|
|
class midonet::zookeeper($servers, $server_id) {
|
|
|
|
class {'::zookeeper':
|
|
servers => zookeeper_servers($servers),
|
|
id => $server_id
|
|
}
|
|
}
|