Skip to content
This repository was archived by the owner on Mar 8, 2023. It is now read-only.

Commit fffe1ac

Browse files
authored
Merge pull request #343 from echocat/develop
backmerge for 7.2.0
2 parents 7f194ee + 4bf2457 commit fffe1ac

File tree

11 files changed

+54
-19
lines changed

11 files changed

+54
-19
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ Gemfile.lock
4242

4343
# idea
4444
./idea
45+
.idea/
4546

4647
# geppetto/eclipse
4748
.project

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
## 2017-08-01 - 7.2.0 (Feature release)
2+
3+
#### Features:
4+
5+
- Add a new parameter : `gr_base_dir_managed_externally`
6+
7+
#### Bugfixes:
8+
9+
- Updated python-pip to python2-pip for RedHat 7 variants
10+
- If there are multiple cache instances, and any but the last crash, this returns 0 and puppet will not try to restart the service(s)
11+
112
## 2017-03-22 - 7.1.0 (Feature release)
213

314
#### Features:

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ gem 'puppetlabs_spec_helper', '>= 0.1.0', :require => false
1414
gem 'puppet-lint', '>= 0.3.2', :require => false
1515
gem 'rspec-puppet', '>= 2.3.2', :require => false
1616
gem 'rspec-puppet-facts', :require => false
17-
gem 'metadata-json-lint', :require => false
1817
# rubi <1.9 versus rake 11.0.0 workaround
1918
gem 'rake', '< 11.0.0', :require => false if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.0.0')
2019
gem 'json', '< 2.0.0', :require => false if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.0.0')
2120
gem 'json_pure', '<= 2.0.1', :require => false if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.0.0')
21+
gem 'metadata-json-lint', '< 1.2.0', :require => false if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.0.0')
2222

2323
gem 'puppet', *location_for(ENV['PUPPET_GEM_VERSION'])
2424

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,10 @@ Default is 'GMT' (string). Timezone for graphite to be used.
385385

386386
Default is '/opt/graphite'. Set base install location of Graphite. This forms the base location for installs, predominantly appropriate for pip installations. When not installing using pip a typical location for this may be '/opt/carbon'.
387387

388+
#### `gr_base_dir_managed_externally`
389+
390+
Boolean, default to false . Useful if the base install location of Graphite is managed by other Puppet resource (like a mountpoint for example)
391+
388392
##### `gr_storage_dir`
389393

