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