From 75d04efa7c7ac9827c3fe88b91c11fa4b2ff9cef Mon Sep 17 00:00:00 2001
From: Chris Hines <chris.hines@monash.edu>
Date: Fri, 26 May 2017 10:45:39 +1000
Subject: [PATCH] update the hpcsystems role to include the naggy_quota cronjob
 and update the tools via pip

---
 roles/hpcsystems/tasks/main.yml | 29 ++++++++++++++++++++++-------
 1 file changed, 22 insertions(+), 7 deletions(-)

diff --git a/roles/hpcsystems/tasks/main.yml b/roles/hpcsystems/tasks/main.yml
index 15c6947a..10109dfd 100644
--- a/roles/hpcsystems/tasks/main.yml
+++ b/roles/hpcsystems/tasks/main.yml
@@ -6,6 +6,7 @@
     - openldap-devel
     - python-pip
     - git
+    - python-virtualenv
   become: true
   become_user: root
   when: ansible_os_family == "RedHat"
@@ -19,21 +20,26 @@
   become_user: root
   when: ansible_os_family == "Debian"
 
-- name: install merypytools
-  pip:
-    name: "git+https://gitlab.erc.monash.edu.au/hpc-team/mercpytools.git#egg=mercpytools"
-    extra_args: "--upgrade"
-  become: true
-  become_user: root
-
 - name: create install dir
   file: name={{ item }} state=directory owner={{ ansible_user }}
   with_items:
    - "/usr/local/hpcsystem"
    - "/usr/local/hpcsystem_config"
+   - "/usr/local/virtualenvs/mercpytools"
   become: true
   become_user: root
 
+- name: upgrade pip
+  pip:
+    virtualenv: "/usr/local/virtualenvs/mercpytools"
+    name: "pip"
+    extra_args: "--upgrade"
+
+- name: install mercpytools
+  pip:
+    virtualenv: "/usr/local/virtualenvs/mercpytools"
+    name: "git+https://gitlab.erc.monash.edu.au/hpc-team/mercpytools.git#egg=mercpytools"
+    extra_args: "--upgrade"
 
 - name: install hpcsystem
   git: 
@@ -46,3 +52,12 @@
     repo: git@gitlab.erc.monash.edu.au:hpc-team/m3_hpcsystem_config.git
     dest: /usr/local/hpcsystem_config
     accept_hostkey: True
+
+- name: cron job to check quotas
+  cron:
+    name: "Naggy quota cron job"
+    value: '/usr/local/hpcsystem/naggy_quota.sh'
+    hour: 16
+    minute: 23
+  become: true
+  become_user: root
-- 
GitLab