Skip to content

Commit

Permalink
Merge pull request #64 from phaedriel/usergroup
Browse files Browse the repository at this point in the history
  • Loading branch information
smortex authored Aug 27, 2022
2 parents fa71515 + 0284e68 commit 9ba3bb7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
4 changes: 2 additions & 2 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
file { '/etc/kibana/kibana.yml':
ensure => $_ensure,
content => template("${module_name}/etc/kibana/kibana.yml.erb"),
owner => 'kibana',
group => 'kibana',
owner => $kibana::kibana_user,
group => $kibana::kibana_group,
mode => '0660',
}
}
4 changes: 4 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
# @param package_source Local path to package file for file (not repo) based installation
# @param manage_repo Whether to manage the package manager repository
# @param status Service status
# @param kibana_user owner of kibana.yml
# @param kibana_group group of kibana.yml
#
# @author Tyler Langlois <tyler.langlois@elastic.co>
#
Expand All @@ -32,6 +34,8 @@
Boolean $oss,
Optional[String] $package_source,
Kibana::Status $status,
String[1] $kibana_user = 'kibana',
String[1] $kibana_group = 'kibana',
) {
contain kibana::install
contain kibana::config
Expand Down
12 changes: 12 additions & 0 deletions spec/classes/kibana_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,18 @@
end
end

describe 'kibana_user' do
let(:params) { { kibana_user: 'testuser' } }

it { is_expected.to contain_file('/etc/kibana/kibana.yml').with(owner: 'testuser') }
end

describe 'kibana_group' do
let(:params) { { kibana_group: 'testgroup' } }

it { is_expected.to contain_file('/etc/kibana/kibana.yml').with(group: 'testgroup') }
end

describe 'manage_repo' do
let(:params) { { manage_repo: false } }

Expand Down

0 comments on commit 9ba3bb7

Please sign in to comment.