19 changes: 17 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,24 @@ you must set an environment variable such as:

export PUPPET_VERSION="~> 4.2.0"

Install the dependencies like so...
You can install all needed gems for spec tests into the modules directory by
running:

bundle install
```sh
bundle install --path .vendor/ --without development --without system_tests --without release
```

If you also want to run acceptance tests:

```sh
bundle install --path .vendor/ --without development --with system_tests --without release
```

Our all in one solution if you don't know if you need to install or update gems:

```sh
bundle install --path .vendor/ --without development --with system_tests --without release; bundle update; bundle clean
```

## Syntax and style

Expand Down
12 changes: 12 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,15 @@ Thank you for contributing to this project!
- Our vulnerabilities reporting process is at https://voxpupuli.org/security/
-->
#### Pull Request (PR) description
<!--
Replace this comment with a description of your pull request.
-->

#### This Pull Request (PR) fixes the following issues
<!--
Replace this comment with the list of issues or n/a.
Use format:
Fixes #123
Fixes #124
-->
2 changes: 1 addition & 1 deletion .msync.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
modulesync_config_version: '1.8.0'
modulesync_config_version: '1.9.2'
4 changes: 2 additions & 2 deletions .sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
.travis.yml:
secure: "C+dXd27/doW1JnKqv+UDHL6/HBI5Te+xGsaoPkqhpO4iXfMxJrTi6sBWaEuyNTeHIwN8wOWHaW9qKEqTuYZ0/k+k3SWFmZpi3jSh79Y8WDoYK7+DsbKQ6xZy54Sh56YIYXfkaLQYYYrqKKksZ57h/NYU/hzu9h8oH+PnXfGT6i/KH9C4z8IR9qTxIiErrJHUMni9CryTTbtGV9pIj0QTZP+OQLoE660J8/uMsfTQDK9/NqQ2nsTaQ12SS9xg6MmmOX7W4NhRrOyIi0sd7eR0dRIoVf0TwfYhw8Yi4aDuTZIHNtcHiyfAVsvh3RpAr5d01GjXEr5lj0XyBOu8t1U3BzPU7LrJRrwE+ZmP72L39vrT7rmDRz9pDU7fVIOiRtqRLEJRDIW4I2ISkwBdzFKX8UTozTkPEmt9Iy+uKX5n2y8re2KFaseXWxTeVJbHh+DsJQ/hWsUNrHcl2dKmtgo7xHSonmevnATVV1vUbwvswm1oEiAFRdhF4gNdC8I6OGlVzmzwMbwqiGUk/nRBQeMEbyeRQV54QV3zteuBiHc8neQPR+QiD7diR2d4JhmDbr6xop+Bat2SVQqLg2IdAJ/Qu1Aor7mxhmPqiz35SWkbaaoDJYbWrCBeQ+jos4s2jCDY7OJEXW8ng9gPO71W/lcybMWzihUw6fA9w/riHe37Ez0="
docker_sets:
- set: docker/ubuntu-16.04
- set: docker/centos-7
- set: ubuntu1604-64
- set: centos7-64
Gemfile:
optional:
':test':
Expand Down
23 changes: 13 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ sudo: false
dist: trusty
language: ruby
cache: bundler
# related to https://github.com/rubygems/rubygems/issues/2123
before_install:
- rm -f Gemfile.lock
- 'rm -f Gemfile.lock'
- 'gem update --system'
- 'gem install bundler'
script:
- 'bundle exec rake $CHECK'
matrix:
Expand All @@ -13,28 +16,28 @@ matrix:
- rvm: 2.1.9
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 4.0" CHECK=test PARALLEL_TEST_PROCESSORS=12
- rvm: 2.4.3
- rvm: 2.4.4
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=test_with_coveralls
- rvm: 2.5.0
env: PUPPET_VERSION="~> 5.0" CHECK=test
- rvm: 2.5.1
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=test_with_coveralls
- rvm: 2.4.3
- rvm: 2.4.4
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=rubocop
- rvm: 2.4.3
- rvm: 2.5.1
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=build DEPLOY_TO_FORGE=yes
- rvm: 2.4.3
- rvm: 2.5.1
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=docker/ubuntu-16.04 CHECK=beaker
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_setfile=ubuntu1604-64{hypervisor=docker} CHECK=beaker
services: docker
sudo: required
- rvm: 2.4.3
- rvm: 2.5.1
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=docker/centos-7 CHECK=beaker
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_setfile=centos7-64{hypervisor=docker} CHECK=beaker
services: docker
sudo: required
branches:
Expand Down
47 changes: 30 additions & 17 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,29 @@ 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.3.0](https://github.com/voxpupuli/puppet-grafana/tree/v4.3.0) (2018-06-18)

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

**Implemented enhancements:**

- Add postgres support and secure\_json\_data support [\#105](https://github.com/voxpupuli/puppet-grafana/pull/105) ([Faffnir](https://github.com/Faffnir))

**Fixed bugs:**

- Update release codename from jessie to stretch. [\#113](https://github.com/voxpupuli/puppet-grafana/pull/113) ([drshawnkwang](https://github.com/drshawnkwang))

**Closed issues:**

- puppet-grafana Debian repository should use codename stretch [\#112](https://github.com/voxpupuli/puppet-grafana/issues/112)

**Merged pull requests:**

- drop EOL OSs; fix puppet version range [\#109](https://github.com/voxpupuli/puppet-grafana/pull/109) ([bastelfreak](https://github.com/bastelfreak))
- Rely on beaker-hostgenerator for docker nodesets [\#108](https://github.com/voxpupuli/puppet-grafana/pull/108) ([ekohl](https://github.com/ekohl))
- switch from topscope facts to $facts hash [\#102](https://github.com/voxpupuli/puppet-grafana/pull/102) ([bastelfreak](https://github.com/bastelfreak))
- Update README.md [\#99](https://github.com/voxpupuli/puppet-grafana/pull/99) ([cclloyd](https://github.com/cclloyd))

## [v4.2.0](https://github.com/voxpupuli/puppet-grafana/tree/v4.2.0) (2018-03-06)

[Full Changelog](https://github.com/voxpupuli/puppet-grafana/compare/v4.1.1...v4.2.0)
Expand All @@ -23,11 +46,6 @@ These should not affect the functionality of the module.
- grafana\_datasource provider with\_credentials\(\) returns is\_default value [\#89](https://github.com/voxpupuli/puppet-grafana/issues/89)
- fix datasource provider error [\#90](https://github.com/voxpupuli/puppet-grafana/pull/90) ([brandonrdn](https://github.com/brandonrdn))

**Merged pull requests:**

- release 4.1.1 [\#92](https://github.com/voxpupuli/puppet-grafana/pull/92) ([bastelfreak](https://github.com/bastelfreak))
- release 4.1.0 [\#88](https://github.com/voxpupuli/puppet-grafana/pull/88) ([bastelfreak](https://github.com/bastelfreak))

## [v4.1.0](https://github.com/voxpupuli/puppet-grafana/tree/v4.1.0) (2018-02-03)

[Full Changelog](https://github.com/voxpupuli/puppet-grafana/compare/v4.0.3...v4.1.0)
Expand All @@ -40,10 +58,6 @@ These should not affect the functionality of the module.

- "Could not autoload" error in grafana\_dashboard with ruby 2.4 on Centos 6 [\#83](https://github.com/voxpupuli/puppet-grafana/issues/83)

**Merged pull requests:**

- release 4.0.3 [\#81](https://github.com/voxpupuli/puppet-grafana/pull/81) ([bastelfreak](https://github.com/bastelfreak))

## [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)
Expand All @@ -57,7 +71,6 @@ These should not affect the functionality of the module.

- 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)

Expand All @@ -71,7 +84,6 @@ 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)

Expand All @@ -83,7 +95,7 @@ These should not affect the functionality of the module.

**Merged pull requests:**

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

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

Expand Down Expand Up @@ -118,8 +130,8 @@ 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)

Expand All @@ -140,6 +152,7 @@ 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 @@ -151,14 +164,14 @@ These should not affect the functionality of the module.

[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)

**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.1 (2017-01-18)

Just a notice: The next release will be a major one without Puppet 3 support!
Expand Down
11 changes: 6 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ group :test do
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 'mocha', '~> 1.4.0', :require => false
gem 'coveralls', :require => false
gem 'simplecov-console', :require => false
gem 'rack', '~> 1.0', :require => false if RUBY_VERSION < '2.2.2'
Expand All @@ -41,7 +41,7 @@ group :development do
end

group :system_tests do
gem 'winrm', :require => false
gem 'winrm', :require => false
if beaker_version = ENV['BEAKER_VERSION']
gem 'beaker', *location_for(beaker_version)
else
Expand All @@ -52,9 +52,10 @@ group :system_tests do
else
gem 'beaker-rspec', :require => false
end
gem 'serverspec', :require => false
gem 'beaker-puppet_install_helper', :require => false
gem 'beaker-module_install_helper', :require => false
gem 'serverspec', :require => false
gem 'beaker-hostgenerator', '>= 1.1.10', :require => false
gem 'beaker-puppet_install_helper', :require => false
gem 'beaker-module_install_helper', :require => false
end

group :release do
Expand Down
53 changes: 27 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -366,12 +366,12 @@ grafana_organization { 'example_org':
}
```

`grafana_url`, `grafana_user`, and `grafana_password` are required to create organizations via the API.
`grafana_url`, `grafana_user`, and `grafana_password` are required to create organizations via the API.

`name` is optional if the name will differ from example_org above.

`address` is an optional parameter that requires a hash. Address settings are `{"address1":"","address2":"","city":"","zipCode":"","state":"","country":""}`

#### `grafana_dashboard`

In order to use the dashboard resource, add the following to your manifest:
Expand All @@ -381,7 +381,7 @@ grafana_dashboard { 'example_dashboard':
grafana_url => 'http://localhost:3000',
grafana_user => 'admin',
grafana_password => '5ecretPassw0rd',
grafana_api_path => '/grafana/api'
grafana_api_path => '/grafana/api',
organization => 'NewOrg',
content => template('path/to/exported/file.json'),
}
Expand Down Expand Up @@ -416,32 +416,33 @@ In order to use the datasource resource, add the following to your manifest:

```puppet
grafana_datasource { 'influxdb':
grafana_url => 'http://localhost:3000',
grafana_user => 'admin',
grafana_password => '5ecretPassw0rd',
grafana_api_path => '/grafana/api'
type => 'influxdb',
organization => 'NewOrg',
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_url => 'http://localhost:3000',
grafana_user => 'admin',
grafana_password => '5ecretPassw0rd',
grafana_api_path => '/grafana/api',
type => 'influxdb',
organization => 'NewOrg',
url => 'http://localhost:8086',
user => 'admin',
password => '1nFlux5ecret',
database => 'graphite',
access_mode => 'proxy',
is_default => true,
json_data => template('path/to/additional/config.json'),
secure_json_data => template('path/to/additional/secure/config.json')
}
```

Available types are: influxdb, elasticsearch, graphite, cloudwatch, mysql, opentsdb, and prometheus
Available types are: influxdb, elasticsearch, graphite, cloudwatch, mysql, opentsdb, postgres and prometheus

`organization` is used to set which organization a datasource will be created on. If this parameter is not set, it will default to organization ID 1 (Main Org. by default). If the default org is deleted, organizations will need to be specified.
`organization` is used to set which organization a datasource will be created on. If this parameter is not set, it will default to organization ID 1 (Main Org. by default). If the default org is deleted, organizations will need to be specified.

Access mode determines how Grafana connects to the datasource, either `direct`
from the browser, or `proxy` to send requests via grafana.

Setting `basic_auth` to `true` will allow use of the `basic_auth_user` and `basic_auth_password` params.

Authentication is optional, as are `database` and `grafana_api_path`; additional `json_data` can be provided to allow custom configuration options.
Authentication is optional, as are `database` and `grafana_api_path`; additional `json_data` and `secure_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
Expand Down Expand Up @@ -473,7 +474,7 @@ Note that the `database` is dynamic, setting things other than "database" for se

**`jsonData` Settings**

Note that there are separate options for json_data based on the type of datasource you create.
Note that there are separate options for json_data / secure_json_data based on the type of datasource you create.

##### **Elasticsearch**

Expand All @@ -491,28 +492,28 @@ json_data => {"esVersion":5,"timeField":"@timestamp","timeInterval":"1m"}
##### **CloudWatch**

`authType` - Required. Options are `Access & Secret Key`, `Credentials File`, or `ARN`.

-"keys" = Access & Secret Key

-"credentials" = Credentials File

-"arn" = ARN

*When setting authType to `credentials`, the `database` param will set the Credentials Profile Name.*

*When setting authType to `arn`, another jsonData value of `assumeRoleARN` is available, which is not required for other authType settings*
*When setting authType to `arn`, another jsonData value of `assumeRoleARN` is available, which is not required for other authType settings*

`customMetricsNamespaces` - Optional. Namespaces of Custom Metrics, separated by commas within double quotes.

`defaultRegion` - Required. Options are "ap-northeast-(1 or 2)", "ap-southeast-(1 or 2)", "ap-south-1", "ca-central-1", "cn-north-1", "eu-central-1", "eu-west-(1 or 2)", "sa-east-(1 or 2)", "us-east-(1 or 2)", "us-gov-west-1", "us-west-(1 or 2)".

`timeField`

Example:
Example:
```puppet
{"authType":"arn","assumeRoleARN":"arn:aws:iam:*","customMetricsNamespaces":"Namespace1,Namespace2","defaultRegion":"us-east-1","timeField":"@timestamp"}
```

##### **Graphite**

`graphiteVersion` - Required. Available versions are `0.9` or `1.0`.
Expand Down Expand Up @@ -577,7 +578,7 @@ Creates and manages a global grafana user via the API.
```puppet
grafana_user { 'username':
grafana_url => 'http://localhost:3000',
grafana_api_path => '/grafana/api'
grafana_api_path => '/grafana/api',
grafana_user => 'admin',
grafana_password => '5ecretPassw0rd',
full_name => 'John Doe',
Expand Down
Loading