From a04f45b0d979c9f051c079867136c9562266826e Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Mon, 15 May 2017 17:43:37 +0200 Subject: [PATCH 1/4] Add --overwrite argument --- playbooks/install.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/playbooks/install.py b/playbooks/install.py index 657cf465..e61dd298 100755 --- a/playbooks/install.py +++ b/playbooks/install.py @@ -335,6 +335,9 @@ 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) + args = parser.parse_args() return args From c21554519f8766bdb12a6f658fd2f1a147769de5 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Mon, 15 May 2017 17:44:47 +0200 Subject: [PATCH 2/4] Set directory permissions recursively --- playbooks/develop/create_user.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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 From b38ba7f7b5add5935513f5ed42832efb84417ab4 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Mon, 15 May 2017 17:45:26 +0200 Subject: [PATCH 3/4] Remove bench dir for new install --- playbooks/develop/includes/setup_bench.yml | 6 ++++++ 1 file changed, 6 insertions(+) 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 From 6d2afdd9ec4684595bc40bfa84de8e7190117607 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Mon, 15 May 2017 21:39:35 +0200 Subject: [PATCH 4/4] Add overwrite help message --- playbooks/install.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/playbooks/install.py b/playbooks/install.py index e61dd298..65e6f35d 100755 --- a/playbooks/install.py +++ b/playbooks/install.py @@ -336,7 +336,8 @@ def parse_commandline_args(): help=argparse.SUPPRESS) # whether to overwrite an existing bench - parser.add_argument('--overwrite', dest='overwrite', action='store_true', default=False) + parser.add_argument('--overwrite', dest='overwrite', action='store_true', default=False, + help='Whether to overwrite an existing bench') args = parser.parse_args()