mirror of
https://github.com/frappe/bench.git
synced 2024-11-14 09:14:04 +00:00
[fix] seperate out roles from dev and prod installation
This commit is contained in:
parent
a2e779ccb3
commit
f5730b0828
@ -1,26 +1,13 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
|
||||
- include: setup_essentials.yml
|
||||
|
||||
- include: ../prerequisites/install_prerequisites.yml
|
||||
|
||||
- include: ../prerequisites/install_roles.yml
|
||||
|
||||
- include: macosx.yml
|
||||
when: ansible_distribution == 'MacOSX'
|
||||
|
||||
- name: "Setup mariadb, wkhtmltopdf, nodejs and psutil"
|
||||
hosts: localhost
|
||||
become: yes
|
||||
become_user: root
|
||||
vars:
|
||||
mysql_conf_tpl: ../files/mariadb_config.cnf
|
||||
mysql_secure_installation: True
|
||||
roles:
|
||||
- { role: mariadb, tags: "mariadb" }
|
||||
- { role: wkhtmltopdf, tags: "wkhtmltopdf" }
|
||||
- { role: nodejs, tags: "nodejs" }
|
||||
- { role: psutil, tags: "psutil" }
|
||||
|
||||
- name: setup bench and dev environment
|
||||
hosts: localhost
|
||||
vars:
|
||||
|
@ -22,10 +22,9 @@
|
||||
- wkhtmltopdf
|
||||
|
||||
- name: configure mariadb
|
||||
include_role:
|
||||
name: mariadb
|
||||
include: ../prerequisites/roles/mariadb/main.yml
|
||||
vars:
|
||||
mysql_conf_tpl: ../files/mariadb_config.cnf
|
||||
mysql_conf_tpl: ../prerequisites/files/mariadb_config.cnf
|
||||
|
||||
- name: Install MySQLdb in global env
|
||||
pip: name=mysql-python version=1.2.5
|
||||
|
@ -1,4 +1,6 @@
|
||||
---
|
||||
#- include: setup_essentials.yml
|
||||
|
||||
- name: "Setup prerequisites"
|
||||
hosts: localhost
|
||||
become: yes
|
||||
|
35
playbooks/prerequisites/install_roles.yml
Normal file
35
playbooks/prerequisites/install_roles.yml
Normal file
@ -0,0 +1,35 @@
|
||||
---
|
||||
- name: Apply basic roles, mariadb, wkhtmltopdf, nodejs, nginx, fail2ban and psutil
|
||||
hosts: localhost
|
||||
become: yes
|
||||
become_user: root
|
||||
vars:
|
||||
- mysql_conf_tpl: files/mariadb_config.cnf
|
||||
- nginx_conf_file: files/nginx.conf
|
||||
- mysql_secure_installation: True
|
||||
roles:
|
||||
- { role: locale, tags: "locale" }
|
||||
- { role: swap, tags: "swap", when: production }
|
||||
- { role: logwatch, tags: "logwatch", when: production }
|
||||
- { role: bash_screen_wall, tags: "bash_screen_wall", when: production }
|
||||
- { role: frappe_selinux, tags: "frappe_selinux", when: production }
|
||||
- { role: dns_caching, tags: "dns_caching", when: production }
|
||||
- { role: ntpd, tags: "ntpd", when: production }
|
||||
- { role: mariadb, tags: "mariadb" }
|
||||
- { role: wkhtmltopdf, tags: "wkhtmltopdf" }
|
||||
- { role: nodejs, tags: "nodejs" }
|
||||
- { role: psutil, tags: "psutil" }
|
||||
- { role: nginx, tags: "nginx", when: production }
|
||||
- { role: fail2ban, tags: "fail2ban" , when: production }
|
||||
tasks:
|
||||
- name: Set hostname
|
||||
hostname: name='{{ hostname }}'
|
||||
when: hostname is defined and production
|
||||
|
||||
- name: Start NTPD
|
||||
service: name=ntpd state=started
|
||||
when: ansible_distribution == 'CentOS' and production
|
||||
|
||||
- name: Start NTPD
|
||||
service: name=ntp state=started
|
||||
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu' and production
|
@ -2,36 +2,6 @@
|
||||
# Install the common pre-requisites for the setting up bench
|
||||
- include: ../develop/install.yml
|
||||
|
||||
#install production pre-requisites
|
||||
- name: Apply basic roles
|
||||
hosts: localhost
|
||||
become: yes
|
||||
become_user: root
|
||||
vars:
|
||||
- nginx_conf_file: files/nginx.conf
|
||||
roles:
|
||||
- { role: locale, tags: "locale" }
|
||||
- { role: swap, tags: "swap" }
|
||||
- { role: logwatch, tags: "logwatch" }
|
||||
- { role: bash_screen_wall, tags: "bash_screen_wall" }
|
||||
- { role: frappe_selinux, tags: "frappe_selinux" }
|
||||
- { role: dns_caching, tags: "dns_caching" }
|
||||
- { role: ntpd, tags: "ntpd" }
|
||||
- { role: nginx, tags: "nginx" }
|
||||
- { role: fail2ban, tags: "fail2ban" }
|
||||
tasks:
|
||||
- name: Set hostname
|
||||
hostname: name='{{ hostname }}'
|
||||
when: hostname is defined
|
||||
|
||||
- name: Start NTPD
|
||||
service: name=ntpd state=started
|
||||
when: ansible_distribution == 'CentOS'
|
||||
|
||||
- name: Start NTPD
|
||||
service: name=ntp state=started
|
||||
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
|
||||
|
||||
- include: includes/setup_inputrc.yml
|
||||
|
||||
# Setup Bench for production environment
|
||||
|
Loading…
Reference in New Issue
Block a user