[openstack-puppet-modules] Updated patches from upstream-openstack/master-patches
Lukas Bezdicka
social at fedoraproject.org
Fri Oct 31 14:30:49 UTC 2014
commit 0051b222e1e954b7d096342e4501bf4c675ab254
Author: Lukas Bezdicka <lbezdick at redhat.com>
Date: Fri Oct 31 15:29:23 2014 +0100
Updated patches from upstream-openstack/master-patches
...VS-mechanism-agent-configs-in-its-config-.patch | 282 ++++++
0008-Add-manage_service-feature.patch | 1013 ++++++++++++++++++++
openstack-puppet-modules.spec | 4 +
3 files changed, 1299 insertions(+), 0 deletions(-)
---
diff --git a/0007-Configure-OVS-mechanism-agent-configs-in-its-config-.patch b/0007-Configure-OVS-mechanism-agent-configs-in-its-config-.patch
new file mode 100644
index 0000000..1af7175
--- /dev/null
+++ b/0007-Configure-OVS-mechanism-agent-configs-in-its-config-.patch
@@ -0,0 +1,282 @@
+From a39e510c8ce1f34c365a2249f3b0a3107229981e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Mathieu=20Gagne=CC=81?= <mgagne at iweb.com>
+Date: Wed, 9 Jul 2014 20:44:07 -0400
+Subject: [PATCH] Configure OVS mechanism agent configs in its config file
+
+Configurations for the OVS agent should go in its config file:
+/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini
+
+Therefore, we should not remove the agent config file and
+replace it with a symlink to plugin.ini or ml2_conf.ini.
+
+Those config files are meant to be used by the core plugin itself
+in neutron-server, not the agents themselves.
+
+- Remove symlink creation from ovs_neutron_plugin.ini to plugin.ini
+- Use neutron_plugin_ovs to configure OVS mechanism agent configs
+
+Change-Id: I53d9b923784587e8a2a934f004a3b054c716daaa
+Signed-off-by: Gael Chamoulaud <gchamoul at redhat.com>
+---
+ neutron/manifests/agents/ml2/ovs.pp | 39 +++++--------
+ .../spec/classes/neutron_agents_ml2_ovs_spec.rb | 68 +++++++++-------------
+ 2 files changed, 41 insertions(+), 66 deletions(-)
+
+diff --git a/neutron/manifests/agents/ml2/ovs.pp b/neutron/manifests/agents/ml2/ovs.pp
+index 709a87f..9a61dff 100644
+--- a/neutron/manifests/agents/ml2/ovs.pp
++++ b/neutron/manifests/agents/ml2/ovs.pp
+@@ -117,7 +117,8 @@ class neutron::agents::ml2::ovs (
+ fail('L2 population must be enabled when DVR is enabled')
+ }
+
+- Neutron_plugin_ml2<||> ~> Service['neutron-ovs-agent-service']
++ Package['neutron-ovs-agent'] -> Neutron_plugin_ovs<||>
++ Neutron_plugin_ovs<||> ~> Service['neutron-ovs-agent-service']
+
+ if ($bridge_mappings != []) {
+ # bridge_mappings are used to describe external networks that are
+@@ -135,7 +136,7 @@ class neutron::agents::ml2::ovs (
+ # Set config for bridges that we're going to create
+ # The OVS neutron plugin will talk in terms of the networks in the bridge_mappings
+ $br_map_str = join($bridge_mappings, ',')
+- neutron_plugin_ml2 {
++ neutron_plugin_ovs {
+ 'ovs/bridge_mappings': value => $br_map_str;
+ }
+ neutron::plugins::ovs::bridge{ $bridge_mappings:
+@@ -146,7 +147,7 @@ class neutron::agents::ml2::ovs (
+ }
+ }
+
+- neutron_plugin_ml2 {
++ neutron_plugin_ovs {
+ 'agent/polling_interval': value => $polling_interval;
+ 'agent/l2_population': value => $l2_population;
+ 'agent/arp_responder': value => $arp_responder;
+@@ -154,12 +155,10 @@ class neutron::agents::ml2::ovs (
+ 'ovs/integration_bridge': value => $integration_bridge;
+ }
+
+- if ($firewall_driver) {
+- neutron_plugin_ml2 { 'securitygroup/firewall_driver':
+- value => $firewall_driver
+- }
++ if $firewall_driver {
++ neutron_plugin_ovs { 'securitygroup/firewall_driver': value => $firewall_driver }
+ } else {
+- neutron_plugin_ml2 { 'securitygroup/firewall_driver': ensure => absent }
++ neutron_plugin_ovs { 'securitygroup/firewall_driver': ensure => absent }
+ }
+
+ vs_bridge { $integration_bridge:
+@@ -172,25 +171,25 @@ class neutron::agents::ml2::ovs (
+ ensure => present,
+ before => Service['neutron-ovs-agent-service'],
+ }
+- neutron_plugin_ml2 {
++ neutron_plugin_ovs {
+ 'ovs/enable_tunneling': value => true;
+ 'ovs/tunnel_bridge': value => $tunnel_bridge;
+ 'ovs/local_ip': value => $local_ip;
+ }
+
+ if size($tunnel_types) > 0 {
+- neutron_plugin_ml2 {
++ neutron_plugin_ovs {
+ 'agent/tunnel_types': value => join($tunnel_types, ',');
+ }
+ }
+ if 'vxlan' in $tunnel_types {
+ validate_vxlan_udp_port($vxlan_udp_port)
+- neutron_plugin_ml2 {
++ neutron_plugin_ovs {
+ 'agent/vxlan_udp_port': value => $vxlan_udp_port;
+ }
+ }
+ } else {
+- neutron_plugin_ml2 {
++ neutron_plugin_ovs {
+ 'ovs/enable_tunneling': value => false;
+ 'ovs/tunnel_bridge': ensure => absent;
+ 'ovs/local_ip': ensure => absent;
+@@ -199,7 +198,6 @@ class neutron::agents::ml2::ovs (
+
+
+ if $::neutron::params::ovs_agent_package {
+- Package['neutron-ovs-agent'] -> Neutron_plugin_ml2<||>
+ package { 'neutron-ovs-agent':
+ ensure => $package_ensure,
+ name => $::neutron::params::ovs_agent_package,
+@@ -208,21 +206,11 @@ class neutron::agents::ml2::ovs (
+ # Some platforms (RedHat) do not provide a separate
+ # neutron plugin ovs agent package. The configuration file for
+ # the ovs agent is provided by the neutron ovs plugin package.
+- Package['neutron-ovs-agent'] -> Neutron_plugin_ml2<||>
+- Package['neutron-ovs-agent'] -> Service['ovs-cleanup-service']
+-
+ if ! defined(Package['neutron-ovs-agent']) {
+ package { 'neutron-ovs-agent':
+ ensure => $package_ensure,
+ name => $::neutron::params::ovs_server_package,
+- } ->
+- # https://bugzilla.redhat.com/show_bug.cgi?id=1087647
+- # Causes init script for agent to load the old ovs file
+- # instead of the ml2 config file.
+- file { '/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini':
+- ensure => link,
+- target => '/etc/neutron/plugin.ini'
+- } ~> Service<| title == 'neutron-ovs-agent-service' |>
++ }
+ }
+ }
+
+@@ -240,7 +228,8 @@ class neutron::agents::ml2::ovs (
+ }
+
+ if $::neutron::params::ovs_cleanup_service {
+- service {'ovs-cleanup-service':
++ Package['neutron-ovs-agent'] -> Service['ovs-cleanup-service']
++ service { 'ovs-cleanup-service':
+ ensure => $service_ensure,
+ name => $::neutron::params::ovs_cleanup_service,
+ enable => $enabled,
+diff --git a/neutron/spec/classes/neutron_agents_ml2_ovs_spec.rb b/neutron/spec/classes/neutron_agents_ml2_ovs_spec.rb
+index d9c9dc5..a133ffa 100644
+--- a/neutron/spec/classes/neutron_agents_ml2_ovs_spec.rb
++++ b/neutron/spec/classes/neutron_agents_ml2_ovs_spec.rb
+@@ -34,15 +34,15 @@ describe 'neutron::agents::ml2::ovs' do
+ it { should contain_class('neutron::params') }
+
+ it 'configures ovs_neutron_plugin.ini' do
+- should contain_neutron_plugin_ml2('agent/polling_interval').with_value(p[:polling_interval])
+- should contain_neutron_plugin_ml2('agent/l2_population').with_value(p[:l2_population])
+- should contain_neutron_plugin_ml2('agent/arp_responder').with_value(p[:arp_responder])
+- should contain_neutron_plugin_ml2('ovs/integration_bridge').with_value(p[:integration_bridge])
+- should contain_neutron_plugin_ml2('securitygroup/firewall_driver').\
++ should contain_neutron_plugin_ovs('agent/polling_interval').with_value(p[:polling_interval])
++ should contain_neutron_plugin_ovs('agent/l2_population').with_value(p[:l2_population])
++ should contain_neutron_plugin_ovs('agent/arp_responder').with_value(p[:arp_responder])
++ should contain_neutron_plugin_ovs('ovs/integration_bridge').with_value(p[:integration_bridge])
++ should contain_neutron_plugin_ovs('securitygroup/firewall_driver').\
+ with_value(p[:firewall_driver])
+- should contain_neutron_plugin_ml2('ovs/enable_tunneling').with_value(false)
+- should contain_neutron_plugin_ml2('ovs/tunnel_bridge').with_ensure('absent')
+- should contain_neutron_plugin_ml2('ovs/local_ip').with_ensure('absent')
++ should contain_neutron_plugin_ovs('ovs/enable_tunneling').with_value(false)
++ should contain_neutron_plugin_ovs('ovs/tunnel_bridge').with_ensure('absent')
++ should contain_neutron_plugin_ovs('ovs/local_ip').with_ensure('absent')
+ end
+
+ it 'configures vs_bridge' do
+@@ -59,18 +59,20 @@ describe 'neutron::agents::ml2::ovs' do
+ :name => platform_params[:ovs_agent_package],
+ :ensure => p[:package_ensure]
+ )
+- should contain_package('neutron-ovs-agent').with_before(/Neutron_plugin_ml2\[.+\]/)
++ should contain_package('neutron-ovs-agent').with_before(/Neutron_plugin_ovs\[.+\]/)
+ else
+ end
+ end
+
+- it 'configures neutron ovs agent service' do
+- should contain_service('neutron-ovs-agent-service').with(
+- :name => platform_params[:ovs_agent_service],
+- :enable => true,
+- :ensure => 'running',
+- :require => 'Class[Neutron]'
+- )
++ it 'configures neutron ovs cleanup service (if any)' do
++ if platform_params.has_key?(:ovs_cleanup_service)
++ should contain_service('ovs-cleanup-service').with(
++ :name => platform_params[:ovs_cleanup_service],
++ :enable => true,
++ :ensure => 'running'
++ )
++ should contain_package('neutron-ovs-agent').with_before(/Service\[ovs-cleanup-service\]/)
++ end
+ end
+
+ context 'when supplying a firewall driver' do
+@@ -78,7 +80,7 @@ describe 'neutron::agents::ml2::ovs' do
+ params.merge!(:firewall_driver => false)
+ end
+ it 'should configure firewall driver' do
+- should contain_neutron_plugin_ml2('securitygroup/firewall_driver').with_ensure('absent')
++ should contain_neutron_plugin_ovs('securitygroup/firewall_driver').with_ensure('absent')
+ end
+ end
+
+@@ -87,7 +89,7 @@ describe 'neutron::agents::ml2::ovs' do
+ params.merge!(:arp_responder => true)
+ end
+ it 'should enable ARP responder' do
+- should contain_neutron_plugin_ml2('agent/arp_responder').with_value(true)
++ should contain_neutron_plugin_ovs('agent/arp_responder').with_value(true)
+ end
+ end
+
+@@ -97,7 +99,7 @@ describe 'neutron::agents::ml2::ovs' do
+ :l2_population => true )
+ end
+ it 'should enable DVR' do
+- should contain_neutron_plugin_ml2('agent/enable_distributed_routing').with_value(true)
++ should contain_neutron_plugin_ovs('agent/enable_distributed_routing').with_value(true)
+ end
+ end
+
+@@ -107,7 +109,7 @@ describe 'neutron::agents::ml2::ovs' do
+ end
+
+ it 'configures bridge mappings' do
+- should contain_neutron_plugin_ml2('ovs/bridge_mappings')
++ should contain_neutron_plugin_ovs('ovs/bridge_mappings')
+ end
+
+ it 'should configure bridge mappings' do
+@@ -139,9 +141,9 @@ describe 'neutron::agents::ml2::ovs' do
+ params.merge!(:enable_tunneling => true, :local_ip => '127.0.0.1' )
+ end
+ it 'should configure ovs for tunneling' do
+- should contain_neutron_plugin_ml2('ovs/enable_tunneling').with_value(true)
+- should contain_neutron_plugin_ml2('ovs/tunnel_bridge').with_value(default_params[:tunnel_bridge])
+- should contain_neutron_plugin_ml2('ovs/local_ip').with_value('127.0.0.1')
++ should contain_neutron_plugin_ovs('ovs/enable_tunneling').with_value(true)
++ should contain_neutron_plugin_ovs('ovs/tunnel_bridge').with_value(default_params[:tunnel_bridge])
++ should contain_neutron_plugin_ovs('ovs/local_ip').with_value('127.0.0.1')
+ should contain_vs_bridge(default_params[:tunnel_bridge]).with(
+ :ensure => 'present',
+ :before => 'Service[neutron-ovs-agent-service]'
+@@ -158,8 +160,8 @@ describe 'neutron::agents::ml2::ovs' do
+ end
+
+ it 'should perform vxlan network configuration' do
+- should contain_neutron_plugin_ml2('agent/tunnel_types').with_value(params[:tunnel_types])
+- should contain_neutron_plugin_ml2('agent/vxlan_udp_port').with_value(params[:vxlan_udp_port])
++ should contain_neutron_plugin_ovs('agent/tunnel_types').with_value(params[:tunnel_types])
++ should contain_neutron_plugin_ovs('agent/vxlan_udp_port').with_value(params[:vxlan_udp_port])
+ end
+ end
+
+@@ -201,21 +203,5 @@ describe 'neutron::agents::ml2::ovs' do
+ end
+
+ it_configures 'neutron plugin ovs agent with ml2 plugin'
+-
+- it 'configures neutron ovs cleanup service' do
+- should contain_service('ovs-cleanup-service').with(
+- :name => platform_params[:ovs_cleanup_service],
+- :enable => true,
+- :ensure => 'running'
+- )
+- should contain_package('neutron-ovs-agent').with_before(/Service\[ovs-cleanup-service\]/)
+- end
+-
+- it 'links from ovs config to plugin config' do
+- should contain_file('/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini').with(
+- :ensure => 'link',
+- :target => '/etc/neutron/plugin.ini'
+- )
+- end
+ end
+ end
diff --git a/0008-Add-manage_service-feature.patch b/0008-Add-manage_service-feature.patch
new file mode 100644
index 0000000..048de0f
--- /dev/null
+++ b/0008-Add-manage_service-feature.patch
@@ -0,0 +1,1013 @@
+From e828c55b9bf805d61fe42f35df90a42ab86359f5 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Martin=20M=C3=A1gr?= <mmagr at redhat.com>
+Date: Mon, 22 Sep 2014 15:50:38 +0200
+Subject: [PATCH] Add manage_service feature
+
+puppet-swift lacks of disabling service managing. This patch adds
+$manage_service and $enabled parameter to all relevant classes.
+
+Closes-bug: #1359823
+Change-Id: I3d632e3a26e9394d03d94089ae704904bf77aa51
+---
+ swift/manifests/proxy.pp | 136 ++++++++++++-------
+ swift/manifests/storage/account.pp | 35 ++++-
+ swift/manifests/storage/container.pp | 42 ++++--
+ swift/manifests/storage/generic.pp | 35 ++++-
+ swift/manifests/storage/object.pp | 35 ++++-
+ swift/spec/classes/swift_proxy_spec.rb | 74 +++++++++++
+ swift/spec/classes/swift_storage_account_spec.rb | 118 ++++++++++++-----
+ swift/spec/classes/swift_storage_container_spec.rb | 147 +++++++++++++--------
+ swift/spec/classes/swift_storage_object_spec.rb | 117 +++++++++++-----
+ 9 files changed, 551 insertions(+), 188 deletions(-)
+
+diff --git a/swift/manifests/proxy.pp b/swift/manifests/proxy.pp
+index ff7405c..d89fea9 100644
+--- a/swift/manifests/proxy.pp
++++ b/swift/manifests/proxy.pp
+@@ -6,37 +6,65 @@
+ #
+ # Installs and configures the swift proxy node.
+ #
+-# [*Parameters*]
+-#
+-# [*proxy_local_net_ip*] The address that the proxy will bind to.
+-# Required.
+-# [*port*] The port to which the proxy server will bind.
+-# Optional. Defaults to 8080.
+-# [*pipeline*] The list of elements of the swift proxy pipeline.
+-# Currently supports healthcheck, cache, proxy-server, and
+-# one of the following auth_types: tempauth, swauth, keystone.
+-# Each of the specified elements also need to be declared externally
+-# as a puppet class with the exception of proxy-server.
+-# Optional. Defaults to ['healthcheck', 'cache', 'tempauth', 'proxy-server']
+-# [*workers*] Number of threads to process requests.
+-# Optional. Defaults to the number of processors.
+-# [*allow_account_management*]
+-# Rather or not requests through this proxy can create and
+-# delete accounts. Optional. Defaults to true.
+-# [*account_autocreate*] Rather accounts should automatically be created.
+-# Has to be set to true for tempauth. Optional. Defaults to true.
+-# [*read_affinity*]
+-# Configures the read affinity of proxy-server. Optional. Defaults to undef.
+-# [*write_affinity*]
+-# Configures the write affinity of proxy-server. Optional. Defaults to undef.
+-# [*write_affinity_node_count*]
+-# Configures write_affinity_node_count for proxy-server.
+-# Optional but requires write_affinity to be set. Defaults to undef.
+-# [*package_ensure*] Ensure state of the swift proxy package.
+-# Optional. Defaults to present.
+-# [*log_name*]
+-# Configures log_name for swift proxy-server.
+-# Optional. Defaults to proxy-server
++# == Parameters
++#
++# [*proxy_local_net_ip*]
++# The address that the proxy will bind to.
++#
++# [*port*]
++# (optional) The port to which the proxy server will bind.
++# Defaults to 8080.
++#
++# [*pipeline*]
++# (optional) The list of elements of the swift proxy pipeline.
++# Currently supports healthcheck, cache, proxy-server, and
++# one of the following auth_types: tempauth, swauth, keystone.
++# Each of the specified elements also need to be declared externally
++# as a puppet class with the exception of proxy-server.
++# Defaults to ['healthcheck', 'cache', 'tempauth', 'proxy-server']
++#
++# [*workers*]
++# (optional) Number of threads to process requests.
++# Defaults to the number of processors.
++#
++# [*allow_account_management*]
++# (optional) Rather or not requests through this proxy can create and
++# delete accounts.
++# Defaults to true.
++#
++# [*account_autocreate*]
++# (optional) Rather accounts should automatically be created.
++# Has to be set to true for tempauth.
++# Defaults to true.
++#
++# [*read_affinity*]
++# (optional) Configures the read affinity of proxy-server.
++# Defaults to undef.
++#
++# [*write_affinity*]
++# (optional) Configures the write affinity of proxy-server.
++# Defaults to undef.
++#
++# [*write_affinity_node_count*]
++# (optional) Configures write_affinity_node_count for proxy-server.
++# Optional but requires write_affinity to be set.
++# Defaults to undef.
++#
++# [*enabled*]
++# (optional) Should the service be enabled.
++# Defaults to true
++#
++# [*manage_service*]
++# (optional) Whether the service should be managed by Puppet.
++# Defaults to true.
++#
++# [*package_ensure*]
++# (optional) Ensure state of the swift proxy package.
++# Defaults to present.
++#
++# [*log_name*]
++# Configures log_name for swift proxy-server.
++# Optional. Defaults to proxy-server
+ #
+ # == Examples
+ #
+@@ -50,23 +78,25 @@
+ #
+ class swift::proxy(
+ $proxy_local_net_ip,
+- $port = '8080',
+- $pipeline = ['healthcheck', 'cache', 'tempauth', 'proxy-server'],
+- $workers = $::processorcount,
+- $allow_account_management = true,
+- $account_autocreate = true,
+- $log_headers = 'False',
+- $log_udp_host = '',
+- $log_udp_port = '',
+- $log_address = '/dev/log',
+- $log_level = 'INFO',
+- $log_facility = 'LOG_LOCAL1',
+- $log_handoffs = true,
+- $log_name = 'proxy-server',
+- $read_affinity = undef,
+- $write_affinity = undef,
++ $port = '8080',
++ $pipeline = ['healthcheck', 'cache', 'tempauth', 'proxy-server'],
++ $workers = $::processorcount,
++ $allow_account_management = true,
++ $account_autocreate = true,
++ $log_headers = 'False',
++ $log_udp_host = '',
++ $log_udp_port = '',
++ $log_address = '/dev/log',
++ $log_level = 'INFO',
++ $log_facility = 'LOG_LOCAL1',
++ $log_handoffs = true,
++ $log_name = 'proxy-server',
++ $read_affinity = undef,
++ $write_affinity = undef,
+ $write_affinity_node_count = undef,
+- $package_ensure = 'present'
++ $manage_service = true,
++ $enabled = true,
++ $package_ensure = 'present'
+ ) {
+
+ include swift::params
+@@ -130,10 +160,18 @@ class swift::proxy(
+ before => Class[$required_classes],
+ }
+
++ if $manage_service {
++ if $enabled {
++ $service_ensure = 'running'
++ } else {
++ $service_ensure = 'stopped'
++ }
++ }
++
+ service { 'swift-proxy':
+- ensure => running,
++ ensure => $service_ensure,
+ name => $::swift::params::proxy_service_name,
+- enable => true,
++ enable => $enabled,
+ provider => $::swift::params::service_provider,
+ hasstatus => true,
+ subscribe => Concat['/etc/swift/proxy-server.conf'],
+diff --git a/swift/manifests/storage/account.pp b/swift/manifests/storage/account.pp
+index 1ce6865..a4398c3 100644
+--- a/swift/manifests/storage/account.pp
++++ b/swift/manifests/storage/account.pp
+@@ -1,24 +1,51 @@
++# Class swift::storage::account
++#
++# == Parameters
++# [*enabled*]
++# (optional) Should the service be enabled.
++# Defaults to true
++#
++# [*manage_service*]
++# (optional) Whether the service should be managed by Puppet.
++# Defaults to true.
++#
++# [*package_ensure*]
++# (optional) Value of package resource parameter 'ensure'.
++# Defaults to 'present'.
++#
+ class swift::storage::account(
++ $manage_service = true,
++ $enabled = true,
+ $package_ensure = 'present'
+ ) {
+ swift::storage::generic { 'account':
++ manage_service => $manage_service,
++ enabled => $enabled,
+ package_ensure => $package_ensure,
+ }
+
+ include swift::params
+
++ if $manage_service {
++ if $enabled {
++ $service_ensure = 'running'
++ } else {
++ $service_ensure = 'stopped'
++ }
++ }
++
+ service { 'swift-account-reaper':
+- ensure => running,
++ ensure => $service_ensure,
+ name => $::swift::params::account_reaper_service_name,
+- enable => true,
++ enable => $enabled,
+ provider => $::swift::params::service_provider,
+ require => Package['swift-account'],
+ }
+
+ service { 'swift-account-auditor':
+- ensure => running,
++ ensure => $service_ensure,
+ name => $::swift::params::account_auditor_service_name,
+- enable => true,
++ enable => $enabled,
+ provider => $::swift::params::service_provider,
+ require => Package['swift-account'],
+ }
+diff --git a/swift/manifests/storage/container.pp b/swift/manifests/storage/container.pp
+index a4002d8..741dcba 100644
+--- a/swift/manifests/storage/container.pp
++++ b/swift/manifests/storage/container.pp
+@@ -1,31 +1,55 @@
+ #
+ # === Parameters
++# [*enabled*]
++# (optional) Should the service be enabled.
++# Defaults to true
+ #
+-# [*allowed_sync_hosts*] A list of hosts allowed in the X-Container-Sync-To
+-# field for containers. Defaults to one entry list '127.0.0.1'.
++# [*manage_service*]
++# (optional) Whether the service should be managed by Puppet.
++# Defaults to true.
++#
++# [*package_ensure*]
++# (optional) Value of package resource parameter 'ensure'.
++# Defaults to 'present'.
++#
++# [*allowed_sync_hosts*]
++# (optional) A list of hosts allowed in the X-Container-Sync-To
++# field for containers. Defaults to one entry list '127.0.0.1'.
+ #
+ class swift::storage::container(
+- $package_ensure = 'present',
++ $manage_service = true,
++ $enabled = true,
++ $package_ensure = 'present',
+ $allowed_sync_hosts = ['127.0.0.1'],
+ ) {
+ swift::storage::generic { 'container':
++ manage_service => $manage_service,
++ enabled => $enabled,
+ package_ensure => $package_ensure
+ }
+
+ include swift::params
+
++ if $manage_service {
++ if $enabled {
++ $service_ensure = 'running'
++ } else {
++ $service_ensure = 'stopped'
++ }
++ }
++
+ service { 'swift-container-updater':
+- ensure => running,
++ ensure => $service_ensure,
+ name => $::swift::params::container_updater_service_name,
+- enable => true,
++ enable => $enabled,
+ provider => $::swift::params::service_provider,
+ require => Package['swift-container'],
+ }
+
+ service { 'swift-container-auditor':
+- ensure => running,
++ ensure => $service_ensure,
+ name => $::swift::params::container_auditor_service_name,
+- enable => true,
++ enable => $enabled,
+ provider => $::swift::params::service_provider,
+ require => Package['swift-container'],
+ }
+@@ -41,8 +65,8 @@ class swift::storage::container(
+ target => '/lib/init/upstart-job',
+ }
+ service { 'swift-container-sync':
+- ensure => running,
+- enable => true,
++ ensure => $service_ensure,
++ enable => $enabled,
+ provider => $::swift::params::service_provider,
+ require => File['/etc/init/swift-container-sync.conf', '/etc/init.d/swift-container-sync']
+ }
+diff --git a/swift/manifests/storage/generic.pp b/swift/manifests/storage/generic.pp
+index 2f84f2e..341bc5a 100644
+--- a/swift/manifests/storage/generic.pp
++++ b/swift/manifests/storage/generic.pp
+@@ -2,9 +2,20 @@
+ # needed to deploy each type of storage server.
+ #
+ # == Parameters
+-# [*package_ensure*] The desired ensure state of the swift storage packages.
+-# Optional. Defaults to present.
+-# [*service_provider*] The provider to use for the service
++# [*enabled*]
++# (optional) Should the service be enabled.
++# Defaults to true
++#
++# [*manage_service*]
++# (optional) Whether the service should be managed by Puppet.
++# Defaults to true.
++#
++# [*package_ensure*]
++# (optional) The desired ensure state of the swift storage packages.
++# Defaults to present.
++#
++# [*service_provider*]
++# (optional) The provider to use for the service
+ #
+ # == Dependencies
+ # Requires Class[swift::storage]
+@@ -18,6 +29,8 @@
+ #
+ # Copyright 2011 Puppetlabs Inc, unless otherwise noted.
+ define swift::storage::generic(
++ $manage_service = true,
++ $enabled = true,
+ $package_ensure = 'present',
+ $service_provider = $::swift::params::service_provider
+ ) {
+@@ -42,19 +55,27 @@ define swift::storage::generic(
+ group => 'swift',
+ }
+
++ if $manage_service {
++ if $enabled {
++ $service_ensure = 'running'
++ } else {
++ $service_ensure = 'stopped'
++ }
++ }
++
+ service { "swift-${name}":
+- ensure => running,
++ ensure => $service_ensure,
+ name => inline_template("<%= scope.lookupvar('::swift::params::${name}_service_name') %>"),
+- enable => true,
++ enable => $enabled,
+ hasstatus => true,
+ provider => $service_provider,
+ subscribe => Package["swift-${name}"],
+ }
+
+ service { "swift-${name}-replicator":
+- ensure => running,
++ ensure => $service_ensure,
+ name => inline_template("<%= scope.lookupvar('::swift::params::${name}_replicator_service_name') %>"),
+- enable => true,
++ enable => $enabled,
+ hasstatus => true,
+ provider => $service_provider,
+ subscribe => Package["swift-${name}"],
+diff --git a/swift/manifests/storage/object.pp b/swift/manifests/storage/object.pp
+index 1e49101..587c60a 100644
+--- a/swift/manifests/storage/object.pp
++++ b/swift/manifests/storage/object.pp
+@@ -1,24 +1,51 @@
++# Class swift::storage::object
++#
++# == Parameters
++# [*enabled*]
++# (optional) Should the service be enabled.
++# Defaults to true
++#
++# [*manage_service*]
++# (optional) Whether the service should be managed by Puppet.
++# Defaults to true.
++#
++# [*package_ensure*]
++# (optional) Value of package resource parameter 'ensure'.
++# Defaults to 'present'.
++#
+ class swift::storage::object(
++ $manage_service = true,
++ $enabled = true,
+ $package_ensure = 'present'
+ ) {
+ swift::storage::generic { 'object':
++ manage_service => $manage_service,
++ enabled => $enabled,
+ package_ensure => $package_ensure
+ }
+
+ include swift::params
+
++ if $manage_service {
++ if $enabled {
++ $service_ensure = 'running'
++ } else {
++ $service_ensure = 'stopped'
++ }
++ }
++
+ service { 'swift-object-updater':
+- ensure => running,
++ ensure => $service_ensure,
+ name => $::swift::params::object_updater_service_name,
+- enable => true,
++ enable => $enabled,
+ provider => $::swift::params::service_provider,
+ require => Package['swift-object'],
+ }
+
+ service { 'swift-object-auditor':
+- ensure => running,
++ ensure => $service_ensure,
+ name => $::swift::params::object_auditor_service_name,
+- enable => true,
++ enable => $enabled,
+ provider => $::swift::params::service_provider,
+ require => Package['swift-object'],
+ }
+diff --git a/swift/spec/classes/swift_proxy_spec.rb b/swift/spec/classes/swift_proxy_spec.rb
+index a0b6f64..4dfe8b0 100644
+--- a/swift/spec/classes/swift_proxy_spec.rb
++++ b/swift/spec/classes/swift_proxy_spec.rb
+@@ -151,6 +151,80 @@ describe 'swift::proxy' do
+ end
+ end
+ end
++ end
++
++ shared_examples_for 'swift-proxy' do
++ let :params do
++ { :proxy_local_net_ip => '127.0.0.1' }
++ end
++
++ [{ :enabled => true, :manage_service => true },
++ { :enabled => false, :manage_service => true }].each do |param_hash|
++ context "when service should be #{param_hash[:enabled] ? 'enabled' : 'disabled'}" do
++ before do
++ params.merge!(param_hash)
++ end
++
++ it 'configures swift-proxy service' do
++ should contain_service('swift-proxy').with(
++ :ensure => (param_hash[:manage_service] && param_hash[:enabled]) ? 'running' : 'stopped',
++ :name => platform_params[:service_name],
++ :provider => platform_params[:service_provider],
++ :enable => param_hash[:enabled],
++ :hasstatus => true,
++ :subscribe => 'Concat[/etc/swift/proxy-server.conf]'
++ )
++ end
++ end
++ end
++
++ context 'with disabled service managing' do
++ before do
++ params.merge!({
++ :manage_service => false,
++ :enabled => false })
++ end
++
++ it 'configures swift-proxy service' do
++ should contain_service('swift-proxy').with(
++ :ensure => nil,
++ :name => platform_params[:service_name],
++ :provider => platform_params[:service_provider],
++ :enable => false,
++ :hasstatus => true,
++ :subscribe => 'Concat[/etc/swift/proxy-server.conf]'
++ )
++ end
++ end
++ end
++
++ context 'on Debian platforms' do
++ let :facts do
++ { :operatingsystem => 'Ubuntu',
++ :osfamily => 'Debian',
++ :concat_basedir => '/var/lib/puppet/concat' }
++ end
++
++ let :platform_params do
++ { :service_name => 'swift-proxy',
++ :service_provider => 'upstart' }
++ end
++
++ it_configures 'swift-proxy'
++ end
++
++ context 'on RedHat platforms' do
++ let :facts do
++ { :osfamily => 'RedHat',
++ :operatingsystem => 'RedHat',
++ :concat_basedir => '/var/lib/puppet/concat' }
++ end
++
++ let :platform_params do
++ { :service_name => 'openstack-swift-proxy',
++ :service_provider => nil }
++ end
+
++ it_configures 'swift-proxy'
+ end
+ end
+diff --git a/swift/spec/classes/swift_storage_account_spec.rb b/swift/spec/classes/swift_storage_account_spec.rb
+index 0623cc4..115fd6c 100644
+--- a/swift/spec/classes/swift_storage_account_spec.rb
++++ b/swift/spec/classes/swift_storage_account_spec.rb
+@@ -1,52 +1,106 @@
+ require 'spec_helper'
+-describe 'swift::storage::account' do
+-
+- let :facts do
+- {
+- :operatingsystem => 'Ubuntu',
+- :osfamily => 'Debian'
+- }
+- end
+
++describe 'swift::storage::account' do
+ let :pre_condition do
+ "class { 'ssh::server::install': }
+ class { 'swift': swift_hash_suffix => 'foo' }
+ class { 'swift::storage': storage_local_net_ip => '10.0.0.1' }"
+ end
+
+- let :default_params do
+- {:package_ensure => 'present'}
++ let :params do
++ { :package_ensure => 'present',
++ :enabled => true,
++ :manage_service => true }
+ end
+
+- [{},
+- {:package_ensure => 'latest'}
+- ].each do |param_set|
+- describe "when #{param_set == {} ? "using default" : "specifying"} class parameters" do
+- let :param_hash do
+- default_params.merge(param_set)
++ shared_examples_for 'swift-storage-account' do
++
++ [{},
++ {:package_ensure => 'latest'}
++ ].each do |param_set|
++ describe "when #{param_set == {} ? "using default" : "specifying"} class parameters" do
++ before do
++ params.merge!(param_set)
++ end
++
++ it { should contain_swift__storage__generic('account').with_package_ensure(params[:package_ensure]) }
++ end
++ end
++
++ [{ :enabled => true, :manage_service => true },
++ { :enabled => false, :manage_service => true }].each do |param_hash|
++ context "when service should be #{param_hash[:enabled] ? 'enabled' : 'disabled'}" do
++ before do
++ params.merge!(param_hash)
++ end
++
++ it 'configures services' do
++ platform_params[:service_names].each do |service_alias, service_name|
++ should contain_service(service_alias).with(
++ :name => service_name,
++ :ensure => (param_hash[:manage_service] && param_hash[:enabled]) ? 'running' : 'stopped',
++ :enable => param_hash[:enabled]
++ )
++ end
++ end
+ end
+- let :params do
+- param_set
++ end
++
++ context 'with disabled service managing' do
++ before do
++ params.merge!({
++ :manage_service => false,
++ :enabled => false })
++ end
++
++ it 'configures services' do
++ platform_params[:service_names].each do |service_alias, service_name|
++ should contain_service(service_alias).with(
++ :ensure => nil,
++ :name => service_name,
++ :enable => false
++ )
++ end
+ end
+- it { should contain_swift__storage__generic('account').with_package_ensure(param_hash[:package_ensure]) }
+ end
+ end
+- describe 'on rhel' do
++
++ context 'on Debian platforms' do
+ let :facts do
+- {
+- :operatingsystem => 'RedHat',
+- :osfamily => 'RedHat'
++ {:operatingsystem => 'Ubuntu',
++ :osfamily => 'Debian' }
++
++ end
++
++ let :platform_params do
++ { :service_names => {
++ 'swift-account' => 'swift-account',
++ 'swift-account-replicator' => 'swift-account-replicator',
++ 'swift-account-reaper' => 'swift-account-reaper',
++ 'swift-account-auditor' => 'swift-account-auditor'
++ }
+ }
+ end
+- it 'should have some support services' do
+- ['swift-account-reaper', 'swift-account-auditor'].each do |service|
+- should contain_service(service).with(
+- :name => "openstack-#{service}",
+- :ensure => 'running',
+- :enable => true,
+- :require => 'Package[swift-account]'
+- )
+- end
++
++ it_configures 'swift-storage-account'
++ end
++
++ context 'on RedHat platforms' do
++ let :facts do
++ { :osfamily => 'RedHat',
++ :operatingsystem => 'RedHat' }
++ end
++
++ let :platform_params do
++ { :service_names => {
++ 'swift-account' => 'openstack-swift-account',
++ 'swift-account-replicator' => 'openstack-swift-account-replicator',
++ 'swift-account-reaper' => 'openstack-swift-account-reaper',
++ 'swift-account-auditor' => 'openstack-swift-account-auditor'
++ }
++ }
+ end
++
++ it_configures 'swift-storage-account'
+ end
+ end
+diff --git a/swift/spec/classes/swift_storage_container_spec.rb b/swift/spec/classes/swift_storage_container_spec.rb
+index 38c80b9..8551b97 100644
+--- a/swift/spec/classes/swift_storage_container_spec.rb
++++ b/swift/spec/classes/swift_storage_container_spec.rb
+@@ -1,43 +1,91 @@
+ require 'spec_helper'
+-describe 'swift::storage::container' do
+-
+- let :facts do
+- {
+- :operatingsystem => 'Ubuntu',
+- :osfamily => 'Debian'
+- }
+- end
+
++describe 'swift::storage::container' do
+ let :pre_condition do
+ "class { 'ssh::server::install': }
+ class { 'swift': swift_hash_suffix => 'foo' }
+ class { 'swift::storage': storage_local_net_ip => '10.0.0.1' }"
+ end
+
+- let :default_params do
+- {:package_ensure => 'present'}
++ let :params do
++ { :package_ensure => 'present',
++ :enabled => true,
++ :manage_service => true }
+ end
+
+- [{},
+- {:package_ensure => 'latest'}
+- ].each do |param_set|
+- describe "when #{param_set == {} ? "using default" : "specifying"} class parameters" do
+- let :param_hash do
+- default_params.merge(param_set)
++ shared_examples_for 'swift-storage-container' do
++ [{},
++ {:package_ensure => 'latest'}
++ ].each do |param_set|
++ describe "when #{param_set == {} ? "using default" : "specifying"} class parameters" do
++ before do
++ params.merge!(param_set)
++ end
++
++ it { should contain_swift__storage__generic('container').with_package_ensure(params[:package_ensure]) }
+ end
+- let :params do
+- param_set
++ end
++
++
++ [{ :enabled => true, :manage_service => true },
++ { :enabled => false, :manage_service => true }].each do |param_hash|
++ context "when service should be #{param_hash[:enabled] ? 'enabled' : 'disabled'}" do
++ before do
++ params.merge!(param_hash)
++ end
++
++ it 'configures services' do
++ platform_params[:service_names].each do |service_alias, service_name|
++ should contain_service(service_alias).with(
++ :name => service_name,
++ :ensure => (param_hash[:manage_service] && param_hash[:enabled]) ? 'running' : 'stopped',
++ :enable => param_hash[:enabled]
++ )
++ end
++ end
+ end
+- it { should contain_swift__storage__generic('container').with_package_ensure(param_hash[:package_ensure]) }
+- it 'should have some other services' do
+- ['swift-container-updater', 'swift-container-auditor'].each do |service|
+- should contain_service(service).with(
+- :ensure => 'running',
+- :enable => true,
+- :provider => 'upstart',
+- :require => 'Package[swift-container]'
++ end
++
++ context 'with disabled service managing' do
++ before do
++ params.merge!({
++ :manage_service => false,
++ :enabled => false })
++ end
++
++ it 'configures services' do
++ platform_params[:service_names].each do |service_alias, service_name|
++ should contain_service(service_alias).with(
++ :ensure => nil,
++ :name => service_name,
++ :enable => false
+ )
+ end
++ end
++ end
++ end
++
++ context 'on Debian platforms' do
++ let :facts do
++ {:operatingsystem => 'Ubuntu',
++ :osfamily => 'Debian' }
++
++ end
++
++ let :platform_params do
++ { :service_names => {
++ 'swift-container' => 'swift-container',
++ 'swift-container-replicator' => 'swift-container-replicator',
++ 'swift-container-updater' => 'swift-container-updater',
++ 'swift-container-auditor' => 'swift-container-auditor'
++ }
++ }
++ end
++
++ it_configures 'swift-storage-container'
++
++ context 'Ubuntu specific resources' do
++ it 'configures sync' do
+ should contain_service('swift-container-sync').with(
+ :ensure => 'running',
+ :enable => true,
+@@ -56,26 +104,30 @@ describe 'swift::storage::container' do
+ end
+ end
+
+- describe 'on rhel' do
++ context 'on RedHat platforms' do
+ let :facts do
+- {
++ { :osfamily => 'RedHat',
+ :operatingsystem => 'RedHat',
+- :osfamily => 'RedHat',
+- :concat_basedir => '/var/lib/puppet/concat'
++ :concat_basedir => '/var/lib/puppet/concat' }
++ end
++
++ let :platform_params do
++ { :service_names => {
++ 'swift-container' => 'openstack-swift-container',
++ 'swift-container-replicator' => 'openstack-swift-container-replicator',
++ 'swift-container-updater' => 'openstack-swift-container-updater',
++ 'swift-container-auditor' => 'openstack-swift-container-auditor'
++ }
+ }
+ end
+- it 'should have some support services' do
+- ['swift-container-updater', 'swift-container-auditor'].each do |service|
+- should contain_service(service).with(
+- :name => "openstack-#{service}",
+- :ensure => 'running',
+- :enable => true,
+- :require => 'Package[swift-container]'
+- )
++
++ it_configures 'swift-storage-container'
++
++ context 'RedHat specific resources' do
++ before do
++ params.merge!({ :allowed_sync_hosts => ['127.0.0.1', '10.1.0.1', '10.1.0.2'] })
+ end
+- end
+
+- describe 'configuration file' do
+ let :pre_condition do
+ "class { 'ssh::server::install': }
+ class { 'swift': swift_hash_suffix => 'foo' }
+@@ -86,18 +138,9 @@ describe 'swift::storage::container' do
+ "/var/lib/puppet/concat/_etc_swift_container-server.conf/fragments/00_swift-container-6001"
+ end
+
+- it { should contain_file(fragment_file).with_content(/^allowed_sync_hosts = 127.0.0.1$/) }
+-
+- describe 'with allowed_sync_hosts' do
+-
+- let :params do
+- { :allowed_sync_hosts => ['127.0.0.1', '10.1.0.1', '10.1.0.2'], }
+- end
+-
+- it {
+- should contain_file(fragment_file).with_content(/^allowed_sync_hosts = 127.0.0.1,10.1.0.1,10.1.0.2$/)
+- }
+- end
++ it {
++ should contain_file(fragment_file).with_content(/^allowed_sync_hosts = 127.0.0.1,10.1.0.1,10.1.0.2$/)
++ }
+ end
+ end
+ end
+diff --git a/swift/spec/classes/swift_storage_object_spec.rb b/swift/spec/classes/swift_storage_object_spec.rb
+index 3309ea3..d98f948 100644
+--- a/swift/spec/classes/swift_storage_object_spec.rb
++++ b/swift/spec/classes/swift_storage_object_spec.rb
+@@ -1,12 +1,6 @@
+ require 'spec_helper'
+-describe 'swift::storage::object' do
+
+- let :facts do
+- {
+- :operatingsystem => 'Ubuntu',
+- :osfamily => 'Debian'
+- }
+- end
++describe 'swift::storage::object' do
+
+ let :pre_condition do
+ "class { 'ssh::server::install': }
+@@ -14,39 +8,100 @@ describe 'swift::storage::object' do
+ class { 'swift::storage': storage_local_net_ip => '10.0.0.1' }"
+ end
+
+- let :default_params do
+- {:package_ensure => 'present'}
++ let :params do
++ { :package_ensure => 'present',
++ :enabled => true,
++ :manage_service => true }
+ end
+
+- [{},
+- {:package_ensure => 'latest'}
+- ].each do |param_set|
+- describe "when #{param_set == {} ? "using default" : "specifying"} class parameters" do
+- let :param_hash do
+- default_params.merge(param_set)
++ shared_examples_for 'swift-storage-object' do
++
++ [{},
++ { :package_ensure => 'latest' }
++ ].each do |param_set|
++ describe "when #{param_set == {} ? "using default" : "specifying"} class parameters" do
++ before do
++ params.merge!(param_set)
++ end
++
++ it { should contain_swift__storage__generic('object').with_package_ensure(params[:package_ensure]) }
+ end
+- let :params do
+- param_set
++ end
++
++ [{ :enabled => true, :manage_service => true },
++ { :enabled => false, :manage_service => true }].each do |param_hash|
++ context "when service should be #{param_hash[:enabled] ? 'enabled' : 'disabled'}" do
++ before do
++ params.merge!(param_hash)
++ end
++
++ it 'configures services' do
++ platform_params[:service_names].each do |service_alias, service_name|
++ should contain_service(service_alias).with(
++ :name => service_name,
++ :ensure => (param_hash[:manage_service] && param_hash[:enabled]) ? 'running' : 'stopped',
++ :enable => param_hash[:enabled]
++ )
++ end
++ end
++ end
++ end
++
++ context 'with disabled service managing' do
++ before do
++ params.merge!({
++ :manage_service => false,
++ :enabled => false })
++ end
++
++ it 'configures services' do
++ platform_params[:service_names].each do |service_alias, service_name|
++ should contain_service(service_alias).with(
++ :ensure => nil,
++ :name => service_name,
++ :enable => false
++ )
++ end
+ end
+- it { should contain_swift__storage__generic('object').with_package_ensure(param_hash[:package_ensure]) }
+ end
+ end
+- describe 'on rhel' do
++
++ context 'on Debian platforms' do
+ let :facts do
+- {
+- :operatingsystem => 'RedHat',
+- :osfamily => 'RedHat'
++ {:operatingsystem => 'Ubuntu',
++ :osfamily => 'Debian' }
++
++ end
++
++ let :platform_params do
++ { :service_names => {
++ 'swift-object' => 'swift-object',
++ 'swift-object-replicator' => 'swift-object-replicator',
++ 'swift-object-updater' => 'swift-object-updater',
++ 'swift-object-auditor' => 'swift-object-auditor'
++ }
+ }
+ end
+- it 'should have some support services' do
+- ['swift-object-updater', 'swift-object-auditor'].each do |service|
+- should contain_service(service).with(
+- :name => "openstack-#{service}",
+- :ensure => 'running',
+- :enable => true,
+- :require => 'Package[swift-object]'
+- )
+- end
++
++ it_configures 'swift-storage-object'
++ end
++
++ context 'on RedHat platforms' do
++ let :facts do
++ { :osfamily => 'RedHat',
++ :operatingsystem => 'RedHat' }
++ end
++
++ let :platform_params do
++ { :service_names => {
++ 'swift-object' => 'openstack-swift-object',
++ 'swift-object-replicator' => 'openstack-swift-object-replicator',
++ 'swift-object-updater' => 'openstack-swift-object-updater',
++ 'swift-object-auditor' => 'openstack-swift-object-auditor'
++ }
++ }
+ end
++
++ it_configures 'swift-storage-object'
+ end
+ end
diff --git a/openstack-puppet-modules.spec b/openstack-puppet-modules.spec
index d9d344b..5f151c1 100644
--- a/openstack-puppet-modules.spec
+++ b/openstack-puppet-modules.spec
@@ -15,6 +15,8 @@ Patch0003: 0003-openstack-Set-default-charset-to-utf8.patch
Patch0004: 0004-heat-Implement-Keystone-domain-creation.patch
Patch0005: 0005-keystone-Add-manage_service-feature.patch
Patch0006: 0006-Fixed-firewalld-package-issue.patch
+Patch0007: 0007-Configure-OVS-mechanism-agent-configs-in-its-config-.patch
+Patch0008: 0008-Add-manage_service-feature.patch
BuildArch: noarch
Requires: rubygem-json
@@ -33,6 +35,8 @@ OpenStack via installers using Puppet configuration tool.
%patch0004 -p1
%patch0005 -p1
%patch0006 -p1
+%patch0007 -p1
+%patch0008 -p1
find %{_builddir}/%{name}-%{version}/ -type f -name ".*" -exec rm {} +
find %{_builddir}/%{name}-%{version}/ -size 0 -exec rm {} +
More information about the scm-commits
mailing list