This repository has been archived by the owner on Jan 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11342 from alphagov/account_api_db_admin
Configure account_api_db_admin machine class
- Loading branch information
Showing
6 changed files
with
112 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
govuk_env_sync::tasks: | ||
"pull_account_api_production_daily": | ||
ensure: "present" | ||
hour: "0" | ||
minute: "0" | ||
action: "pull" | ||
dbms: "postgresql" | ||
storagebackend: "s3" | ||
database: "account-api_production" | ||
database_hostname: "account-api-postgresql" | ||
temppath: "/tmp/account_api_production" | ||
url: "govuk-production-database-backups" | ||
path: "account-api-postgresql" | ||
# "push_account_api_production_daily": | ||
# ensure: "present" | ||
# hour: "5" | ||
# minute: "0" | ||
# action: "push" | ||
# dbms: "postgresql" | ||
# storagebackend: "s3" | ||
# database: "account-api_production" | ||
# database_hostname: "account-api-postgresql" | ||
# temppath: "/tmp/account_api_production" | ||
# url: "govuk-integration-database-backups" | ||
# path: "account-api-postgresql" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# govuk_env_sync::tasks: | ||
# "push_account_api_production_daily": | ||
# ensure: "present" | ||
# hour: "23" | ||
# minute: "0" | ||
# action: "push" | ||
# dbms: "postgresql" | ||
# storagebackend: "s3" | ||
# database: "account-api_production" | ||
# database_hostname: "account-api-postgresql" | ||
# temppath: "/tmp/account_api_production" | ||
# url: "govuk-production-database-backups" | ||
# path: "account-api-postgresql" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
govuk_env_sync::tasks: | ||
"pull_account_api_production_daily": | ||
ensure: "present" | ||
hour: "0" | ||
minute: "0" | ||
action: "pull" | ||
dbms: "postgresql" | ||
storagebackend: "s3" | ||
database: "account-api_production" | ||
database_hostname: "account-api-postgresql" | ||
temppath: "/tmp/account_api_production" | ||
url: "govuk-production-database-backups" | ||
path: "account-api-postgresql" | ||
# "push_account_api_production_daily": | ||
# ensure: "present" | ||
# hour: "5" | ||
# minute: "0" | ||
# action: "push" | ||
# dbms: "postgresql" | ||
# storagebackend: "s3" | ||
# database: "account-api_production" | ||
# database_hostname: "account-api-postgresql" | ||
# temppath: "/tmp/account_api_production" | ||
# url: "govuk-staging-database-backups" | ||
# path: "account-api-postgresql" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# == Class: govuk_node::s_account_api_db_admin | ||
# | ||
# This machine class is used to administer the Account API | ||
# PostgreSQL RDS instances. | ||
# | ||
# === Parameters | ||
# | ||
# [*postgres_host*] | ||
# Hostname of the RDS database to use. | ||
# Default: undef | ||
# | ||
# [*postgres_user*] | ||
# The PostgreSQL user to use for admisistering the database. | ||
# Default: undef | ||
# | ||
# [*postgres_password*] | ||
# The password corresponding to the above `postgres_user`. | ||
# Default: undef | ||
# | ||
# [*postgres_port*] | ||
# The port with which to connect to the `postgres_host`. | ||
# Default: '5432' | ||
# | ||
class govuk::node::s_account_api_db_admin( | ||
$postgres_host = undef, | ||
$postgres_user = undef, | ||
$postgres_password = undef, | ||
$postgres_port = '5432', | ||
$apt_mirror_hostname, | ||
) { | ||
include govuk_env_sync | ||
include ::govuk::node::s_base | ||
|
||
# include the common config/tooling required for our app-specific DB admin class | ||
class { '::govuk::nodes::postgresql_db_admin': | ||
postgres_host => $postgres_host, | ||
postgres_user => $postgres_user, | ||
postgres_password => $postgres_password, | ||
postgres_port => $postgres_port, | ||
apt_mirror_hostname => $apt_mirror_hostname, | ||
} -> | ||
|
||
# include all PostgreSQL classes that create databases and users | ||
class { '::govuk::apps::account_api::db': } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters