mirror of
https://github.com/frappe/bench.git
synced 2024-11-11 15:51:03 +00:00
Bench setup failed on production fix (#546)
* Bench setup failed on production fix - mariadb 10.2 fix - root user used instead of frappe_user fix * fix for production on CentOS - selinux is set to permissive, in case of CentOS. This is needed to setup nginx - bench is installed in the /home/username directory and not /home/root
This commit is contained in:
parent
c828b24a80
commit
f85cbc87a8
@ -40,6 +40,10 @@
|
||||
notify: restart nginx
|
||||
when: setup_www_redirect
|
||||
|
||||
- name: Enable SELinux
|
||||
selinux: policy=targeted state=permissive
|
||||
when: ansible_distribution == 'CentOS'
|
||||
|
||||
- name: Ensure nginx is started and enabled to start at boot.
|
||||
service: name=nginx state=started enabled=yes
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
vars:
|
||||
bench_path: "/home/{{ ansible_user_id }}/{{ bench_name }}"
|
||||
bench_path: "/home/{{ frappe_user }}/{{ bench_name }}"
|
||||
|
||||
tasks:
|
||||
|
||||
@ -10,6 +10,33 @@
|
||||
stat: path="{{ bench_path }}/sites/{{ site }}"
|
||||
register: site_folder
|
||||
|
||||
- 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: 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 new site
|
||||
command: bench new-site {{ site }} --admin-password {{ admin_password }} --mariadb-root-password {{ mysql_root_password }}
|
||||
args:
|
||||
@ -36,9 +63,9 @@
|
||||
become: yes
|
||||
become_user: root
|
||||
file:
|
||||
dest: '{{ ansible_env.HOME }}'
|
||||
owner: '{{ ansible_user_id }}'
|
||||
group: '{{ ansible_user_id }}'
|
||||
dest: '/home/{{ frappe_user }}'
|
||||
owner: '{{ frappe_user }}'
|
||||
group: '{{ frappe_user }}'
|
||||
mode: 0755
|
||||
recurse: yes
|
||||
state: directory
|
||||
@ -46,14 +73,14 @@
|
||||
- name: Setup production
|
||||
become: yes
|
||||
become_user: root
|
||||
command: bench setup production {{ ansible_user_id }}
|
||||
command: bench setup production {{ frappe_user }}
|
||||
args:
|
||||
chdir: '{{ bench_path }}'
|
||||
|
||||
- name: Setup Sudoers
|
||||
become: yes
|
||||
become_user: root
|
||||
command: bench setup sudoers {{ ansible_user_id }}
|
||||
command: bench setup sudoers {{ frappe_user }}
|
||||
args:
|
||||
chdir: '{{ bench_path }}'
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
tasks:
|
||||
- name: insert/update inputrc for history
|
||||
blockinfile:
|
||||
dest: "/home/{{ ansible_user_id }}/.inputrc"
|
||||
dest: "/home/{{ frappe_user }}/.inputrc"
|
||||
create: yes
|
||||
block: |
|
||||
## arrow up
|
||||
|
Loading…
Reference in New Issue
Block a user