2
0
mirror of https://github.com/frappe/bench.git synced 2025-01-10 17:24:41 +00:00
bench/playbooks/develop/includes/setup_erpnext.yml

55 lines
1.7 KiB
YAML
Raw Normal View History

---
- name: Check if ERPNext App exists
stat: path="{{ bench_path }}/apps/erpnext"
register: app
- name: get erpnext
command: bench get-app erpnext https://github.com/frappe/erpnext --branch {{ branch }}
args:
creates: "{{ bench_path }}/apps/erpnext"
chdir: "{{ bench_path }}"
when: not app.stat.exists
- name: Check whether a site called site1.local exists
stat: path="{{ bench_path }}/sites/site1.local"
register: site_folder
2018-01-19 00:53:56 +00:00
- 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'
2018-01-18 22:44:15 +00:00
- 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
2018-01-19 00:53:56 +00:00
when: ansible_distribution == 'Ubuntu' or ansible_distribution == 'Debian'
2018-01-18 22:44:15 +00:00
- 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
- name: install erpnext to default site
command: bench --site site1.local install-app erpnext
args:
chdir: "{{ bench_path }}"