Commit a85ff7b1 authored by Vincent Pelletier's avatar Vincent Pelletier

{software,stack}/caucase: Add support for --backup-period

parent caedeaf8
......@@ -15,7 +15,7 @@
# not need these here).
[instance-caucased]
filename = instance-caucased.cfg.jinja2
md5sum = 9a9241dc87c9bda91ab2958bf874240a
md5sum = 361eea7fa660f550fd63afa53689142f
[instance]
filename = instance.cfg.jinja2
......
......@@ -31,6 +31,12 @@
"type": "integer",
"default": 1
},
"backup-period": {
"title": "Backup period",
"description": "Number of days between consecutive backups (0 to disable backup creation).",
"type": "number",
"default": 0
},
"key-length": {
"title": "Key length",
"description": "Size, in bits, of the SSL CAs (users and services) private keys generated by caucased.",
......
......@@ -2,12 +2,14 @@
{% set bind = (ipv6_set | list)[0] -%}
{% set base_port = slapparameter_dict.get('base-port', 8009) -%}
{% set default_netloc = '[' ~ bind ~ ']:' ~ base_port -%}
{% set backup_period = slapparameter_dict.get('backup-period', 0) -%}
[directory]
recipe = slapos.cookbook:mkdirectory
etc = ${buildout:directory}/etc
service-on-watch = ${:etc}/service
srv = ${buildout:directory}/srv
srv-backup-caucased = ${:srv}/backup/caucased
tmp = ${buildout:directory}/tmp
{{ caucase.caucased(
......@@ -22,6 +24,8 @@ tmp = ${buildout:directory}/tmp
key_len=slapparameter_dict.get('key-length', 2048),
bind=bind,
base_port=base_port,
backup_dir='${directory:srv-backup-caucased}' if backup_period else None,
backup_period=backup_period,
) }}
[publish]
......
......@@ -15,4 +15,4 @@
[caucase-jinja2-library]
filename = caucase.jinja2.library
md5sum = 11807649cec3fad190e79a7e80aa6a0e
md5sum = 82c3d836b69aeb39fd4d232745c53da0
......@@ -9,6 +9,7 @@
user_auto_approve_count=1,
key_len=None,
backup_dir=None,
backup_period=None,
bind=None,
base_port=None,
promise=True
......@@ -33,7 +34,7 @@ command-line = '{{ buildout_bin_directory }}/caucased'
{% if bind != None %}--bind '{{ bind }}' {%- endif %}
{% if base_port != None %}--base-port '{{ base_port }}' {%- endif %}
{% if key_len %}--key-len '{{ key_len }}' {%- endif %}
{% if backup_dir %}--backup-directory {{ backup_dir }} {%- endif %}
{% if backup_dir %}--backup-directory '{{ backup_dir }}' {% if backup_period != None %}--backup-period '{{ float(backup_period) }}' {%- endif %}{%- endif %}
--service-auto-approve-count '{{ service_auto_approve_count }}'
--user-auto-approve-count '{{ user_auto_approve_count }}'
--lock-auto-approve-count
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment