29 changes: 17 additions & 12 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
This module has grown over time based on a range of contributions from
people using it. If you follow these contributing guidelines your patch
will likely make it into a release a little quicker.
will likely make it into a release a little more quickly.

## Contributing

Expand Down Expand Up @@ -65,6 +65,10 @@ add tests if you're adding new functionality. If you've not used
[rspec-puppet](http://rspec-puppet.com/) before then feel free to ask
about how best to test your new feature.

To run the linter, the syntax checker and the unit tests:

bundle exec rake test

To run your all the unit tests

bundle exec rake spec SPEC_OPTS='--format documentation'
Expand All @@ -73,10 +77,6 @@ To run a specific spec test set the `SPEC` variable:

bundle exec rake spec SPEC=spec/foo_spec.rb

To run the linter, the syntax checker and the unit tests:

bundle exec rake test

## Integration tests

The unit tests just check the code runs, not that it does exactly what
Expand All @@ -89,15 +89,20 @@ with:

bundle exec rake acceptance

This will run the tests on an Ubuntu 12.04 virtual machine. You can also
run the integration tests against Centos 6.6 with.
This will run the tests on the module's default nodeset. You can override the
nodeset used, e.g.,

BEAKER_set=centos-7-x64 bundle exec rake acceptance

There are default rake tasks for the various acceptance test modules, e.g.,

BEAKER_set=centos-66-x64 bundle exec rake acceptances
bundle exec rake beaker:centos-7-x64
bundle exec rake beaker:ssh:centos-7-x64

If you don't want to have to recreate the virtual machine every time you
can use `BEAKER_DESTROY=no` and `BEAKER_PROVISION=no`. On the first run you will
at least need `BEAKER_PROVISION` set to yes (the default). The Vagrantfile
for the created virtual machines will be in `.vagrant/beaker_vagrant_fies`.
If you don't want to have to recreate the virtual machine every time you can
use `BEAKER_destroy=no` and `BEAKER_provision=no`. On the first run you will at
least need `BEAKER_provision` set to yes (the default). The Vagrantfile for the
created virtual machines will be in `.vagrant/beaker_vagrant_files`.

The easiest way to debug in a docker container is to open a shell:

Expand Down
2 changes: 1 addition & 1 deletion .msync.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
modulesync_config_version: '1.1.0'
modulesync_config_version: '1.5.0'
13 changes: 13 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ AllCops:
- Gemfile
- Rakefile
- Guardfile
- Vagrantfile
Lint/ConditionPosition:
Enabled: True

Expand Down Expand Up @@ -45,6 +46,9 @@ Style/HashSyntax:
Style/RedundantReturn:
Enabled: True

Style/EndOfLine:
Enabled: False

Lint/AmbiguousOperator:
Enabled: True

Expand Down Expand Up @@ -530,3 +534,12 @@ Layout/IndentHeredoc:
# disable Yaml safe_load. This is needed to support ruby2.0.0 development envs
Security/YAMLLoad:
Enabled: false

# This affects hiera interpolation, as well as some configs that we push.
Style/FormatStringToken:
Enabled: false

# This is useful, but sometimes a little too picky about where unit tests files
# are located.
RSpec/FilePath:
Enabled: false
33 changes: 19 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,36 +15,41 @@ script:
matrix:
fast_finish: true
include:
- rvm: 2.4.1
bundler_args: --without development
- rvm: 2.4.2
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=docker/ubuntu-14.04 CHECK=beaker
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=docker/ubuntu-16.04 CHECK=beaker
services: docker
sudo: required
- rvm: 2.4.1
bundler_args: --without development
- rvm: 2.4.2
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=docker/centos-7 CHECK=beaker
services: docker
sudo: required
- rvm: 2.1.9
bundler_args: --without system_tests development
env: PUPPET_VERSION="~> 4.0" CHECK=test
- rvm: 2.4.1
bundler_args: --without system_tests development
env: PUPPET_VERSION="~> 5.0" CHECK=test
- rvm: 2.4.1
bundler_args: --without system_tests development
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 4.0" CHECK=test PARALLEL_TEST_PROCESSORS=16
- rvm: 2.4.2
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=test_with_coveralls
- rvm: 2.4.2
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=rubocop
- rvm: 2.4.1
bundler_args: --without system_tests development
- rvm: 2.4.2
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=build DEPLOY_TO_FORGE=yes
branches:
only:
- master
- /^v\d/
notifications:
email: false
irc:
on_success: always
on_failure: always
channels:
- "chat.freenode.org#voxpupuli-notifications"
deploy:
provider: puppetforge
user: puppet
Expand Down
44 changes: 32 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,23 @@ All notable changes to this project will be documented in this file.
Each new release typically also includes the latest modulesync defaults.
These should not affect the functionality of the module.

## [v4.0.3](https://github.com/voxpupuli/puppet-grafana/tree/v4.0.3) (2017-12-09)

[Full Changelog](https://github.com/voxpupuli/puppet-grafana/compare/v4.0.2...v4.0.3)

**Closed issues:**

- Apt key add gets called every run [\#77](https://github.com/voxpupuli/puppet-grafana/issues/77)
- Getting rid or changing the url check for grafana datasource url's [\#75](https://github.com/voxpupuli/puppet-grafana/issues/75)

**Merged pull requests:**

- Update readme with examples of using datasource and dashboard [\#80](https://github.com/voxpupuli/puppet-grafana/pull/80) ([devcfgc](https://github.com/devcfgc))
- Removing the datasource url check as it leads to errors with postgres… [\#76](https://github.com/voxpupuli/puppet-grafana/pull/76) ([Faffnir](https://github.com/Faffnir))
- Release 4.0.2 [\#74](https://github.com/voxpupuli/puppet-grafana/pull/74) ([dhollinger](https://github.com/dhollinger))

## [v4.0.2](https://github.com/voxpupuli/puppet-grafana/tree/v4.0.2) (2017-10-12)

[Full Changelog](https://github.com/voxpupuli/puppet-grafana/compare/v4.0.1...v4.0.2)

**Implemented enhancements:**
Expand All @@ -15,8 +31,10 @@ These should not affect the functionality of the module.
**Merged pull requests:**

- fix typo in metadata \(redhat 6 twice vs 6/7\) [\#69](https://github.com/voxpupuli/puppet-grafana/pull/69) ([wyardley](https://github.com/wyardley))
- Release 4.0.1 [\#68](https://github.com/voxpupuli/puppet-grafana/pull/68) ([wyardley](https://github.com/wyardley))

## [v4.0.1](https://github.com/voxpupuli/puppet-grafana/tree/v4.0.1) (2017-09-22)

[Full Changelog](https://github.com/voxpupuli/puppet-grafana/compare/v4.0.0...v4.0.1)

**Fixed bugs:**
Expand All @@ -25,16 +43,20 @@ These should not affect the functionality of the module.

**Merged pull requests:**

- Release 4.0.1 [\#68](https://github.com/voxpupuli/puppet-grafana/pull/68) ([wyardley](https://github.com/wyardley))
- Release 4.0.0 [\#62](https://github.com/voxpupuli/puppet-grafana/pull/62) ([bastelfreak](https://github.com/bastelfreak))

## [v4.0.0](https://github.com/voxpupuli/puppet-grafana/tree/v4.0.0) (2017-09-20)

[Full Changelog](https://github.com/voxpupuli/puppet-grafana/compare/v3.0.0...v4.0.0)

**Implemented enhancements:**
**Breaking changes:**

- BREAKING: Switch to Puppet Data Types \(ldap\_cfg is now undef when disabled\) [\#66](https://github.com/voxpupuli/puppet-grafana/pull/66) ([wyardley](https://github.com/wyardley))
- BREAKING: Create grafana\_plugin resource type and change grafana::plugins [\#63](https://github.com/voxpupuli/puppet-grafana/pull/63) ([wyardley](https://github.com/wyardley))
- BREAKING: Update default Grafana version to 4.5.1 and improve acceptance tests [\#61](https://github.com/voxpupuli/puppet-grafana/pull/61) ([wyardley](https://github.com/wyardley))

**Implemented enhancements:**

- grafana\_user custom resource [\#60](https://github.com/voxpupuli/puppet-grafana/pull/60) ([atward](https://github.com/atward))
- Support newer versions of puppetlabs/apt module [\#53](https://github.com/voxpupuli/puppet-grafana/pull/53) ([ghoneycutt](https://github.com/ghoneycutt))
- Support custom plugins [\#44](https://github.com/voxpupuli/puppet-grafana/pull/44) ([bastelfreak](https://github.com/bastelfreak))
Expand All @@ -56,19 +78,16 @@ These should not affect the functionality of the module.
- Update README.md [\#67](https://github.com/voxpupuli/puppet-grafana/pull/67) ([wyardley](https://github.com/wyardley))
- Get rid of the dependency on 'wget' module in favor of puppet-archive [\#65](https://github.com/voxpupuli/puppet-grafana/pull/65) ([wyardley](https://github.com/wyardley))
- Remove licenses from the top of files [\#64](https://github.com/voxpupuli/puppet-grafana/pull/64) ([wyardley](https://github.com/wyardley))
- Release 4.0.0 [\#62](https://github.com/voxpupuli/puppet-grafana/pull/62) ([bastelfreak](https://github.com/bastelfreak))
- Always use jessie apt repo when osfamily is Debian. [\#41](https://github.com/voxpupuli/puppet-grafana/pull/41) ([furhouse](https://github.com/furhouse))
- Bump version, Update changelog [\#38](https://github.com/voxpupuli/puppet-grafana/pull/38) ([dhoppe](https://github.com/dhoppe))

## [v3.0.0](https://github.com/voxpupuli/puppet-grafana/tree/v3.0.0) (2017-03-29)
[Full Changelog](https://github.com/voxpupuli/puppet-grafana/compare/v2.6.3...v3.0.0)

**Implemented enhancements:**

- implement package\_ensure param for archlinux [\#34](https://github.com/voxpupuli/puppet-grafana/pull/34) ([bastelfreak](https://github.com/bastelfreak))
[Full Changelog](https://github.com/voxpupuli/puppet-grafana/compare/v2.6.3...v3.0.0)

**Fixed bugs:**

- implement package\\_ensure param for archlinux [\#34](https://github.com/voxpupuli/puppet-grafana/pull/34) ([bastelfreak](https://github.com/bastelfreak))
- implement package\_ensure param for archlinux [\#34](https://github.com/voxpupuli/puppet-grafana/pull/34) ([bastelfreak](https://github.com/bastelfreak))
- FIX configuration file ownership [\#30](https://github.com/voxpupuli/puppet-grafana/pull/30) ([cassianoleal](https://github.com/cassianoleal))

**Closed issues:**
Expand All @@ -78,7 +97,6 @@ These should not affect the functionality of the module.

**Merged pull requests:**

- Bump version, Update changelog [\#38](https://github.com/voxpupuli/puppet-grafana/pull/38) ([dhoppe](https://github.com/dhoppe))
- Debian and RedHat based operating systems should use the repository by default [\#36](https://github.com/voxpupuli/puppet-grafana/pull/36) ([dhoppe](https://github.com/dhoppe))
- Add support for archlinux [\#32](https://github.com/voxpupuli/puppet-grafana/pull/32) ([bastelfreak](https://github.com/bastelfreak))
- Fix grafana\_dashboards [\#31](https://github.com/voxpupuli/puppet-grafana/pull/31) ([cassianoleal](https://github.com/cassianoleal))
Expand All @@ -87,15 +105,17 @@ These should not affect the functionality of the module.
- The puppet 4-only release will start at 3.0.0 [\#21](https://github.com/voxpupuli/puppet-grafana/pull/21) ([rnelson0](https://github.com/rnelson0))

## [v2.6.3](https://github.com/voxpupuli/puppet-grafana/tree/v2.6.3) (2017-01-18)
[Full Changelog](https://github.com/voxpupuli/puppet-grafana/compare/v2.6.2...v2.6.3)

## [v2.6.2](https://github.com/voxpupuli/puppet-grafana/tree/v2.6.2) (2017-01-18)
[Full Changelog](https://github.com/voxpupuli/puppet-grafana/compare/v2.6.1...v2.6.2)
[Full Changelog](https://github.com/voxpupuli/puppet-grafana/compare/v2.6.2...v2.6.3)

**Merged pull requests:**

- release 2.6.2 \(optimistic, i know ;\) [\#20](https://github.com/voxpupuli/puppet-grafana/pull/20) ([igalic](https://github.com/igalic))

## [v2.6.2](https://github.com/voxpupuli/puppet-grafana/tree/v2.6.2) (2017-01-18)

[Full Changelog](https://github.com/voxpupuli/puppet-grafana/compare/v2.6.1...v2.6.2)

## v2.6.1 (2017-01-18)

Just a notice: The next release will be a major one without Puppet 3 support!
Expand Down
17 changes: 11 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def location_for(place, fake_version = nil)
end

group :test do
gem 'puppetlabs_spec_helper', '~> 2.2.0', :require => false
gem 'puppetlabs_spec_helper', '~> 2.5.0', :require => false
gem 'rspec-puppet', '~> 2.5', :require => false
gem 'rspec-puppet-facts', :require => false
gem 'rspec-puppet-utils', :require => false
Expand All @@ -22,18 +22,13 @@ group :test do
gem 'puppet-lint-unquoted_string-check', :require => false
gem 'puppet-lint-variable_contains_upcase', :require => false
gem 'metadata-json-lint', :require => false
gem 'puppet-blacksmith', :require => false
gem 'voxpupuli-release', :require => false, :git => 'https://github.com/voxpupuli/voxpupuli-release-gem'
gem 'puppet-strings', '~> 1.0', :require => false
gem 'redcarpet', :require => false
gem 'rubocop', '~> 0.49.1', :require => false if RUBY_VERSION >= '2.3.0'
gem 'rubocop-rspec', '~> 1.15.0', :require => false if RUBY_VERSION >= '2.3.0'
gem 'mocha', '>= 1.2.1', :require => false
gem 'coveralls', :require => false
gem 'simplecov-console', :require => false
gem 'github_changelog_generator', '~> 1.13.0', :require => false if RUBY_VERSION < '2.2.2'
gem 'rack', '~> 1.0', :require => false if RUBY_VERSION < '2.2.2'
gem 'github_changelog_generator', :require => false if RUBY_VERSION >= '2.2.2'
gem 'parallel_tests', :require => false
gem 'toml', :require => false
end
Expand All @@ -46,8 +41,11 @@ group :development do
end

group :system_tests do
gem 'winrm', :require => false
if beaker_version = ENV['BEAKER_VERSION']
gem 'beaker', *location_for(beaker_version)
else
gem 'beaker', '>= 3.9.0', :require => false
end
if beaker_rspec_version = ENV['BEAKER_RSPEC_VERSION']
gem 'beaker-rspec', *location_for(beaker_rspec_version)
Expand All @@ -59,6 +57,13 @@ group :system_tests do
gem 'beaker-module_install_helper', :require => false
end

group :release do
gem 'github_changelog_generator', :require => false if RUBY_VERSION >= '2.2.2'
gem 'puppet-blacksmith', :require => false
gem 'voxpupuli-release', :require => false, :git => 'https://github.com/voxpupuli/voxpupuli-release-gem'
gem 'puppet-strings', '~> 1.0', :require => false
end



if facterversion = ENV['FACTER_GEM_VERSION']
Expand Down
45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,25 @@ grafana_dashboard { 'example_dashboard':
`grafana_user` and `grafana_password` are optional, and required when
authentication is enabled in Grafana.

Example:
Make sure the `grafana-server` service is up and running before creating the `grafana_dashboard` definition. One option is to use the `http_conn_validator` from the [healthcheck](https://forge.puppet.com/puppet/healthcheck) module

```puppet
http_conn_validator { 'grafana-conn-validator' :
host => 'localhost',
port => '3000',
use_ssl => false,
test_url => '/public/img/grafana_icon.svg',
require => Class['grafana'],
}
-> grafana_dashboard { 'example_dashboard':
grafana_url => 'http://localhost:3000',
grafana_user => 'admin',
grafana_password => '5ecretPassw0rd',
content => template('path/to/exported/file.json'),
}
```

##### `grafana_datasource`

In order to use the datasource resource, add the following to your manifest:
Expand Down Expand Up @@ -385,6 +404,32 @@ from the browser, or `proxy` to send requests via grafana.
Authentication is optional, as is `database`; additional `json_data` can be
provided to allow custom configuration options.

Example:
Make sure the `grafana-server` service is up and running before creating the `grafana_datasource` definition. One option is to use the `http_conn_validator` from the [healthcheck](https://forge.puppet.com/puppet/healthcheck) module

```puppet
http_conn_validator { 'grafana-conn-validator' :
host => 'localhost',
port => '3000',
use_ssl => false,
test_url => '/public/img/grafana_icon.svg',
require => Class['grafana'],
}
-> grafana_datasource { 'influxdb':
grafana_url => 'http://localhost:3000',
grafana_user => 'admin',
grafana_password => '5ecretPassw0rd',
type => 'influxdb',
url => 'http://localhost:8086',
user => 'admin',
password => '1nFlux5ecret',
database => 'graphite',
access_mode => 'proxy',
is_default => true,
json_data => template('path/to/additional/config.json'),
}
```

##### `grafana_plugin`

An example is provided for convenience; for more details, please view the
Expand Down
Loading