From 4061c811d8c2745cb5025422570739b98477d292 Mon Sep 17 00:00:00 2001 From: Ameya Shenoy Date: Mon, 9 Apr 2018 11:53:51 +0530 Subject: [PATCH] Added option to set default site name --- playbooks/roles/bench/tasks/main.yml | 2 +- playbooks/roles/bench/tasks/setup_erpnext.yml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/playbooks/roles/bench/tasks/main.yml b/playbooks/roles/bench/tasks/main.yml index b6230e80..0a963b30 100644 --- a/playbooks/roles/bench/tasks/main.yml +++ b/playbooks/roles/bench/tasks/main.yml @@ -63,7 +63,7 @@ creates: "{{ bench_path }}/config/redis_socketio.conf" chdir: "{{ bench_path }}" - # Setup an ERPNext site called site1.local + # Setup an ERPNext site - include_tasks: setup_erpnext.yml when: not run_travis diff --git a/playbooks/roles/bench/tasks/setup_erpnext.yml b/playbooks/roles/bench/tasks/setup_erpnext.yml index 15e5106d..b7f83691 100644 --- a/playbooks/roles/bench/tasks/setup_erpnext.yml +++ b/playbooks/roles/bench/tasks/setup_erpnext.yml @@ -10,18 +10,18 @@ chdir: "{{ bench_path }}" when: not app.stat.exists - - name: Check whether a site called site1.local exists - stat: path="{{ bench_path }}/sites/site1.local" + - name: Check whether the site already exists + stat: path="{{ bench_path }}/sites/{{ site }}" register: site_folder - name: Create a new site - command: bench new-site site1.local --admin-password {{ admin_password }} --mariadb-root-password {{ mysql_root_password }} + command: "bench new-site {{ site }} --admin-password {{ admin_password }} --mariadb-root-password {{ mysql_root_password }}" args: chdir: "{{ bench_path }}" when: not site_folder.stat.exists - name: Install ERPNext to default site - command: bench --site site1.local install-app erpnext + command: "bench --site {{ site }} install-app erpnext" args: chdir: "{{ bench_path }}" ... \ No newline at end of file