diff --git a/playbooks/develop/create_user.yml b/playbooks/develop/create_user.yml index 306dabc1..2980ed4e 100755 --- a/playbooks/develop/create_user.yml +++ b/playbooks/develop/create_user.yml @@ -10,14 +10,24 @@ file: path: '/home/{{ frappe_user }}' mode: 'o+rx' + owner: '{{ frappe_user }}' + group: '{{ frappe_user }}' + recurse: yes when: ansible_distribution == 'Ubuntu' or ansible_distribution == 'CentOS' or ansible_distribution == 'Debian' - name: Set home folder perms file: path: '/Users/{{ frappe_user }}' mode: 'o+rx' + owner: '{{ frappe_user }}' + group: '{{ frappe_user }}' + recurse: yes when: ansible_distribution == 'MacOSX' - name: Set /tmp/.bench folder perms - command: 'chown -R {{ frappe_user }}:{{ frappe_user }} {{ repo_path }}' + file: + path: '{{ repo_path }}' + owner: '{{ frappe_user }}' + group: '{{ frappe_user }}' + recurse: yes when: ansible_distribution == 'Ubuntu' or ansible_distribution == 'CentOS' or ansible_distribution == 'Debian' \ No newline at end of file diff --git a/playbooks/develop/includes/setup_bench.yml b/playbooks/develop/includes/setup_bench.yml index f25cf9f0..7b768c4c 100644 --- a/playbooks/develop/includes/setup_bench.yml +++ b/playbooks/develop/includes/setup_bench.yml @@ -18,6 +18,12 @@ become: yes become_user: root + - name: Overwrite bench if required + file: + state: absent + path: "{{ bench_path }}" + when: overwrite + - name: Check whether bench exists stat: path="{{ bench_path }}" register: bench_stat diff --git a/playbooks/install.py b/playbooks/install.py index 657cf465..65e6f35d 100755 --- a/playbooks/install.py +++ b/playbooks/install.py @@ -335,6 +335,10 @@ def parse_commandline_args(): parser.add_argument('--without-bench-setup', dest='without_bench_setup', action='store_true', default=False, help=argparse.SUPPRESS) + # whether to overwrite an existing bench + parser.add_argument('--overwrite', dest='overwrite', action='store_true', default=False, + help='Whether to overwrite an existing bench') + args = parser.parse_args() return args