From 8ac2ef8511664049ccc128df5ed61d94563d63cd Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Wed, 2 Nov 2016 12:54:24 +0100 Subject: [PATCH] Parametrized configuration file to create automatic backup task refs #5608 --- orientdb/defaults/main.yml | 13 +++++++++++++ orientdb/templates/automatic-backup.json.j2 | 18 +++++++++--------- .../templates/orientdb-server-config.xml.j2 | 6 +----- 3 files changed, 23 insertions(+), 14 deletions(-) diff --git a/orientdb/defaults/main.yml b/orientdb/defaults/main.yml index b264abd4..43dff34e 100644 --- a/orientdb/defaults/main.yml +++ b/orientdb/defaults/main.yml @@ -18,6 +18,7 @@ orientdb_configuration_files: - orientdb-server-config.xml - default-distributed-db-config.json - hazelcast.xml + - automatic-backup.json orientdb_letsencrypt_ssl_enabled: False @@ -51,3 +52,15 @@ orientbd_hazelcast_encryption: False orientdb_hazelcast_multicast_enabled: True orientdb_hazelcast_multicast_group: 235.1.1.1 orientdb_hazelcast_multicast_port: 2434 + + +# For Reference see http://orientdb.com/docs/2.2/Automatic-Backup.html +orientdb_automatic_backup: True +orientdb_automatic_backup_mode: 'EXPORT' +orientdb_automatic_backup_export_options: '' +orientdb_automatic_backup_delay: 24h +orientdb_automatic_backup_first_time: '23:00:00' +orientdb_automatic_backup_directory: '{{ orientdb_home_prefix }}/{{ orientdb_user }}/b' +orientdb_automatic_backup_target_file_name: '${DBNAME}-${DATE:yyyyMMddHHmmss}.zip' +orientdb_automatic_backup_compression_level: 9 +orientdb_automatic_backup_buffer_size: 1048576 \ No newline at end of file diff --git a/orientdb/templates/automatic-backup.json.j2 b/orientdb/templates/automatic-backup.json.j2 index e5746123..398b6429 100644 --- a/orientdb/templates/automatic-backup.json.j2 +++ b/orientdb/templates/automatic-backup.json.j2 @@ -1,11 +1,11 @@ { - "enabled": true, - "mode": "EXPORT", - "exportOptions": "", - "delay": "24h", - "firstTime": "23:00:00", - "targetDirectory": "backup", - "targetFileName": "${DBNAME}-${DATE:yyyyMMddHHmmss}.zip", - "compressionLevel": 9, - "bufferSize": 1048576 + "enabled": {{ orientdb_automatic_backup | ternary('true','false') }}, + "mode": "{{ orientdb_automatic_backup_mode }}", + "exportOptions": "{{ orientdb_automatic_backup_export_options }}", + "delay": "{{ orientdb_automatic_backup_delay }}", + "firstTime": "{{ orientdb_automatic_backup_first_time }}", + "targetDirectory": "{{ orientdb_automatic_backup_directory }}", + "targetFileName": "{{ orientdb_automatic_backup_target_file_name }}", + "compressionLevel": {{orientdb_automatic_backup_compression_level }}, + "bufferSize": {{ orientdb_automatic_backup_buffer_size }} } \ No newline at end of file diff --git a/orientdb/templates/orientdb-server-config.xml.j2 b/orientdb/templates/orientdb-server-config.xml.j2 index 86b28080..c3c9fba0 100644 --- a/orientdb/templates/orientdb-server-config.xml.j2 +++ b/orientdb/templates/orientdb-server-config.xml.j2 @@ -9,11 +9,7 @@ - {% if orientdb_distributed %} - - {% else %} - - {% endif %} +