bundles/postgresql: rename users -> roles
All checks were successful
bundlewrap/pipeline/head This commit looks good

This commit is contained in:
Franzi 2020-11-10 12:37:58 +01:00
parent d087cea869
commit 3fbe32518a
Signed by: kunsi
GPG key ID: 12E3D2136B818350
19 changed files with 20 additions and 20 deletions

View file

@ -51,7 +51,7 @@ def import_database_settings_from_postfixadmin(metadata):
'dovecot': { 'dovecot': {
'admin_email': metadata.get('postfixadmin/admin_email'), 'admin_email': metadata.get('postfixadmin/admin_email'),
'database': { 'database': {
'dbpass': metadata.get('postgresql/users/postfixadmin/password'), 'dbpass': metadata.get('postgresql/roles/postfixadmin/password'),
}, },
}, },
} }

View file

@ -27,7 +27,7 @@ defaults = {
}, },
}, },
'postgresql': { 'postgresql': {
'users': { 'roles': {
'gitea': { 'gitea': {
'password': repo.vault.password_for('{} postgresql gitea'.format(node.name)), 'password': repo.vault.password_for('{} postgresql gitea'.format(node.name)),
}, },

View file

@ -20,7 +20,7 @@ defaults = {
}, },
}, },
'postgresql': { 'postgresql': {
'users': { 'roles': {
'synapse_user': { 'synapse_user': {
'password': repo.vault.password_for('{} postgresql synapse_user'.format(node.name)), 'password': repo.vault.password_for('{} postgresql synapse_user'.format(node.name)),
}, },

View file

@ -26,7 +26,7 @@ defaults = {
'sender_localpart': repo.vault.password_for('{} mautrix-telegram sender_localpart'.format(node.name)), 'sender_localpart': repo.vault.password_for('{} mautrix-telegram sender_localpart'.format(node.name)),
}, },
'postgresql': { 'postgresql': {
'users': { 'roles': {
'mautrix-telegram': { 'mautrix-telegram': {
'password': repo.vault.password_for('{} postgresql mautrix-telegram'.format(node.name)), 'password': repo.vault.password_for('{} postgresql mautrix-telegram'.format(node.name)),
}, },

View file

@ -2,7 +2,7 @@ files = {
'/etc/miniflux.conf': { '/etc/miniflux.conf': {
'content_type': 'mako', 'content_type': 'mako',
'context': { 'context': {
'dbpassword': node.metadata['postgresql']['users']['miniflux']['password'], 'dbpassword': node.metadata['postgresql']['roles']['miniflux']['password'],
'base_url': node.metadata['miniflux']['domain'], 'base_url': node.metadata['miniflux']['domain'],
}, },
'triggers': { 'triggers': {

View file

@ -21,7 +21,7 @@ defaults = {
}, },
}, },
'postgresql': { 'postgresql': {
'users': { 'roles': {
'miniflux': { 'miniflux': {
'password': repo.vault.password_for('{} postgresql miniflux'.format(node.name)), 'password': repo.vault.password_for('{} postgresql miniflux'.format(node.name)),
}, },

View file

@ -21,7 +21,7 @@ defaults = {
'sender_localpart': '_discordpuppet_bot', 'sender_localpart': '_discordpuppet_bot',
}, },
'postgresql': { 'postgresql': {
'users': { 'roles': {
'mx-puppet-discord': { 'mx-puppet-discord': {
'password': repo.vault.password_for('{} postgresql mx-puppet-discord'.format(node.name)), 'password': repo.vault.password_for('{} postgresql mx-puppet-discord'.format(node.name)),
}, },

View file

@ -1,5 +1,5 @@
user = postfixadmin user = postfixadmin
password = ${node.metadata['postgresql']['users']['postfixadmin']['password']} password = ${node.metadata['postgresql']['roles']['postfixadmin']['password']}
hosts = localhost hosts = localhost
dbname = postfixadmin dbname = postfixadmin
query = SELECT domain FROM domain WHERE domain='%s' and backupmx = true query = SELECT domain FROM domain WHERE domain='%s' and backupmx = true

View file

@ -1,5 +1,5 @@
user = postfixadmin user = postfixadmin
password = ${node.metadata['postgresql']['users']['postfixadmin']['password']} password = ${node.metadata['postgresql']['roles']['postfixadmin']['password']}
hosts = localhost hosts = localhost
dbname = postfixadmin dbname = postfixadmin
query = SELECT goto FROM alias WHERE address='%s' AND active = true query = SELECT goto FROM alias WHERE address='%s' AND active = true

View file

@ -1,5 +1,5 @@
user = postfixadmin user = postfixadmin
password = ${node.metadata['postgresql']['users']['postfixadmin']['password']} password = ${node.metadata['postgresql']['roles']['postfixadmin']['password']}
hosts = localhost hosts = localhost
dbname = postfixadmin dbname = postfixadmin
query = SELECT domain FROM domain WHERE domain='%s' AND backupmx = false AND active = true query = SELECT domain FROM domain WHERE domain='%s' AND backupmx = false AND active = true

View file

@ -1,5 +1,5 @@
user = postfixadmin user = postfixadmin
password = ${node.metadata['postgresql']['users']['postfixadmin']['password']} password = ${node.metadata['postgresql']['roles']['postfixadmin']['password']}
hosts = localhost hosts = localhost
dbname = postfixadmin dbname = postfixadmin
query = SELECT maildir FROM mailbox WHERE username='%s' AND active = true query = SELECT maildir FROM mailbox WHERE username='%s' AND active = true

View file

@ -29,7 +29,7 @@ files = {
'context': { 'context': {
'setup_password': node.metadata['postfixadmin']['setup_password'], 'setup_password': node.metadata['postfixadmin']['setup_password'],
'admin_email': node.metadata['postfixadmin']['admin_email'], 'admin_email': node.metadata['postfixadmin']['admin_email'],
'database_password': node.metadata['postgresql']['users']['postfixadmin']['password'], 'database_password': node.metadata['postgresql']['roles']['postfixadmin']['password'],
}, },
'needs': { 'needs': {
'git_deploy:/opt/postfixadmin', 'git_deploy:/opt/postfixadmin',

View file

@ -13,7 +13,7 @@ defaults = {
'owner': 'postfixadmin', 'owner': 'postfixadmin',
}, },
}, },
'users': { 'roles': {
'postfixadmin': { 'postfixadmin': {
'password': repo.vault.password_for(node.name + ' postgresql postfixadmin'), 'password': repo.vault.password_for(node.name + ' postgresql postfixadmin'),
}, },

View file

@ -35,7 +35,7 @@ svc_systemd = {
postgres_dbs = {} postgres_dbs = {}
for user, config in node.metadata.get('postgresql', {}).get('users', {}).items(): for user, config in node.metadata.get('postgresql', {}).get('roles', {}).items():
postgres_roles[user] = { postgres_roles[user] = {
'password': config['password'], 'password': config['password'],
'needs': { 'needs': {

View file

@ -139,7 +139,7 @@ if node.metadata['powerdns'].get('features', {}).get('pgsql', False):
files['/etc/powerdns/pdns.d/pgsql.conf'] = { files['/etc/powerdns/pdns.d/pgsql.conf'] = {
'content_type': 'mako', 'content_type': 'mako',
'context': { 'context': {
'password': node.metadata['postgresql']['users']['powerdns']['password'], 'password': node.metadata['postgresql']['roles']['powerdns']['password'],
}, },
'needs': { 'needs': {
'pkg_apt:pdns-backend-pgsql', 'pkg_apt:pdns-backend-pgsql',
@ -152,7 +152,7 @@ if node.metadata['powerdns'].get('features', {}).get('pgsql', False):
files['/etc/powerdns/schema.pgsql.sql'] = {} files['/etc/powerdns/schema.pgsql.sql'] = {}
actions['powerdns_load_pgsql_schema'] = { actions['powerdns_load_pgsql_schema'] = {
'command': node.metadata['postgresql']['users']['powerdns']['password'].format_into('PGPASSWORD={} psql -h 127.0.0.1 -d powerdns -U powerdns -w < /etc/powerdns/schema.pgsql.sql'), 'command': node.metadata['postgresql']['roles']['powerdns']['password'].format_into('PGPASSWORD={} psql -h 127.0.0.1 -d powerdns -U powerdns -w < /etc/powerdns/schema.pgsql.sql'),
'unless': 'sudo -u postgres psql -d powerdns -c "\dt" | grep domains 2>&1 >/dev/null', 'unless': 'sudo -u postgres psql -d powerdns -c "\dt" | grep domains 2>&1 >/dev/null',
'needs': { 'needs': {
'bundle:postgresql', 'bundle:postgresql',

View file

@ -13,7 +13,7 @@ defaults = {
'api_key': repo.vault.password_for('{} powerdns api'.format(node.name)), 'api_key': repo.vault.password_for('{} powerdns api'.format(node.name)),
}, },
'postgresql': { 'postgresql': {
'users': { 'roles': {
'powerdns': { 'powerdns': {
'password': repo.vault.password_for('{} postgresql powerdns'.format(node.name)), 'password': repo.vault.password_for('{} postgresql powerdns'.format(node.name)),
}, },

View file

@ -5,7 +5,7 @@ PORT = 9191
OFFLINE_MODE = True OFFLINE_MODE = True
SQLA_DB_USER = 'powerdnsadmin' SQLA_DB_USER = 'powerdnsadmin'
SQLA_DB_PASSWORD = '${node.metadata['postgresql']['users']['powerdnsadmin']['password']}' SQLA_DB_PASSWORD = '${node.metadata['postgresql']['roles']['powerdnsadmin']['password']}'
SQLA_DB_HOST = '127.0.0.1' SQLA_DB_HOST = '127.0.0.1'
SQLA_DB_NAME = 'powerdnsadmin' SQLA_DB_NAME = 'powerdnsadmin'
SQLALCHEMY_TRACK_MODIFICATIONS = True SQLALCHEMY_TRACK_MODIFICATIONS = True

View file

@ -20,7 +20,7 @@ defaults = {
}, },
}, },
'postgresql': { 'postgresql': {
'users': { 'roles': {
'powerdnsadmin': { 'powerdnsadmin': {
'password': repo.vault.password_for('{} postgresql powerdnsadmin'.format(node.name)), 'password': repo.vault.password_for('{} postgresql powerdnsadmin'.format(node.name)),
}, },

View file

@ -17,7 +17,7 @@ defaults = {
'cookie_secret': repo.vault.password_for('{} travelynx cookie_secret'.format(node.name)), 'cookie_secret': repo.vault.password_for('{} travelynx cookie_secret'.format(node.name)),
}, },
'postgresql': { 'postgresql': {
'users': { 'roles': {
'travelynx': { 'travelynx': {
'password': repo.vault.password_for('{} postgresql travelynx'.format(node.name)), 'password': repo.vault.password_for('{} postgresql travelynx'.format(node.name)),
}, },