From 9da896662048c4e1e649bfe9ce0eb86785a8193b Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Wed, 2 Nov 2016 12:25:22 +0100 Subject: [PATCH 01/13] Added configuration to autoRemoveOfflineServers as suggested from orientdb team https://github.com/orientechnologies/orientdb/issues/6862 to solve quorum issue --- orientdb/templates/orientdb-server-config.xml.j2 | 1 + 1 file changed, 1 insertion(+) diff --git a/orientdb/templates/orientdb-server-config.xml.j2 b/orientdb/templates/orientdb-server-config.xml.j2 index c856dc3e..9493c871 100644 --- a/orientdb/templates/orientdb-server-config.xml.j2 +++ b/orientdb/templates/orientdb-server-config.xml.j2 @@ -90,6 +90,7 @@ + From 4a16ab9bfe3d8b5e17f504d9256d466d1cebfb58 Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Wed, 2 Nov 2016 12:25:49 +0100 Subject: [PATCH 02/13] Upgraded resource-regsitry version --- smartgears/resource_registry/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smartgears/resource_registry/defaults/main.yml b/smartgears/resource_registry/defaults/main.yml index c2e0bcba..8e3fce69 100644 --- a/smartgears/resource_registry/defaults/main.yml +++ b/smartgears/resource_registry/defaults/main.yml @@ -3,7 +3,7 @@ resource_registry_install: False resource_registry_upgrade: False resource_registry_gcube_repository: gcube-snapshots resource_registry_snapshot_ver: 1.2.0-SNAPSHOT -resource_registry_version: 1.2.0-20161031.161302-32 +resource_registry_version: 1.2.0-20161102.112213-33 resource_registry_name: resource-registry resource_registry_file: '{{ resource_registry_name }}-{{ resource_registry_version }}.war' resource_registry_url: 'http://maven.research-infrastructures.eu/nexus/content/repositories/{{ resource_registry_gcube_repository }}/org/gcube/information-system/{{resource_registry_name}}/{{ resource_registry_snapshot_ver }}/{{ resource_registry_file }}' From 7fd6ec13b71818174796347298275a486b843592 Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Wed, 2 Nov 2016 12:32:37 +0100 Subject: [PATCH 03/13] Started to create automatic backup task refs #5608 --- orientdb/templates/automatic-backup.json.j2 | 11 +++++++++++ orientdb/templates/orientdb-server-config.xml.j2 | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 orientdb/templates/automatic-backup.json.j2 diff --git a/orientdb/templates/automatic-backup.json.j2 b/orientdb/templates/automatic-backup.json.j2 new file mode 100644 index 00000000..e5746123 --- /dev/null +++ b/orientdb/templates/automatic-backup.json.j2 @@ -0,0 +1,11 @@ +{ + "enabled": true, + "mode": "EXPORT", + "exportOptions": "", + "delay": "24h", + "firstTime": "23:00:00", + "targetDirectory": "backup", + "targetFileName": "${DBNAME}-${DATE:yyyyMMddHHmmss}.zip", + "compressionLevel": 9, + "bufferSize": 1048576 +} \ 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 9493c871..86b28080 100644 --- a/orientdb/templates/orientdb-server-config.xml.j2 +++ b/orientdb/templates/orientdb-server-config.xml.j2 @@ -27,7 +27,7 @@ - + From 0e9b8dfea94926efed0e2d7e25f15c04eb52d523 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Wed, 2 Nov 2016 12:37:49 +0100 Subject: [PATCH 04/13] d4science-ghn-cluster/orientdb.yml: Add 'serial' and 'max_fail_percentage' to the playbook. library/roles/orientdb/tasks/main.yml: Add a specific tag for the hooks task. --- orientdb/tasks/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/orientdb/tasks/main.yml b/orientdb/tasks/main.yml index 9bf01cc7..7a6f0ad4 100644 --- a/orientdb/tasks/main.yml +++ b/orientdb/tasks/main.yml @@ -35,11 +35,13 @@ - name: Remove the old hook jars shell: rm {{ orientdb_install_dir }}/lib/{{ item }} with_items: '{{ orientdb_hooks_to_be_removed | default([]) }}' + tags: [ 'orientdb', 'orientdb_hooks' ] - name: Fetch and install the hook jars get_url: url='{{ item }}' dest={{ orientdb_install_dir }}/lib with_items: '{{ orientdb_hooks_jars | default([]) }}' notify: Restart orientdb + tags: [ 'orientdb', 'orientdb_hooks' ] - name: Install the orientdb default settings template: src=orientdb.default.j2 dest=/etc/default/orientdb owner=root group=root mode=0444 From 8ac2ef8511664049ccc128df5ed61d94563d63cd Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Wed, 2 Nov 2016 12:54:24 +0100 Subject: [PATCH 05/13] 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 %} + From 997efd8676db949f2377c457d4474560c54fa642 Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Wed, 2 Nov 2016 13:08:55 +0100 Subject: [PATCH 06/13] Fixed backups diretory creation --- orientdb/defaults/main.yml | 2 +- orientdb/tasks/main.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/orientdb/defaults/main.yml b/orientdb/defaults/main.yml index 43dff34e..d163e13f 100644 --- a/orientdb/defaults/main.yml +++ b/orientdb/defaults/main.yml @@ -60,7 +60,7 @@ 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_directory: '{{ orientdb_home_prefix }}/{{ orientdb_user }}/backups' 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/tasks/main.yml b/orientdb/tasks/main.yml index 7a6f0ad4..8a572312 100644 --- a/orientdb/tasks/main.yml +++ b/orientdb/tasks/main.yml @@ -31,6 +31,7 @@ with_items: - '{{ orientdb_data_dir }}' - '{{ orientdb_pid_dir }}' + - '{{ orientdb_automatic_backup_directory }} - name: Remove the old hook jars shell: rm {{ orientdb_install_dir }}/lib/{{ item }} From 1f8f7c7ac0dad9e0340c2bf2504e378c50573441 Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Wed, 2 Nov 2016 13:10:41 +0100 Subject: [PATCH 07/13] Added missing ' to yaml file --- orientdb/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/orientdb/tasks/main.yml b/orientdb/tasks/main.yml index 8a572312..234159ac 100644 --- a/orientdb/tasks/main.yml +++ b/orientdb/tasks/main.yml @@ -31,7 +31,7 @@ with_items: - '{{ orientdb_data_dir }}' - '{{ orientdb_pid_dir }}' - - '{{ orientdb_automatic_backup_directory }} + - '{{ orientdb_automatic_backup_directory }}' - name: Remove the old hook jars shell: rm {{ orientdb_install_dir }}/lib/{{ item }} From 8af215ec05877f1cfe9d12758ecc276150876fa4 Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Wed, 2 Nov 2016 15:08:48 +0100 Subject: [PATCH 08/13] Fixed init script --- orientdb/templates/orientdb.init.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/orientdb/templates/orientdb.init.j2 b/orientdb/templates/orientdb.init.j2 index eefc591a..0ad1f4ce 100755 --- a/orientdb/templates/orientdb.init.j2 +++ b/orientdb/templates/orientdb.init.j2 @@ -29,7 +29,7 @@ start() { fi echo "Starting OrientDB server daemon..." cd "$ORIENTDB_DIR/bin" - su $ORIENTDB_USER -c "cd \"$ORIENTDB_DIR/bin\"; /usr/bin/nohup ./server.sh $ORIENTDB_SERVER_OPTS 1>{{ orientdb_log_dir }}/orientdb.log 2>{{ orientdb_log_dir }}/orientdb.err &" + su $ORIENTDB_USER -c "cd \"$ORIENTDB_DIR/bin\"; /usr/bin/nohup ./server.sh $ORIENTDB_SERVER_OPTS >> {{ orientdb_log_dir }}/orientdb.log 2>&1 &" } stop() { @@ -41,7 +41,7 @@ stop() { fi echo "Stopping OrientDB server daemon..." cd "$ORIENTDB_DIR/bin" - su $ORIENTDB_USER -c "cd \"$ORIENTDB_DIR/bin\"; /usr/bin/nohup ./shutdown.sh 1>>{{ orientdb_log_dir }}/orientdb.log 2>>{{ orientdb_log_dir }}/orientdb.err &" + su $ORIENTDB_USER -c "cd \"$ORIENTDB_DIR/bin\"; /usr/bin/nohup ./shutdown.sh >> {{ orientdb_log_dir }}/orientdb.log 2>&1 &" } status() { From f47344833e0501fd422bfae2abe7491ec97c39be Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Wed, 2 Nov 2016 15:12:34 +0100 Subject: [PATCH 09/13] Fixed task description --- orientdb/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/orientdb/tasks/main.yml b/orientdb/tasks/main.yml index 234159ac..8eb69e1e 100644 --- a/orientdb/tasks/main.yml +++ b/orientdb/tasks/main.yml @@ -24,7 +24,7 @@ become_user: '{{ orientdb_user }}' file: dest={{ orientdb_home_prefix }}/{{ orientdb_user }}/logs src={{ orientdb_log_dir }} state=link - - name: Create the databases directory inside the orientdb user home + - name: Create the needed directory inside the orientdb user home become: True become_user: '{{ orientdb_user }}' file: dest={{ item }} state=directory mode=0750 From 810d2ae9c905217f2c4bd9358bf648020d481b98 Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Wed, 2 Nov 2016 15:42:45 +0100 Subject: [PATCH 10/13] Fixed hazelcast configuration. name and value attribute of parameter tag were inverted --- orientdb/templates/orientdb-server-config.xml.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/orientdb/templates/orientdb-server-config.xml.j2 b/orientdb/templates/orientdb-server-config.xml.j2 index c3c9fba0..e70fb65a 100644 --- a/orientdb/templates/orientdb-server-config.xml.j2 +++ b/orientdb/templates/orientdb-server-config.xml.j2 @@ -10,7 +10,7 @@ - + From d84956e70a4986bbf7ab2553d1b3dde018465473 Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Wed, 2 Nov 2016 16:22:08 +0100 Subject: [PATCH 11/13] Fixed nodeName to hostname (not fully qualifyed) beacuse . cannot be used --- orientdb/templates/orientdb-server-config.xml.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/orientdb/templates/orientdb-server-config.xml.j2 b/orientdb/templates/orientdb-server-config.xml.j2 index e70fb65a..7c70423e 100644 --- a/orientdb/templates/orientdb-server-config.xml.j2 +++ b/orientdb/templates/orientdb-server-config.xml.j2 @@ -10,7 +10,7 @@ - + From 2e766d138f1e073745880f513d272fc449dc4d3e Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Wed, 2 Nov 2016 16:24:47 +0100 Subject: [PATCH 12/13] library/roles/letsencrypt-acmetool-client/tasks/main.yml: Add an update_cache to the letsencrypt package installation task. --- letsencrypt-acmetool-client/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/letsencrypt-acmetool-client/tasks/main.yml b/letsencrypt-acmetool-client/tasks/main.yml index 7b7a3e5d..f629569b 100644 --- a/letsencrypt-acmetool-client/tasks/main.yml +++ b/letsencrypt-acmetool-client/tasks/main.yml @@ -36,7 +36,7 @@ tags: letsencrypt - name: Install the letsencrypt acmetool package and some deps - apt: pkg={{ item }} state={{ letsencrypt_acme_pkg_state }} + apt: pkg={{ item }} state={{ letsencrypt_acme_pkg_state }} update_cache=yes cache_valid_time=3600 with_items: '{{ letsencrypt_acme_pkgs }}' when: - letsencrypt_acme_install From 48d6148d2e00468c9555c1b31d807e7032dccbca Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Wed, 2 Nov 2016 17:01:17 +0100 Subject: [PATCH 13/13] library/roles/R/tasks/r-installation.yml: Fix the task that installs packages from github. --- R/tasks/r-installation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/tasks/r-installation.yml b/R/tasks/r-installation.yml index 93af5b35..c87ec145 100644 --- a/R/tasks/r-installation.yml +++ b/R/tasks/r-installation.yml @@ -94,7 +94,7 @@ - name: Install R packages from github command: > - Rscript --slave --no-save --no-restore-history -e "if (! ('{{ item.plugin_name }}' %in% installed.packages()[,'Package'])) { require(devtools); require(methods) ; options(repos='{{ r_cran_mirror_site }}/') ; install_github('{{ item.plugin_name }}', '{{ item.github_user }}'); print('Added'); } else { print('Already Installed'); }" + Rscript --slave --no-save --no-restore-history -e "if (! ('{{ item.plugin_name }}' %in% installed.packages()[,'Package'])) { require(devtools); require(methods) ; options(repos='{{ r_cran_mirror_site }}/') ; install_github('{{ item.github_user }}/{{ item.plugin_name }}'); print('Added'); } else { print('Already Installed'); }" register: install_github_plugins_result failed_when: "install_github_plugins_result.rc != 0 or 'had non-zero exit status' in install_github_plugins_result.stderr" changed_when: "'Added' in install_github_plugins_result.stdout"