From aab2d0b10bdce88d15e4dae071552a5ca120b514 Mon Sep 17 00:00:00 2001 From: Soline Date: Thu, 15 Aug 2024 09:13:19 -0400 Subject: [PATCH] Add SARC installation --- defaults/main.yml | 10 ++++++++++ tasks/setup_users.yml | 25 +++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index 49c6500..d879127 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -130,3 +130,13 @@ clockwork_logging_level: "error" clockwork_settings_items_per_page: 25 clockwork_settings_dark_mode: false clockwork_settings_language: "en" + +# SARC +# Install path for SARC code +sarc_install_path: /opt/sarc +# SARC Git repository +sarc_repo: 'https://github.com/mila-iqia/SARC.git' +# SARC commit to checkout +sarc_checkout_commit: "master" +# Port used to access the database +sarc_mongo_port: 8123 \ No newline at end of file diff --git a/tasks/setup_users.yml b/tasks/setup_users.yml index ff595d7..9c2860f 100644 --- a/tasks/setup_users.yml +++ b/tasks/setup_users.yml @@ -24,6 +24,31 @@ state: directory owner: "{{ clockwork_user }}" +# SARC + +- name: Install git + ansible.builtin.apt: + pkg: + - git + +- name: Copy SARC code from git + ansible.builtin.git: + repo: '{{ sarc_repo }}' + dest: '{{ sarc_install_path }}' + version: '{{ sarc_checkout_commit }}' + accept_newhostkey: yes + +- name: Install Poetry + ansible.builtin.pip: + name: poetry + +- name: Install SARC by using Poetry + ansible.builtin.command: + cmd: poetry install + chdir: "{{sarc_install_path}}/SARC/" + +# LDAP + - name: Install ldap private key ansible.builtin.copy: content: "{{ clockwork_ldap_private_key }}"