Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Arch Linux tests #293

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions data/family/Archlinux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ grafana::cfg_location: '/etc/grafana.ini'
grafana::install_method: 'repo'
grafana::manage_package_repo: false
grafana::service_name: 'grafana'
grafana::create_subdirs_provisioning: true
3 changes: 3 additions & 0 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@
ensure => 'present', # pacman provider doesn't have feature versionable
name => $grafana::package_name,
}
file { ['/etc/grafana', '/etc/grafana/provisioning', '/etc/grafana/provisioning/dashboards', '/etc/grafana/provisioning/datasources',]:
ensure => 'directory',
}
}
'FreeBSD': {
package { 'grafana':
Expand Down
3 changes: 3 additions & 0 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@
"9"
]
},
{
"operatingsystem": "Archlinux"
},
{
"operatingsystem": "FreeBSD",
"operatingsystemrelease": [
Expand Down
3 changes: 2 additions & 1 deletion spec/acceptance/class_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ class { 'grafana':
it { is_expected.to be_installed }
end

describe service('grafana-server') do
service_name = fact('os.family') == 'Archlinux' ? 'grafana' : 'grafana-server'
describe service(service_name) do
it { is_expected.to be_enabled }
it { is_expected.to be_running }
end
Expand Down
3 changes: 2 additions & 1 deletion spec/classes/grafana_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -506,10 +506,11 @@
)
end

context 'without puppetsource defined' do
context 'without puppetsource defined and create_subdirs_provisioning false' do
let(:params) do
{
version: '11.0.0',
create_subdirs_provisioning: false,
provisioning_dashboards: {
apiVersion: 1,
providers: [
Expand Down
2 changes: 1 addition & 1 deletion spec/support/acceptance/prepare_host.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

def prepare_host
cleanup_script = <<-SHELL
/opt/puppetlabs/bin/puppet resource package grafana ensure=purged
puppet resource package grafana ensure=purged
rm -rf /var/lib/grafana/
SHELL

Expand Down
Loading