fix
This commit is contained in:
@@ -26,18 +26,6 @@ locals {
|
|||||||
db if db.name == name
|
db if db.name == name
|
||||||
]
|
]
|
||||||
])
|
])
|
||||||
roles = concat(var.roles, var.extentions.postgrest.enable?[{
|
|
||||||
"name" = "anonymous"
|
|
||||||
}]:[])
|
|
||||||
sorted-role-name = reverse(distinct(sort([
|
|
||||||
for role in local.roles: role.name
|
|
||||||
])))
|
|
||||||
sorted-roles = flatten([
|
|
||||||
for name in local.sorted-role-name: [
|
|
||||||
for role in local.roles:
|
|
||||||
role if role.name == name
|
|
||||||
]
|
|
||||||
])
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -86,10 +74,3 @@ resource "postgresql_database" "my_db" {
|
|||||||
connection_limit = -1
|
connection_limit = -1
|
||||||
allow_connections = true
|
allow_connections = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
resource "postgresql_role" "roles" {
|
|
||||||
depends_on = [ time_sleep.wait_pg_ready ]
|
|
||||||
count = length(local.sorted-roles)
|
|
||||||
name = "${local.sorted-roles[count.index].name}"
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -6,16 +6,6 @@ metadata:
|
|||||||
name: dataset-pg
|
name: dataset-pg
|
||||||
description: null
|
description: null
|
||||||
options:
|
options:
|
||||||
replicas:
|
|
||||||
default: 1
|
|
||||||
examples:
|
|
||||||
- 1
|
|
||||||
type: integer
|
|
||||||
domain-name:
|
|
||||||
default: your_company.com
|
|
||||||
examples:
|
|
||||||
- your_company.com
|
|
||||||
type: string
|
|
||||||
extentions:
|
extentions:
|
||||||
default:
|
default:
|
||||||
pool:
|
pool:
|
||||||
@@ -122,10 +112,19 @@ options:
|
|||||||
type: object
|
type: object
|
||||||
type: object
|
type: object
|
||||||
type: object
|
type: object
|
||||||
sub-domain:
|
databases:
|
||||||
default: dataset-pg
|
default: []
|
||||||
|
items:
|
||||||
|
properties:
|
||||||
|
name:
|
||||||
|
default: db
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
type: array
|
||||||
|
ingress-class:
|
||||||
|
default: traefik
|
||||||
examples:
|
examples:
|
||||||
- dataset-pg
|
- traefik
|
||||||
type: string
|
type: string
|
||||||
backups:
|
backups:
|
||||||
default:
|
default:
|
||||||
@@ -181,29 +180,25 @@ options:
|
|||||||
default: backup-settings
|
default: backup-settings
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
storage:
|
sub-domain:
|
||||||
default: 8Gi
|
default: dataset-pg
|
||||||
examples:
|
examples:
|
||||||
- 8Gi
|
- dataset-pg
|
||||||
type: string
|
type: string
|
||||||
databases:
|
replicas:
|
||||||
default: []
|
default: 1
|
||||||
items:
|
examples:
|
||||||
properties:
|
- 1
|
||||||
name:
|
type: integer
|
||||||
default: db
|
|
||||||
type: string
|
|
||||||
type: object
|
|
||||||
type: array
|
|
||||||
issuer:
|
issuer:
|
||||||
default: letsencrypt-prod
|
default: letsencrypt-prod
|
||||||
examples:
|
examples:
|
||||||
- letsencrypt-prod
|
- letsencrypt-prod
|
||||||
type: string
|
type: string
|
||||||
ingress-class:
|
storage:
|
||||||
default: traefik
|
default: 8Gi
|
||||||
examples:
|
examples:
|
||||||
- traefik
|
- 8Gi
|
||||||
type: string
|
type: string
|
||||||
roles:
|
roles:
|
||||||
default: []
|
default: []
|
||||||
@@ -214,6 +209,11 @@ options:
|
|||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
type: array
|
type: array
|
||||||
|
domain-name:
|
||||||
|
default: your_company.com
|
||||||
|
examples:
|
||||||
|
- your_company.com
|
||||||
|
type: string
|
||||||
dependencies:
|
dependencies:
|
||||||
- dist: null
|
- dist: null
|
||||||
category: dbo
|
category: dbo
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
locals {
|
locals {
|
||||||
sorted-roles-name = reverse(distinct(sort([for r in var.roles: r.name])))
|
roles = concat(var.roles, var.extentions.postgrest.enable?[{
|
||||||
|
"name" = "anonymous"
|
||||||
|
}]:[])
|
||||||
|
sorted-roles-name = reverse(distinct(sort([for r in local.roles: r.name])))
|
||||||
sorted-roles = flatten([
|
sorted-roles = flatten([
|
||||||
for name in local.sorted-roles-name: [
|
for name in local.sorted-roles-name: [
|
||||||
for r in var.roles:
|
for r in local.roles:
|
||||||
r if r.name == name
|
r if r.name == name
|
||||||
]
|
]
|
||||||
])
|
])
|
||||||
|
|||||||
Reference in New Issue
Block a user