Skip to content

Commit

Permalink
Rework how classes are ordered
Browse files Browse the repository at this point in the history
  • Loading branch information
William Yardley committed Sep 20, 2017
1 parent d09835a commit c7bc507
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 7 additions & 5 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,11 @@
fail('cfg parameter must be a hash')
}

anchor { 'grafana::begin': }
-> class { '::grafana::install': }
-> class { '::grafana::config': }
~> class { '::grafana::service': }
-> anchor { 'grafana::end': }
contain grafana::install
contain grafana::config
contain grafana::service

Class['grafana::install']
-> Class['grafana::config']
~> Class['grafana::service']
}
6 changes: 2 additions & 4 deletions spec/classes/grafana_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,10 @@
context 'with default values' do
it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_class('grafana') }
it { is_expected.to contain_anchor('grafana::begin') }
it { is_expected.to contain_class('grafana::params') }
it { is_expected.to contain_class('grafana::install') }
it { is_expected.to contain_class('grafana::config') }
it { is_expected.to contain_class('grafana::install').that_comes_before('Class[grafana::config]') }
it { is_expected.to contain_class('grafana::config').that_notifies('Class[grafana::service]') }
it { is_expected.to contain_class('grafana::service') }
it { is_expected.to contain_anchor('grafana::end') }
end

context 'with parameter install_method is set to package' do
Expand Down

0 comments on commit c7bc507

Please sign in to comment.