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

Commit

Permalink
Merge pull request #343 from echocat/develop
Browse files Browse the repository at this point in the history
backmerge for 7.2.0
  • Loading branch information
dwerder authored Aug 1, 2017
2 parents 7f194ee + 4bf2457 commit fffe1ac
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 19 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Gemfile.lock

# idea
./idea
.idea/

# geppetto/eclipse
.project
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## 2017-08-01 - 7.2.0 (Feature release)

#### Features:

- Add a new parameter : `gr_base_dir_managed_externally`

#### Bugfixes:

- Updated python-pip to python2-pip for RedHat 7 variants
- 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)

## 2017-03-22 - 7.1.0 (Feature release)

#### Features:
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ gem 'puppetlabs_spec_helper', '>= 0.1.0', :require => false
gem 'puppet-lint', '>= 0.3.2', :require => false
gem 'rspec-puppet', '>= 2.3.2', :require => false
gem 'rspec-puppet-facts', :require => false
gem 'metadata-json-lint', :require => false
# rubi <1.9 versus rake 11.0.0 workaround
gem 'rake', '< 11.0.0', :require => false if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.0.0')
gem 'json', '< 2.0.0', :require => false if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.0.0')
gem 'json_pure', '<= 2.0.1', :require => false if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.0.0')
gem 'metadata-json-lint', '< 1.2.0', :require => false if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.0.0')

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

Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,10 @@ Default is 'GMT' (string). Timezone for graphite to be used.

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'.

#### `gr_base_dir_managed_externally`

Boolean, default to false . Useful if the base install location of Graphite is managed by other Puppet resource (like a mountpoint for example)

##### `gr_storage_dir`

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.
Expand Down Expand Up @@ -833,23 +837,23 @@ Example value:
}
}
```
#####`gr_relay_instances`
##### `gr_relay_instances`

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

Example: see gr_cache_instances

#####`gr_aggregator_instances`
##### `gr_aggregator_instances`

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

Example: see gr_cache_instances

#####`gr_whisper_autoflush`
##### `gr_whisper_autoflush`

Default is 'False'. Set autoflush for whisper

#####`gr_whisper_lock_writes`
##### `gr_whisper_lock_writes`

Default is false. Set lock writes for whisper

Expand Down
16 changes: 9 additions & 7 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,15 @@
subscribe => Class['graphite::install'],
}

# change access permissions for web server
file { $::graphite::base_dir_REAL:
ensure => directory,
group => $gr_web_group_REAL,
mode => '0755',
owner => $gr_web_user_REAL,
seltype => 'httpd_sys_rw_content_t',
if !$::graphite::gr_base_dir_managed_externally {
# change access permissions for web server
file { $::graphite::base_dir_REAL:
ensure => directory,
group => $gr_web_group_REAL,
mode => '0755',
owner => $gr_web_user_REAL,
seltype => 'httpd_sys_rw_content_t',
}
}

file { [
Expand Down
10 changes: 6 additions & 4 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,7 @@
,
$gr_use_remote_user_auth = 'False',
$gr_remote_user_header_name = undef,
$gr_base_dir_managed_externally = false,
$gr_base_dir = '/opt/graphite',
$gr_storage_dir = undef,
$gr_local_data_dir = undef,
Expand Down Expand Up @@ -782,6 +783,7 @@
validate_bool($gr_pip_install)
validate_bool($gr_manage_python_packages)
validate_bool($gr_disable_webapp_cache)
validate_bool($gr_base_dir_managed_externally)

if $gr_apache_port or $gr_apache_port_https {
fail('$gr_apache_port and $gr_apache_port_https are deprecated in favour of $gr_web_server_port and $gr_web_server_port_https')
Expand Down Expand Up @@ -809,10 +811,10 @@
# implementation classes through a transitive relationship to
# the composite class.
# https://projects.puppetlabs.com/projects/puppet/wiki/Anchor_Pattern
Anchor['graphite::begin'] ->
Class['graphite::install'] ~>
Class['graphite::config'] ->
Anchor['graphite::end']
Anchor['graphite::begin']
-> Class['graphite::install']
~> Class['graphite::config']
-> Anchor['graphite::end']

anchor { 'graphite::begin': }
include graphite::install
Expand Down
8 changes: 7 additions & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,13 @@
$pyopenssl = 'pyOpenSSL'
$apache_wsgi_pkg = 'mod_wsgi'
$pytz = 'python-tzlocal'
$python_pip_pkg = 'python-pip'
$python_pip_pkg = $::osfamily ? {
'RedHat' => $::operatingsystemrelease ? {
/^7/ => 'python2-pip',
default => 'python-pip'
},
default => 'python-pip',
}
}

$python_dev_pkg = ["${python}-devel", 'gcc']
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dwerder-graphite",
"version": "7.1.0",
"version": "7.2.0",
"source": "https://github.com/echocat/puppet-graphite.git",
"author": "Daniel Werdermann",
"license": "Apache-2.0",
Expand Down
4 changes: 3 additions & 1 deletion spec/classes/graphite_install_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
end

shared_context 'RedHat 7 platforms' do
it { is_expected.to contain_package('python2-pip').with_provider(nil) }
it { is_expected.to contain_package('python-cairocffi').with_provider(nil) }
it { is_expected.to contain_package('Django').with_provider('pip') }
it { is_expected.to contain_package('python-sqlite3dbm').with_provider(nil) }
Expand Down Expand Up @@ -128,11 +129,12 @@
it_behaves_like 'no django'
end
when 'RedHat' then
it_behaves_like 'supported platforms'
#it_behaves_like 'supported platforms'
it_behaves_like 'RedHat supported platforms'

case facts[:operatingsystemrelease]
when /^6/ then
it_behaves_like 'supported platforms'
it_behaves_like 'RedHat 6 platforms'
when /^7/ then
it_behaves_like 'RedHat 7 platforms'
Expand Down
3 changes: 3 additions & 0 deletions templates/etc/init.d/Debian/carbon-cache.erb
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,15 @@ case "${OPERATION}" in
done
;;
status)
rc=0
for INSTANCE in ${INSTANCES}; do
if [ "${INSTANCE}" = "${CARBON_DAEMON}" ]; then
INSTANCE="a";
fi;
${PYTHON_CMD} ${GRAPHITE_DIR}/bin/carbon-${CARBON_DAEMON}.py --instance=${INSTANCE} status
let rc=${rc}+$?
done
exit ${rc}
;;
restart)
$0 stop ${INSTANCES} && sleep 2 && $0 start ${INSTANCES}
Expand Down
4 changes: 4 additions & 0 deletions templates/opt/graphite/conf/carbon.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
#
LOCAL_DATA_DIR = <%= scope.lookupvar('graphite::local_data_dir_REAL') %>/

<% unless [:undef, nil].include? scope.lookupvar('graphite::gr_storage_dir') -%>
PID_DIR = <%= scope.lookupvar('graphite::gr_storage_dir') %>
<% end -%>

# Enable daily log rotation. If disabled, a kill -HUP can be used after a manual rotate
ENABLE_LOGROTATION = True

Expand Down

0 comments on commit fffe1ac

Please sign in to comment.