From e360b0702ad6d6db4d3b203794fb2bf599a900aa Mon Sep 17 00:00:00 2001 From: Saurabh Date: Mon, 28 Aug 2017 19:10:38 +0530 Subject: [PATCH] [fix] provision to specify bench name explicitly --- playbooks/develop/centos.yml | 2 +- playbooks/develop/includes/setup_mariadb.yml | 40 -------------------- playbooks/install.py | 4 ++ 3 files changed, 5 insertions(+), 41 deletions(-) delete mode 100644 playbooks/develop/includes/setup_mariadb.yml diff --git a/playbooks/develop/centos.yml b/playbooks/develop/centos.yml index 292360d9..571795aa 100755 --- a/playbooks/develop/centos.yml +++ b/playbooks/develop/centos.yml @@ -19,7 +19,7 @@ hosts: localhost vars: bench_repo_path: "/home/{{ ansible_user_id }}/.bench" - bench_path: "/home/{{ ansible_user_id }}/frappe-bench" + bench_path: "/home/{{ ansible_user_id }}/{{ bench_name }}" tasks: # setup frappe-bench - include: includes/setup_bench.yml diff --git a/playbooks/develop/includes/setup_mariadb.yml b/playbooks/develop/includes/setup_mariadb.yml deleted file mode 100644 index 2f563742..00000000 --- a/playbooks/develop/includes/setup_mariadb.yml +++ /dev/null @@ -1,40 +0,0 @@ ---- - - name: Install MySQLdb in global env - pip: name=mysql-python version=1.2.5 - become: yes - become_user: root - - - name: Add configuration - template: src={{ mysql_config_template }} dest={{ mysql_conf_dir }}/frappe.cnf owner=root mode=0644 - become: yes - become_user: root - - - name: restart mysql linux - service: name=mysql state=restarted - become: yes - become_user: root - when: ansible_os_family == 'RedHat' or ansible_os_family == 'Debian' - - - name: Set root Password - command: mysqladmin -u root password {{ mysql_root_password }} - become: yes - become_user: root - when: mysql_root_password is defined - # incase root password is already set - ignore_errors: yes - - - name: add launchagents folder mac - file: path=~/Library/LaunchAgents state=directory - when: ansible_distribution == 'MacOSX' - - - name: add mysql to mac startup - file: src=/usr/local/opt/mariadb/homebrew.mxcl.mariadb.plist path=~/Library/LaunchAgents/homebrew.mxcl.mariadb.plist state=link force=yes - when: ansible_distribution == 'MacOSX' - - - name: stop mysql mac - command: launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mariadb.plist - when: ansible_distribution == 'MacOSX' - - - name: start mysql mac - command: launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mariadb.plist - when: ansible_distribution == 'MacOSX' diff --git a/playbooks/install.py b/playbooks/install.py index 1c6f7406..24c2d29e 100755 --- a/playbooks/install.py +++ b/playbooks/install.py @@ -103,6 +103,9 @@ def install_bench(args): branch = 'master' if args.production else 'develop' extra_vars.update(branch=branch) + + bench_name = 'frappe-bench' if not args.bench_name else args.bench_name + extra_vars.update(bench_name=bench_name) if args.develop: run_playbook('develop/install.yml', sudo=True, extra_vars=extra_vars) @@ -364,6 +367,7 @@ def parse_commandline_args(): # set passwords parser.add_argument('--mysql-root-password', dest='mysql_root_password', help='Set mysql root password') parser.add_argument('--admin-password', dest='admin_password', help='Set admin password') + parser.add_argument('--bench-name', dest='bench_name', help='Create bench with specified name. Default name is frappe-bench') args = parser.parse_args()