From 4f09f023363227ba6489b8c29b14cc920fa5ca73 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Fri, 23 Sep 2016 19:07:39 +0200 Subject: [PATCH] library/roles/orientdb: First bits of a orientdb role. --- orientdb/defaults/main.yml | 8 ++++++++ orientdb/tasks/main.yml | 22 ++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 orientdb/defaults/main.yml create mode 100644 orientdb/tasks/main.yml diff --git a/orientdb/defaults/main.yml b/orientdb/defaults/main.yml new file mode 100644 index 0000000..40cb329 --- /dev/null +++ b/orientdb/defaults/main.yml @@ -0,0 +1,8 @@ +--- +orientdb_install: False +orientdb_version: 2.2.10 +orientdb_dir: 'orientdb-community' +orientdb_tar_file: '{{ orientdb_dir }}-{{ orientdb_version }}.tar.gz' +orientdb_binary_distribution_url: 'http://orientdb.com/download.php?file={{ orientdb_tar_file }}' +orientdb_user: orientdb +orientdb_home_prefix: /home diff --git a/orientdb/tasks/main.yml b/orientdb/tasks/main.yml new file mode 100644 index 0000000..51a8a28 --- /dev/null +++ b/orientdb/tasks/main.yml @@ -0,0 +1,22 @@ +--- +- block: + - name: Create the orientdb user + user: name={{ orientdb_user }} home={{ orientdb_home_prefix }}/{{ orientdb_user }} createhome=yes shell=/bin/bash + + # - name: Get the orientdb distribution + # get_url: url={{ orientdb_binary_distribution_url }} dest=/srv/{{ orientdb_tar_file }} validate_certs=False + + - name: Unpack the orientdb distribution + become: True + become_user: '{{ orientdb_user }}' + unarchive: src={{ orientdb_binary_distribution_url }} dest={{ orientdb_home_prefix }}/{{ orientdb_user }} copy=no + args: + creates: '{{ orientdb_home_prefix }}/{{ orientdb_user }}/{{ orientdb_dir }}-{{ orientdb_version }}' + + - name: Link to the latest version + become: True + become_user: '{{ orientdb_user }}' + file: src={{ orientdb_dir }}-{{ orientdb_version }} dest={{ orientdb_home_prefix }}/{{ orientdb_user }}/{{ orientdb_dir }} state=link + + tags: orientdb + when: orientdb_install