Browse Source

new: [apache,cron,letsencrypt,logrotate,odoo,postgres] declare relations

framadate
Valentin Lab 6 years ago
parent
commit
f98351f9f8
  1. 16
      apache/metadata.yml
  2. 9
      cron/metadata.yml
  3. 18
      letsencrypt/metadata.yml
  4. 2
      logrotate/hooks/schedule_command-relation-joined
  5. 11
      logrotate/metadata.yml
  6. 26
      odoo-tecnativa/metadata.yml
  7. 2
      postgres/metadata.yml

16
apache/metadata.yml

@ -18,3 +18,19 @@ config-resources:
provides:
web-proxy:
tech-dep: "reversed"
uses:
log-rotate:
#constraint: required | recommended | optional
#auto: pair | summon | none ## default: pair
constraint: recommended
auto: pair
solves:
disk-leak: "/var/log/apache2"
cert-provider:
#constraint: required | recommended | optional
#auto: pair | summon | none ## default: pair
constraint: optional
auto: pair
limit: n
solves:
feature: "SSL certificate generation"

9
cron/metadata.yml

@ -13,3 +13,12 @@ host-resources:
provides:
schedule-command:
tech-dep: False
uses: ## optional
log-rotate:
#constraint: required | recommended | optional
#auto: pair | summon | none ## default: pair
constraint: optional
solves:
disk-leak: "/var/log/cron"
#default-options:

18
letsencrypt/metadata.yml

@ -7,3 +7,21 @@ data-resources:
- /etc/letsencrypt ## yes certificates are stored here, this is data
- /var/log/letsencrypt ## logs
- /var/lib/tldextract ## latest data about TLDs, this is used by lexicon...
provides:
cert-provider:
uses:
log-rotate:
#constraint: required | recommended | optional
#auto: pair | summon | none ## default: pair
constraint: optional
auto: pair
solves:
disk-leak: "/var/log/letsencrypt"
#default-options:
schedule-command:
constraint: recommended
auto: pair
solves:
missing-feature: "Automatic certificate renewal"
default-options:
schedule: "30 3 * * 7" ## schedule log renewal every week

2
logrotate/hooks/schedule_command-relation-joined

@ -13,8 +13,6 @@ label=launch-$SERVICE_NAME
DST=$CONFIGSTORE/$TARGET_SERVICE_NAME/etc/cron/$label
schedule=$(relation-get schedule) || true
## It should really stay at midnight as most logs are dated
schedule=${schedule:-0 0 * * *}
if ! echo "$schedule" | egrep '^\s*(([0-9/,*-]+\s+){4,4}[0-9/,*-]+|@[a-z]+)\s*$' >/dev/null 2>&1; then
err "Unrecognized schedule '$schedule'."
exit 1

11
logrotate/metadata.yml

@ -2,12 +2,17 @@ description: Log Rotation Service
type: run-once
data-resources:
- /var/lib/logrotate
requires:
schedule-command:
interface: schedule-command
## YYY: probably not useful anymore
# charm-resources:
# - /etc/cron.daily/logrotate
provides:
log-rotate:
tech-dep: "reversed"
uses:
schedule-command:
constraint: required
solves:
missing-feature: "scheduling of log rotation"
default-options:
schedule: "0 0 * * *" ## It should really stay at midnight as most logs are dated

26
odoo-tecnativa/metadata.yml

@ -18,6 +18,32 @@ docker-compose:
INITIAL_LANG: fr_FR
restart: unless-stopped
uses:
postgres-database:
#constraint: required | recommended | optional
#auto: pair | summon | none ## default: pair
constraint: required
auto: pair
solves:
database: "main storage"
#default-options:
log-rotate:
#constraint: required | recommended | optional
#auto: pair | summon | none ## default: pair
constraint: recommended
auto: pair
solves:
disk-leak: "/var/log/odoo"
#default-options:
web-proxy:
#constraint: required | recommended | optional
#auto: pair | summon | none ## default: pair
constraint: recommended
auto: pair
solves:
proxy: "Public access"
#default-options:
# network-isolation:
# whitelist: ## required external services used by this service
# - www.google.com

2
postgres/metadata.yml

@ -2,3 +2,5 @@ summary: "Postgres server"
maintainer: "Valentin Lab <valentin.lab@kalysto.org>"
data-resources:
- /var/lib/postgresql/data
provides:
postgres-database:
Loading…
Cancel
Save