diff --git a/playbooks/develop/centos.yml b/playbooks/develop/centos.yml index 44e12e98..91e7fde7 100644 --- a/playbooks/develop/centos.yml +++ b/playbooks/develop/centos.yml @@ -47,7 +47,7 @@ - tk-devel # To ensure that ansible_lsb is set - - redhat-lsb-core + - redhat-lsb-core become: yes become_user: root @@ -62,3 +62,7 @@ # setup frappe-bench - include: includes/setup_bench.yml + + # setup development environment + - include: includes/setup_dev_env.yml + when: not setup_production diff --git a/playbooks/develop/includes/setup_bench.yml b/playbooks/develop/includes/setup_bench.yml index 71961081..ee5cc245 100644 --- a/playbooks/develop/includes/setup_bench.yml +++ b/playbooks/develop/includes/setup_bench.yml @@ -26,25 +26,3 @@ args: creates: "{{ bench_path }}/apps/frappe" chdir: "{{ bench_path }}" - - # setup procfile - - name: setup procfile - command: bench setup socketio - args: - creates: "{{ bench_path }}/node_modules" - chdir: "{{ bench_path }}" - - # setup procfile - - name: setup procfile - command: bench setup procfile - args: - creates: "{{ bench_path }}/Procfile" - chdir: "{{ bench_path }}" - - - # setup config for redis/socketio - - name: setup redis - command: bench setup redis - args: - creates: "{{ bench_path }}/config/redis_socketio.conf" - chdir: "{{ bench_path }}" diff --git a/playbooks/develop/includes/setup_dev_env.yml b/playbooks/develop/includes/setup_dev_env.yml new file mode 100644 index 00000000..3b54c2af --- /dev/null +++ b/playbooks/develop/includes/setup_dev_env.yml @@ -0,0 +1,22 @@ +--- + # Setup Socketio + - name: setup procfile + command: bench setup socketio + args: + creates: "{{ bench_path }}/node_modules" + chdir: "{{ bench_path }}" + + # Setup Procfile + - name: setup procfile + command: bench setup procfile + args: + creates: "{{ bench_path }}/Procfile" + chdir: "{{ bench_path }}" + + + # Setup Redis env for RQ + - name: setup redis + command: bench setup redis + args: + creates: "{{ bench_path }}/config/redis_socketio.conf" + chdir: "{{ bench_path }}" diff --git a/playbooks/develop/macosx.yml b/playbooks/develop/macosx.yml index fbc0418b..97174814 100644 --- a/playbooks/develop/macosx.yml +++ b/playbooks/develop/macosx.yml @@ -29,3 +29,6 @@ # setup frappe-bench - include: includes/setup_bench.yml + # setup development environment + - include: includes/setup_dev_env.yml + when: not setup_production diff --git a/playbooks/develop/ubuntu.yml b/playbooks/develop/ubuntu.yml index 7a731d35..6df197c3 100644 --- a/playbooks/develop/ubuntu.yml +++ b/playbooks/develop/ubuntu.yml @@ -70,3 +70,7 @@ # setup frappe-bench - include: includes/setup_bench.yml + + # setup development environment + - include: includes/setup_dev_env.yml + when: not setup_production diff --git a/playbooks/production/includes/setup_bench_production.yml b/playbooks/production/includes/setup_bench_production.yml index bf181b01..11428024 100644 --- a/playbooks/production/includes/setup_bench_production.yml +++ b/playbooks/production/includes/setup_bench_production.yml @@ -1,7 +1,7 @@ --- - hosts: localhost vars: - bench_path: "/home/{{ ansible_user_id }}/benches/frappe-bench" + bench_path: "/home/{{ ansible_user_id }}/frappe/frappe-bench" tasks: