File tree Expand file tree Collapse file tree 5 files changed +17
-13
lines changed Expand file tree Collapse file tree 5 files changed +17
-13
lines changed Original file line number Diff line number Diff line change @@ -342,8 +342,7 @@ Defaults to 'grafana-server'.
342342
343343##### ` version `
344344
345- The version of Grafana to install and manage. Defaults to the latest version of
346- Grafana available at the time of module release.
345+ The version of Grafana to install and manage. Defaults to 'installed'
347346
348347##### ` sysconfig_location `
349348
Original file line number Diff line number Diff line change 5454#
5555# [*version*]
5656# The version of Grafana to install and manage.
57- # Defaults to the latest version of Grafana available at the time of module release.
57+ # Defaults to 'installed'
5858#
5959# [*repo_name*]
6060# When using 'repo' install_method, the repo to look for packages in.
122122 Enum[' stable' , ' testing' ] $repo_name = $::grafana::params::repo_name,
123123 String $rpm_iteration = $::grafana::params::rpm_iteration,
124124 String $service_name = $::grafana::params::service_name,
125- String $version = $::grafana::params::version ,
125+ String $version = ' installed ' ,
126126 Hash $plugins = {},
127127 Hash $provisioning_dashboards = {},
128128 Hash $provisioning_datasources = {},
Original file line number Diff line number Diff line change 1414 $package_name = ' grafana'
1515 $rpm_iteration = ' 1'
1616 $repo_name = ' stable'
17- $version = ' 4.5.1'
1817 $create_subdirs_provisioning = false
1918 $provisioning_dashboards_file = ' /etc/grafana/provisioning/dashboards/puppetprovisioned.yaml'
2019 $provisioning_datasources_file = ' /etc/grafana/provisioning/datasources/puppetprovisioned.yaml'
20+
2121 case $facts [' os' ][' family' ] {
2222 ' Archlinux' : {
2323 $manage_package_repo = false
Original file line number Diff line number Diff line change 11require 'spec_helper_acceptance'
22
33describe 'grafana class' do
4+ # Create dummy module directorty
5+ shell ( 'mkdir -p /etc/puppetlabs/code/environments/production/modules/my_custom_module/files/dashboards' )
6+
47 context 'default parameters' do
58 # Using puppet_apply as a helper
69 it 'works idempotently with no errors' do
@@ -35,7 +38,7 @@ class { 'grafana':
3538 type => 'prometheus',
3639 access => 'proxy',
3740 url => 'http://localhost:9090/prometheus',
38- isDefault => true ,
41+ isDefault => false ,
3942 },
4043 ],
4144 },
@@ -76,7 +79,7 @@ class { 'grafana':
7679 type => 'prometheus',
7780 access => 'proxy',
7881 url => 'http://localhost:9090/prometheus',
79- isDefault => true ,
82+ isDefault => false ,
8083 },
8184 ],
8285 },
@@ -96,8 +99,8 @@ class { 'grafana':
9699 },
97100 ],
98101 },
99- provisioning_dashboards_file => '/opt /grafana/conf /provisioning/dashboards/dashboard.yaml',
100- provisioning_datasources_file => '/opt /grafana/conf /provisioning/datasources/datasources.yaml'
102+ provisioning_dashboards_file => '/etc /grafana/provisioning/dashboards/dashboard.yaml',
103+ provisioning_datasources_file => '/etc /grafana/provisioning/datasources/datasources.yaml'
101104 }
102105 EOS
103106
Original file line number Diff line number Diff line change 3737 context 'with parameter install_method is set to package' do
3838 let ( :params ) do
3939 {
40- install_method : 'package'
40+ install_method : 'package' ,
41+ version : '4.5.1'
4142 }
4243 end
4344
113114 end
114115
115116 describe 'install the package' do
116- it { is_expected . to contain_package ( 'grafana' ) . with_ensure ( '4.5.1 ' ) }
117+ it { is_expected . to contain_package ( 'grafana' ) . with_ensure ( 'installed ' ) }
117118 end
118119 when 'RedHat'
119120 describe 'yum repo dependencies first' do
126127 end
127128
128129 describe 'install the package' do
129- it { is_expected . to contain_package ( 'grafana' ) . with_ensure ( '4.5.1-1 ' ) }
130+ it { is_expected . to contain_package ( 'grafana' ) . with_ensure ( 'installed ' ) }
130131 end
131132 end
132133 end
167168 context 'with parameter install_method is set to archive' do
168169 let ( :params ) do
169170 {
170- install_method : 'archive'
171+ install_method : 'archive' ,
172+ version : '4.5.1'
171173 }
172174 end
173175
You can’t perform that action at this time.
0 commit comments