diff options
author | Pradeep Kilambi <pkilambi@redhat.com> | 2017-05-12 08:30:15 -0400 |
---|---|---|
committer | Pradeep Kilambi <pkilambi@redhat.com> | 2017-05-30 17:55:11 -0400 |
commit | f5fdfd7b6063f8f02b91e86b99b5cf82335800d5 (patch) | |
tree | 92bd170de06aae8110157663f6a4bb6a79de595a | |
parent | 1d4afc04b479b7b376e00e217086ae96eb69a18b (diff) |
Add support for ignore_projects for ceilometer events
Set the default to services tenant. Without this, ceilometer
db gets hammered with gnocchi swift events. Keystone creds
are required so middleware can qwuery for id.
This support is added in https://review.openstack.org/#/c/464559/
Change-Id: I5c0f4f1a2c7fe7eb39ea6441970e9ac0946a4ec1
(cherry picked from commit 28cbb68958311c4bf153544e8439d3ae19c89740)
(cherry picked from commit 182d55d7129350c0f8eb7fd326132c0a76cb3493)
Notes
Notes (review):
Code-Review+2: Mykyta Karpin <mkarpin@mirantis.com>
Code-Review+2: Emilien Macchi <emilien@redhat.com>
Workflow+1: Emilien Macchi <emilien@redhat.com>
Verified+2: Jenkins
Submitted-by: Jenkins
Submitted-at: Wed, 07 Jun 2017 10:45:31 +0000
Reviewed-on: https://review.openstack.org/469243
Project: openstack/puppet-swift
Branch: refs/heads/stable/newton
-rw-r--r-- | manifests/proxy/ceilometer.pp | 45 | ||||
-rw-r--r-- | releasenotes/notes/add-ignore-projects-b1ab3629320a39ed.yaml | 3 | ||||
-rw-r--r-- | spec/classes/swift_proxy_ceilometer_spec.rb | 18 | ||||
-rw-r--r-- | templates/proxy/ceilometer.conf.erb | 27 |
4 files changed, 93 insertions, 0 deletions
diff --git a/manifests/proxy/ceilometer.pp b/manifests/proxy/ceilometer.pp index 029eb37..ee749d7 100644 --- a/manifests/proxy/ceilometer.pp +++ b/manifests/proxy/ceilometer.pp | |||
@@ -58,6 +58,42 @@ | |||
58 | # Whether to send events to messaging driver in a background thread | 58 | # Whether to send events to messaging driver in a background thread |
59 | # Defaults to false | 59 | # Defaults to false |
60 | # | 60 | # |
61 | # [*ignore_projects*] | ||
62 | # What projects to ignore to send events to ceilometer | ||
63 | # Defaults to ['services'] | ||
64 | # | ||
65 | # [*auth_uri*] | ||
66 | # (Optional) Complete public Identity API endpoint. | ||
67 | # Defaults to 'http://127.0.0.1:5000' | ||
68 | # | ||
69 | # [*auth_url*] | ||
70 | # (Optional) The URL to use for authentication. | ||
71 | # Defaults to 'http://127.0.0.1:35357' | ||
72 | # | ||
73 | # [*auth_type*] | ||
74 | # (Optional) The plugin for authentication | ||
75 | # Defaults to 'password' | ||
76 | # | ||
77 | # [*project_name*] | ||
78 | # (Optional) Service project name | ||
79 | # Defaults to 'services' | ||
80 | # | ||
81 | # [*project_domain_name*] | ||
82 | # (Optional) name of domain for $project_name | ||
83 | # Defaults to 'default' | ||
84 | # | ||
85 | # [*user_domain_name*] | ||
86 | # (Optional) name of domain for $username | ||
87 | # Defaults to 'default' | ||
88 | # | ||
89 | # [*username*] | ||
90 | # (Optional) The name of the service user | ||
91 | # Defaults to 'swift' | ||
92 | # | ||
93 | # [*password*] | ||
94 | # (Optional) The password for the user | ||
95 | # Defaults to 'password' | ||
96 | # | ||
61 | # == Examples | 97 | # == Examples |
62 | # | 98 | # |
63 | # == Authors | 99 | # == Authors |
@@ -81,6 +117,15 @@ class swift::proxy::ceilometer( | |||
81 | $ensure = 'present', | 117 | $ensure = 'present', |
82 | $group = 'ceilometer', | 118 | $group = 'ceilometer', |
83 | $nonblocking_notify = false, | 119 | $nonblocking_notify = false, |
120 | $ignore_projects = ['services'], | ||
121 | $auth_uri = 'http://127.0.0.1:5000', | ||
122 | $auth_url = 'http://127.0.0.1:35357', | ||
123 | $auth_type = 'password', | ||
124 | $project_domain_name = 'Default', | ||
125 | $user_domain_name = 'Default', | ||
126 | $project_name = 'services', | ||
127 | $username = 'swift', | ||
128 | $password = 'password', | ||
84 | ) inherits swift { | 129 | ) inherits swift { |
85 | 130 | ||
86 | include ::swift::deps | 131 | include ::swift::deps |
diff --git a/releasenotes/notes/add-ignore-projects-b1ab3629320a39ed.yaml b/releasenotes/notes/add-ignore-projects-b1ab3629320a39ed.yaml new file mode 100644 index 0000000..4feeb1a --- /dev/null +++ b/releasenotes/notes/add-ignore-projects-b1ab3629320a39ed.yaml | |||
@@ -0,0 +1,3 @@ | |||
1 | --- | ||
2 | fixes: | ||
3 | - Add ignore projects setting to filter:ceilometer in proxy server config. | ||
diff --git a/spec/classes/swift_proxy_ceilometer_spec.rb b/spec/classes/swift_proxy_ceilometer_spec.rb index 586fbd6..0c6e5ec 100644 --- a/spec/classes/swift_proxy_ceilometer_spec.rb +++ b/spec/classes/swift_proxy_ceilometer_spec.rb | |||
@@ -33,6 +33,15 @@ describe 'swift::proxy::ceilometer' do | |||
33 | :topic => 'notifications', | 33 | :topic => 'notifications', |
34 | :control_exchange => 'swift', | 34 | :control_exchange => 'swift', |
35 | :nonblocking_notify => true, | 35 | :nonblocking_notify => true, |
36 | :ignore_projects => 'services', | ||
37 | :auth_uri => 'http://127.0.0.1:5000', | ||
38 | :auth_url => 'http://127.0.0.1:35357', | ||
39 | :auth_type => 'password', | ||
40 | :project_domain_name => 'Default', | ||
41 | :user_domain_name => 'Default', | ||
42 | :project_name => 'services', | ||
43 | :username => 'swift', | ||
44 | :password => 'password', | ||
36 | } | 45 | } |
37 | end | 46 | end |
38 | 47 | ||
@@ -45,6 +54,15 @@ describe 'swift::proxy::ceilometer' do | |||
45 | it { is_expected.to contain_concat_fragment('swift_ceilometer').with_content(/topic = notifications/) } | 54 | it { is_expected.to contain_concat_fragment('swift_ceilometer').with_content(/topic = notifications/) } |
46 | it { is_expected.to contain_concat_fragment('swift_ceilometer').with_content(/control_exchange = swift/) } | 55 | it { is_expected.to contain_concat_fragment('swift_ceilometer').with_content(/control_exchange = swift/) } |
47 | it { is_expected.to contain_concat_fragment('swift_ceilometer').with_content(/nonblocking_notify = true/) } | 56 | it { is_expected.to contain_concat_fragment('swift_ceilometer').with_content(/nonblocking_notify = true/) } |
57 | it { is_expected.to contain_concat_fragment('swift_ceilometer').with_content(/ignore_projects = services/) } | ||
58 | it { is_expected.to contain_concat_fragment('swift_ceilometer').with_content(/auth_uri = http:\/\/127.0.0.1:5000/) } | ||
59 | it { is_expected.to contain_concat_fragment('swift_ceilometer').with_content(/auth_url = http:\/\/127.0.0.1:35357/) } | ||
60 | it { is_expected.to contain_concat_fragment('swift_ceilometer').with_content(/auth_type = password/) } | ||
61 | it { is_expected.to contain_concat_fragment('swift_ceilometer').with_content(/project_domain_name = Default/) } | ||
62 | it { is_expected.to contain_concat_fragment('swift_ceilometer').with_content(/user_domain_name = Default/) } | ||
63 | it { is_expected.to contain_concat_fragment('swift_ceilometer').with_content(/project_name = services/) } | ||
64 | it { is_expected.to contain_concat_fragment('swift_ceilometer').with_content(/username = swift/) } | ||
65 | it { is_expected.to contain_concat_fragment('swift_ceilometer').with_content(/password = password/) } | ||
48 | end | 66 | end |
49 | 67 | ||
50 | context 'with multiple rabbit hosts' do | 68 | context 'with multiple rabbit hosts' do |
diff --git a/templates/proxy/ceilometer.conf.erb b/templates/proxy/ceilometer.conf.erb index df6d7d2..9973485 100644 --- a/templates/proxy/ceilometer.conf.erb +++ b/templates/proxy/ceilometer.conf.erb | |||
@@ -19,3 +19,30 @@ control_exchange = <%= @control_exchange %> | |||
19 | <% if @nonblocking_notify %> | 19 | <% if @nonblocking_notify %> |
20 | nonblocking_notify = <%= @nonblocking_notify %> | 20 | nonblocking_notify = <%= @nonblocking_notify %> |
21 | <% end %> | 21 | <% end %> |
22 | <% if @ignore_projects %> | ||
23 | ignore_projects = <%= @ignore_projects %> | ||
24 | <% end %> | ||
25 | <% if @auth_uri %> | ||
26 | auth_uri = <%= @auth_uri %> | ||
27 | <% end %> | ||
28 | <% if @auth_url %> | ||
29 | auth_url = <%= @auth_url %> | ||
30 | <% end %> | ||
31 | <% if @auth_type %> | ||
32 | auth_type = <%= @auth_type %> | ||
33 | <% end %> | ||
34 | <% if @project_name %> | ||
35 | project_name = <%= @project_name %> | ||
36 | <% end %> | ||
37 | <% if @project_domain_name %> | ||
38 | project_domain_name = <%= @project_domain_name %> | ||
39 | <% end %> | ||
40 | <% if @user_domain_name %> | ||
41 | user_domain_name = <%= @user_domain_name %> | ||
42 | <% end %> | ||
43 | <% if @username %> | ||
44 | username = <%= @username %> | ||
45 | <% end %> | ||
46 | <% if @password %> | ||
47 | password = <%= @password %> | ||
48 | <% end %> | ||