Skip to content

Commit

Permalink
add support for pgbouncer password
Browse files Browse the repository at this point in the history
  • Loading branch information
LongLiveCHIEF committed Jul 9, 2018
1 parent 60c9312 commit 517468e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
5 changes: 5 additions & 0 deletions data/defaults.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
gitlab::pgpass_file_attrs:
ensure: 'absent'
path: '/home/gitlab-consul/.pgpass'
owner: 'gitlab-consul'
group: 'gitlab-consul'
11 changes: 11 additions & 0 deletions manifests/host_config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
$skip_auto_migrations = $gitlab::skip_auto_migrations,
$skip_auto_reconfigure = $gitlab::skip_auto_reconfigure,
$store_git_keys_in_db = $gitlab::store_git_keys_in_db,
$pgpass_file_attrs = $gitlab::pgpass_file_attrs,
$pgbouncer_password = $gitlab::pgbouncer_password,
) {

file { $config_dir:
Expand Down Expand Up @@ -77,5 +79,14 @@
}
}
unless ($pgpass_file_attrs[ensure] == 'present' and empty($pgbouncer_password)){
file { "pgpass":
* => $pgpass_file_attrs,
content => template('gitlab/.pgpass.erb'),
}
} else {
fail('A password must be provided to $pgbouncer_password if $pgpass_file_attrs[ensure] = "present"')
}

include gitlab::backup
}
2 changes: 2 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@
# artifacts, lfs, registry, pages
#
class gitlab (
Hash $pgpass_file_attrs,
# package configuration
String $package_ensure = 'installed',
Optional[String] $edition = undef,
Expand Down Expand Up @@ -361,6 +362,7 @@
Optional[Hash] $nginx = undef,
Optional[Hash] $node_exporter = undef,
Optional[Hash] $redis_exporter = undef,
Optional[String] $pgbouncer_password = undef,
Optional[Hash] $postgres_exporter = undef,
Optional[Hash] $gitlab_monitor = undef,
Optional[String] $pages_external_url = undef,
Expand Down
1 change: 1 addition & 0 deletions templates/.pgpass.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
127.0.0.1:*:pgbouncer:pgbouncer:<%= @pgbouncer_password -%>

0 comments on commit 517468e

Please sign in to comment.