diff --git a/playbooks/develop/create_user.yml b/playbooks/develop/create_user.yml index 5360e5fb..306dabc1 100755 --- a/playbooks/develop/create_user.yml +++ b/playbooks/develop/create_user.yml @@ -19,5 +19,5 @@ when: ansible_distribution == 'MacOSX' - name: Set /tmp/.bench folder perms - command: 'chown -R {{ frappe_user }}:{{ frappe_user }} {{ repo_path }}' + command: 'chown -R {{ frappe_user }}:{{ frappe_user }} {{ repo_path }}' when: ansible_distribution == 'Ubuntu' or ansible_distribution == 'CentOS' or ansible_distribution == 'Debian' \ No newline at end of file diff --git a/playbooks/develop/debian.yml b/playbooks/develop/debian.yml old mode 100644 new mode 100755 index e858be0c..88a0f55a --- a/playbooks/develop/debian.yml +++ b/playbooks/develop/debian.yml @@ -9,6 +9,22 @@ tasks: + - name: Add dotdeb apt repository key for Debian < 8 + apt_key: + url: http://www.dotdeb.org/dotdeb.gpg + state: present + become: yes + become_user: root + when: ansible_distribution == 'Debian' and ansible_distribution_version | version_compare('8', 'lt') + + - name: Add dotdeb apt repository for redis-server for Debian < 8 + apt_repository: + repo: 'deb http://packages.dotdeb.org wheezy all' + state: present + become: yes + become_user: root + when: ansible_distribution == 'Debian' and ansible_distribution_version | version_compare('8', 'lt') + # install pre-requisites - name: install prequisites apt: pkg={{ item }} state=present diff --git a/playbooks/install.py b/playbooks/install.py index 6e39eef3..ba734080 100755 --- a/playbooks/install.py +++ b/playbooks/install.py @@ -1,12 +1,12 @@ # wget setup_frappe.py | python -import os, sys, subprocess, getpass, json, multiprocessing, shutil +import os, sys, subprocess, getpass, json, multiprocessing, shutil, platform from distutils.spawn import find_executable tmp_bench_repo = '/tmp/.bench' def install_bench(args): + check_distribution_compatibility() check_brew_installed() - # pre-requisites for bench repo cloning install_package('curl') install_package('wget') @@ -113,6 +113,24 @@ def install_bench(args): if os.path.exists(tmp_bench_repo): shutil.rmtree(tmp_bench_repo) +def check_distribution_compatibility(): + supported_dists = {'ubuntu': [14, 15, 16], 'debian': [7, 8], 'centos': [7]} + dist_name, dist_version = get_distribution_info() + for dist, versions in supported_dists.iteritems(): + if dist_name == dist: + if dist_version in versions: + return + + print "We currently do not support {0} {1}. Aborting installation!".format(dist_name, dist_version) + if dist_name in supported_dists: + print "Install on {0} {1} instead".format(dist_name, supported_dists[dist_name][-1]) + sys.exit(1) + +def get_distribution_info(): + current_dist = platform.dist() + # return distribution name and major version + return current_dist[0].lower(), int(float(current_dist[1])) + def install_python27(): version = (sys.version_info[0], sys.version_info[1])