2
0
mirror of https://github.com/frappe/bench.git synced 2024-11-13 16:56:33 +00:00

[fix] seperate out roles from dev and prod installation

This commit is contained in:
Saurabh 2017-08-30 12:22:41 +05:30
parent a2e779ccb3
commit f5730b0828
59 changed files with 42 additions and 49 deletions

View File

@ -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:

View File

@ -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

View File

@ -1,4 +1,6 @@
---
#- include: setup_essentials.yml
- name: "Setup prerequisites"
hosts: localhost
become: yes
@ -95,4 +97,4 @@
- redis
- mariadb
- nodejs
when: ansible_distribution == 'MacOSX'
when: ansible_distribution == 'MacOSX'

View 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

View File

@ -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