Merge branch 'postgres-user-exporter' into 'master'

Ensure the postgresql user is created for use in the postgres exporter

Closes #2425

See merge request !1669
This commit is contained in:
Marin Jankovski 2017-06-22 08:44:10 +00:00
commit 3fedab4fea
2 changed files with 13 additions and 0 deletions

View File

@ -21,6 +21,8 @@ postgres_exporter_log_dir = node['gitlab']['postgres-exporter']['log_directory']
postgres_exporter_static_etc_dir = "/opt/gitlab/etc/postgres-exporter"
postgres_exporter_dir = node['gitlab']['postgres-exporter']['home']
include_recipe 'gitlab::postgresql_user'
directory postgres_exporter_log_dir do
owner postgresql_user
mode '0700'

View File

@ -72,6 +72,17 @@ describe 'gitlab::postgres-exporter' do
end
end
context 'when enabled and run as an isolated recipe' do
let(:chef_run) { ChefSpec::SoloRunner.converge('gitlab::config', 'gitlab::postgres-exporter') }
before do
stub_gitlab_rb(postgres_exporter: { enable: true })
end
it 'includes the postgresql_user recipe' do
expect(chef_run).to include_recipe('gitlab::postgresql_user')
end
end
context 'when log dir is changed' do
before do
stub_gitlab_rb(