From fc42800328c43cb74cf3f36b81c53c5603142a35 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Herv=C3=A9=20=20MENAGER?= <herve.menager@pasteur.fr>
Date: Mon, 7 Aug 2017 11:04:24 +0200
Subject: [PATCH] use deploy_user_name var in deploy step

Former-commit-id: 40484ee771d49f464144b56d21d4bf37a9780fd4
---
 ansible/deploy.yaml | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/ansible/deploy.yaml b/ansible/deploy.yaml
index 7e1493d2..fc31d0e6 100644
--- a/ansible/deploy.yaml
+++ b/ansible/deploy.yaml
@@ -10,22 +10,22 @@
   - name: stop iPPIDB service if relevant
     systemd: state=stopped name=ippidb-web
   - name: pull branch master
-    become_user: ippidb
+    become_user: "{{ deploy_user_name }}"
     git:
       repo=git@gitlab.pasteur.fr:odoppelt/iPPIDB.git
-      dest=/home/ippidb/iPPIDB
+      dest=/home/{{ deploy_user_name }}/iPPIDB
       accept_hostkey=yes
   - name: install python requirements
-    pip: requirements=/home/ippidb/iPPIDB/ippisite/requirements.txt extra_args=--upgrade executable=pip3
+    pip: requirements=/home/{{ deploy_user_name }}/iPPIDB/ippisite/requirements.txt extra_args=--upgrade executable=pip3
   - name: collect static files
-    become_user: ippidb
+    become_user: "{{ deploy_user_name }}"
     django_manage:
       command: "collectstatic"
-      app_path: "/home/ippidb/iPPIDB/ippisite"
+      app_path: "/home/{{ deploy_user_name }}/iPPIDB/ippisite"
   - name: create mod_wsgi configuration
     django_manage:
       command: "runmodwsgi --setup-only --port=80 --user ippidb --group wheel --server-root=/etc/ippidb-80"
-      app_path: "/home/ippidb/iPPIDB/ippisite"
+      app_path: "/home/{{ deploy_user_name }}/iPPIDB/ippisite"
   - name: restrict access to the web server to specific IPs
     lineinfile: dest=/etc/ippidb-80/httpd.conf 
                 regexp=''
@@ -34,7 +34,7 @@
   - name: copy systemd service file for IPPIDB-web
     copy: 
       remote_src: true
-      src: /home/ippidb/iPPIDB/ansible/ippidb-web.service 
+      src: /home/{{ deploy_user_name }}/iPPIDB/ansible/ippidb-web.service 
       dest: /lib/systemd/system/ippidb-web.service
       owner: root
       group: root
-- 
GitLab