390394
Default is '${gr_base_dir}/storage'. Set location of base storage files. When not installing using pip a typical location for this may be '/opt/carbon'. This dir is also used as pid dir on RedHat.
@@ -833,23 +837,23 @@ Example value:
833837
}
834838
}
835839
```
836-
#####`gr_relay_instances`
840+
##### `gr_relay_instances`
837841

838842
Default is empty array. Allow multiple additional relay instances. (beside the default one)
839843

840844
Example: see gr_cache_instances
841845

842-
#####`gr_aggregator_instances`
846+
##### `gr_aggregator_instances`
843847

844848
Default is empty array. Allow multiple additional aggregator instances. (beside the default one)
845849

846850
Example: see gr_cache_instances
847851

848-
#####`gr_whisper_autoflush`
852+
##### `gr_whisper_autoflush`
849853

850854
Default is 'False'. Set autoflush for whisper
851855

852-
#####`gr_whisper_lock_writes`
856+
##### `gr_whisper_lock_writes`
853857

854858
Default is false. Set lock writes for whisper
855859

manifests/config.pp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,15 @@
105105
subscribe => Class['graphite::install'],
106106
}
107107

108-
# change access permissions for web server
109-
file { $::graphite::base_dir_REAL:
110-
ensure => directory,
111-
group => $gr_web_group_REAL,
112-
mode => '0755',
113-
owner => $gr_web_user_REAL,
114-
seltype => 'httpd_sys_rw_content_t',
108+
if !$::graphite::gr_base_dir_managed_externally {
109+
# change access permissions for web server
110+
file { $::graphite::base_dir_REAL:
111+
ensure => directory,
112+
group => $gr_web_group_REAL,
113+
mode => '0755',
114+
owner => $gr_web_user_REAL,
115+
seltype => 'httpd_sys_rw_content_t',
116+
}
115117
}
116118

117119
file { [

manifests/init.pp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,7 @@
702702
,
703703
$gr_use_remote_user_auth = 'False',
704704
$gr_remote_user_header_name = undef,
705+
$gr_base_dir_managed_externally = false,
705706
$gr_base_dir = '/opt/graphite',
706707
$gr_storage_dir = undef,
707708
$gr_local_data_dir = undef,
@@ -782,6 +783,7 @@
782783
validate_bool($gr_pip_install)
783784
validate_bool($gr_manage_python_packages)
784785
validate_bool($gr_disable_webapp_cache)
786+
validate_bool($gr_base_dir_managed_externally)
785787

786788
if $gr_apache_port or $gr_apache_port_https {
787789
fail('$gr_apache_port and $gr_apache_port_https are deprecated in favour of $gr_web_server_port and $gr_web_server_port_https')
@@ -809,10 +811,10 @@
809811
# implementation classes through a transitive relationship to
810812
# the composite class.
811813
# https://projects.puppetlabs.com/projects/puppet/wiki/Anchor_Pattern
812-
Anchor['graphite::begin'] ->
813-
Class['graphite::install'] ~>
814-
Class['graphite::config'] ->
815-
Anchor['graphite::end']
814+
Anchor['graphite::begin']
815+
-> Class['graphite::install']
816+
~> Class['graphite::config']
817+
-> Anchor['graphite::end']
816818

817819
anchor { 'graphite::begin': }
818820
include graphite::install

manifests/params.pp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,13 @@
147147
$pyopenssl = 'pyOpenSSL'
148148
$apache_wsgi_pkg = 'mod_wsgi'
149149
$pytz = 'python-tzlocal'
150-
$python_pip_pkg = 'python-pip'
150+
$python_pip_pkg = $::osfamily ? {
151+
'RedHat' => $::operatingsystemrelease ? {
152+
/^7/ => 'python2-pip',
153+
default => 'python-pip'
154+
},
155+
default => 'python-pip',
156+
}
151157
}
152158

153159
$python_dev_pkg = ["${python}-devel", 'gcc']

metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dwerder-graphite",
3-
"version": "7.1.0",
3+
"version": "7.2.0",
44
"source": "https://github.com/echocat/puppet-graphite.git",
55
"author": "Daniel Werdermann",
66
"license": "Apache-2.0",

spec/classes/graphite_install_spec.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
end
7575

7676
shared_context 'RedHat 7 platforms' do
77+
it { is_expected.to contain_package('python2-pip').with_provider(nil) }
7778
it { is_expected.to contain_package('python-cairocffi').with_provider(nil) }
7879
it { is_expected.to contain_package('Django').with_provider('pip') }
7980
it { is_expected.to contain_package('python-sqlite3dbm').with_provider(nil) }
@@ -128,11 +129,12 @@
128129
it_behaves_like 'no django'
129130
end
130131
when 'RedHat' then
131-
it_behaves_like 'supported platforms'
132+
#it_behaves_like 'supported platforms'
132133
it_behaves_like 'RedHat supported platforms'
133134

134135
case facts[:operatingsystemrelease]
135136
when /^6/ then
137+
it_behaves_like 'supported platforms'
136138
it_behaves_like 'RedHat 6 platforms'
137139
when /^7/ then
138140
it_behaves_like 'RedHat 7 platforms'

templates/etc/init.d/Debian/carbon-cache.erb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,15 @@ case "${OPERATION}" in
5555
done
5656
;;
5757
status)
58+
rc=0
5859
for INSTANCE in ${INSTANCES}; do
5960
if [ "${INSTANCE}" = "${CARBON_DAEMON}" ]; then
6061
INSTANCE="a";
6162
fi;
6263
${PYTHON_CMD} ${GRAPHITE_DIR}/bin/carbon-${CARBON_DAEMON}.py --instance=${INSTANCE} status
64+
let rc=${rc}+$?
6365
done
66+
exit ${rc}
6467
;;
6568
restart)
6669
$0 stop ${INSTANCES} && sleep 2 && $0 start ${INSTANCES}

0 commit comments

Comments
 (0)