diff --git a/playbooks/develop/includes/setup_bench.yml b/playbooks/develop/includes/setup_bench.yml index adeb1736..7b768c4c 100644 --- a/playbooks/develop/includes/setup_bench.yml +++ b/playbooks/develop/includes/setup_bench.yml @@ -12,8 +12,6 @@ - name: move /tmp/.bench if it exists command: 'cp -R /tmp/.bench {{ bench_repo_path }}' when: tmp_bench.stat.exists and not bench_repo_register.stat.exists - become: yes - become_user: frappe - name: install bench pip: name={{ bench_repo_path }} extra_args='-e' diff --git a/playbooks/develop/includes/setup_erpnext.yml b/playbooks/develop/includes/setup_erpnext.yml index c7b31f0f..33bb227b 100644 --- a/playbooks/develop/includes/setup_erpnext.yml +++ b/playbooks/develop/includes/setup_erpnext.yml @@ -14,27 +14,38 @@ stat: path="{{ bench_path }}/sites/site1.local" register: site_folder - - name: Link mysql.sock file for MariaDB - file: - src: "/var/lib/mysql/mysql.sock" - dest: "/var/run/mysqld/mysqld.sock" - state: link + - name: Add additional conf for MariaDB 10.2 in mariadb.conf.d + blockinfile: + path: /etc/mysql/conf.d/settings.cnf + block: | + # Import all .cnf files from configuration directory + !includedir /etc/mysql/mariadb.conf.d/ become: yes + become_user: root + when: ansible_distribution == 'Ubuntu' or ansible_distribution == 'Debian' - - name: Link mysql.pid file for MariaDB - file: - src: "/var/lib/mysql/mysql.pid" - dest: "/var/run/mysqld/mysqld.pid" - state: link + - name: Add additional conf for MariaDB 10.2 in mariadb.conf.d + blockinfile: + path: /etc/mysql/mariadb.conf.d/erpnext.cnf + block: | + [mysqld] + pid-file = /var/run/mysqld/mysqld.pid + socket = /var/run/mysqld/mysqld.sock + create: yes become: yes + become_user: root + when: ansible_distribution == 'Ubuntu' or ansible_distribution == 'Debian' + + - name: restart mysql + service: name=mysql state=restarted + become: yes + become_user: root - name: create a new default site command: bench new-site site1.local --admin-password {{ admin_password }} --mariadb-root-password {{ mysql_root_password }} args: chdir: "{{ bench_path }}" when: not site_folder.stat.exists - become: yes - become_user: frappe - name: install erpnext to default site command: bench --site site1.local install-app erpnext diff --git a/playbooks/develop/install.yml b/playbooks/develop/install.yml index 3f9b9a2d..bc67dbe8 100644 --- a/playbooks/develop/install.yml +++ b/playbooks/develop/install.yml @@ -13,8 +13,8 @@ - name: setup bench and dev environment hosts: localhost vars: - bench_repo_path: "/home/{{ ansible_user_id }}/.bench" - bench_path: "/home/{{ ansible_user_id }}/{{ bench_name }}" + bench_repo_path: "/home/{{ frappe_user }}/.bench" + bench_path: "/home/{{ frappe_user }}/{{ bench_name }}" tasks: # setup frappe-bench - include: includes/setup_bench.yml