Skip to content

Commit e15fe50

Browse files
(maint) Add read-only user.
1 parent f2fe8ed commit e15fe50

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -608,15 +608,15 @@ Which database backend to use for the read database. Only supports
608608
#### `read_database_host`
609609
*This parameter must be set to use another PuppetDB instance for queries.*
610610

611-
The hostname or IP address of the read database server. If set to `undef`,
612-
it will use the value of the `database_host` parameter. This option is
613-
supported in PuppetDB >= 1.6.
611+
The hostname or IP address of the read database server. If set to `undef`, and
612+
`manage_database` is set to `true`, it will use the value of the `database_host`
613+
parameter. This option is supported in PuppetDB >= 1.6.
614614

615615
#### `read_database_port`
616616

617617
The port that the read database server listens on. If `read_database_host`
618-
is set to `undef`, it will use the value of the `database_port` parameter. This
619-
option is supported in PuppetDB >= 1.6.
618+
is set to `undef`, and `manage_database` is set to `true`, it will use the value of
619+
the `database_port` parameter. This option is supported in PuppetDB >= 1.6.
620620

621621
#### `read_database_username`
622622

@@ -637,8 +637,8 @@ Defaults to `true`
637637
#### `read_database_name`
638638

639639
The name of the read database instance to connect to. If `read_database_host`
640-
is set to `undef`, it will use the value of the `database_name` parameter.
641-
This option is supported in PuppetDB >= 1.6.
640+
is set to `undef`, and `manage_database` is set to `true`, it will use the value of
641+
the `database_name` parameter. This option is supported in PuppetDB >= 1.6.
642642

643643
#### `read_log_slow_statements`
644644

manifests/server/read_database.pp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,5 +164,9 @@
164164
ensure => absent,
165165
}
166166
}
167+
} else {
168+
file { "${confdir}/read_database.ini":
169+
ensure => absent,
170+
}
167171
}
168172
}

spec/unit/classes/server/read_database_ini_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
it { is_expected.to contain_class('puppetdb::server::read_database') }
1616

1717
describe 'when using default values' do
18-
it { is_expected.to contain_file('/etc/puppetlabs/puppetdb/conf.d/read_database.ini') }
18+
it { is_expected.to contain_file('/etc/puppetlabs/puppetdb/conf.d/read_database.ini').with('ensure' => 'absent') }
1919
end
2020

2121
describe 'when using minimum working values' do

0 commit comments

Comments
 (0)