mirror of
https://github.com/frappe/bench.git
synced 2025-02-03 11:28:24 +00:00
Refactor code
- bumped up ansible from 2.3.1 to 2.4.1 - renamed include to include_tasks since it has been deprecated in ansible 2.4
This commit is contained in:
parent
2cd29aca71
commit
c7062e1b38
@ -17,4 +17,4 @@
|
|||||||
|
|
||||||
|
|
||||||
# Setup an ERPNext site called site1.local
|
# Setup an ERPNext site called site1.local
|
||||||
- include: includes/setup_erpnext.yml
|
- include_tasks: includes/setup_erpnext.yml
|
@ -1,13 +1,13 @@
|
|||||||
---
|
---
|
||||||
- hosts: localhost
|
- hosts: localhost
|
||||||
|
|
||||||
- include: ../prerequisites/install_prerequisites.yml
|
- include_tasks: ../prerequisites/install_prerequisites.yml
|
||||||
when: ansible_distribution != 'MacOSX'
|
when: ansible_distribution != 'MacOSX'
|
||||||
|
|
||||||
- include: ../prerequisites/install_roles.yml
|
- include_tasks: ../prerequisites/install_roles.yml
|
||||||
when: ansible_distribution != 'MacOSX'
|
when: ansible_distribution != 'MacOSX'
|
||||||
|
|
||||||
- include: macosx.yml
|
- include_tasks: macosx.yml
|
||||||
when: ansible_distribution == 'MacOSX'
|
when: ansible_distribution == 'MacOSX'
|
||||||
|
|
||||||
- name: setup bench and dev environment
|
- name: setup bench and dev environment
|
||||||
@ -17,9 +17,9 @@
|
|||||||
bench_path: "/home/{{ frappe_user }}/{{ bench_name }}"
|
bench_path: "/home/{{ frappe_user }}/{{ bench_name }}"
|
||||||
tasks:
|
tasks:
|
||||||
# setup frappe-bench
|
# setup frappe-bench
|
||||||
- include: includes/setup_bench.yml
|
- include_tasks: includes/setup_bench.yml
|
||||||
when: not run_travis and not without_bench_setup
|
when: not run_travis and not without_bench_setup
|
||||||
|
|
||||||
# setup development environment
|
# setup development environment
|
||||||
- include: includes/setup_dev_env.yml
|
- include_tasks: includes/setup_dev_env.yml
|
||||||
when: not run_travis and not production and (not without_bench_setup and ansible_distribution == 'Ubuntu')
|
when: not run_travis and not production and (not without_bench_setup and ansible_distribution == 'Ubuntu')
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
- wkhtmltopdf
|
- wkhtmltopdf
|
||||||
|
|
||||||
- name: configure mariadb
|
- name: configure mariadb
|
||||||
include: ../prerequisites/roles/mariadb/tasks/main.yml
|
include_tasks: ../prerequisites/roles/mariadb/tasks/main.yml
|
||||||
vars:
|
vars:
|
||||||
mysql_conf_tpl: ../prerequisites/files/mariadb_config.cnf
|
mysql_conf_tpl: ../prerequisites/files/mariadb_config.cnf
|
||||||
|
|
||||||
@ -30,9 +30,9 @@
|
|||||||
pip: name=mysql-python version=1.2.5
|
pip: name=mysql-python version=1.2.5
|
||||||
|
|
||||||
# setup frappe-bench
|
# setup frappe-bench
|
||||||
- include: includes/setup_bench.yml
|
- include_tasks: includes/setup_bench.yml
|
||||||
|
|
||||||
# setup development environment
|
# setup development environment
|
||||||
- include: includes/setup_dev_env.yml
|
- include_tasks: includes/setup_dev_env.yml
|
||||||
when: not production
|
when: not production
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ def install_bench(args):
|
|||||||
})
|
})
|
||||||
|
|
||||||
success = run_os_command({
|
success = run_os_command({
|
||||||
'pip': "sudo pip install ansible==2.3.1"
|
'pip': "sudo pip install ansible==2.4.1"
|
||||||
})
|
})
|
||||||
|
|
||||||
if not success:
|
if not success:
|
||||||
@ -93,7 +93,7 @@ def install_bench(args):
|
|||||||
repo_path = os.path.join(os.path.expanduser('~'), 'bench')
|
repo_path = os.path.join(os.path.expanduser('~'), 'bench')
|
||||||
|
|
||||||
extra_vars.update(repo_path=repo_path)
|
extra_vars.update(repo_path=repo_path)
|
||||||
run_playbook('develop/create_user.yml', extra_vars=extra_vars)
|
run_playbook('prerequisites/create_user.yml', extra_vars=extra_vars)
|
||||||
|
|
||||||
extra_vars.update(get_passwords(args))
|
extra_vars.update(get_passwords(args))
|
||||||
if args.production:
|
if args.production:
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
#- include: setup_essentials.yml
|
#- include_tasks: setup_essentials.yml
|
||||||
|
|
||||||
- name: "Setup prerequisites"
|
- name: "Setup prerequisites"
|
||||||
hosts: localhost
|
hosts: localhost
|
||||||
@ -80,10 +80,10 @@
|
|||||||
- libldap2-dev
|
- libldap2-dev
|
||||||
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
|
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
|
||||||
|
|
||||||
- include: ubuntu.yml
|
- include_tasks: ubuntu.yml
|
||||||
when: ansible_distribution == 'Ubuntu'
|
when: ansible_distribution == 'Ubuntu'
|
||||||
|
|
||||||
- include: debian.yml
|
- include_tasks: debian.yml
|
||||||
when: ansible_distribution == 'Debian'
|
when: ansible_distribution == 'Debian'
|
||||||
|
|
||||||
# Prerequisite for MACOS
|
# Prerequisite for MACOS
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
---
|
---
|
||||||
- include: centos.yml
|
- include_tasks: centos.yml
|
||||||
when: ansible_distribution == 'CentOS' and ansible_distribution_major_version|int >= 6
|
when: ansible_distribution == 'CentOS' and ansible_distribution_major_version|int >= 6
|
||||||
|
|
||||||
- include: ubuntu.yml
|
- include_tasks: ubuntu.yml
|
||||||
when: ansible_distribution == 'Ubuntu'
|
when: ansible_distribution == 'Ubuntu'
|
||||||
|
|
||||||
- name: Add configuration
|
- name: Add configuration
|
||||||
@ -10,7 +10,7 @@
|
|||||||
when: mysql_conf_tpl != 'change_me' and ansible_distribution != 'Debian'
|
when: mysql_conf_tpl != 'change_me' and ansible_distribution != 'Debian'
|
||||||
notify: restart mysql
|
notify: restart mysql
|
||||||
|
|
||||||
- include: debian.yml
|
- include_tasks: debian.yml
|
||||||
when: ansible_distribution == 'Debian'
|
when: ansible_distribution == 'Debian'
|
||||||
|
|
||||||
- name: Add configuration
|
- name: Add configuration
|
||||||
@ -24,7 +24,7 @@
|
|||||||
- debug:
|
- debug:
|
||||||
msg: "{{ mysql_root_password }}"
|
msg: "{{ mysql_root_password }}"
|
||||||
|
|
||||||
- include: mysql_secure_installation.yml
|
- include_tasks: mysql_secure_installation.yml
|
||||||
when: mysql_root_password is defined
|
when: mysql_root_password is defined
|
||||||
|
|
||||||
- debug: var=mysql_secure_installation
|
- debug: var=mysql_secure_installation
|
||||||
|
@ -9,10 +9,10 @@
|
|||||||
when: nginx_user is not defined
|
when: nginx_user is not defined
|
||||||
|
|
||||||
# Setup/install tasks.
|
# Setup/install tasks.
|
||||||
- include: setup-RedHat.yml
|
- include_tasks: setup-RedHat.yml
|
||||||
when: ansible_os_family == 'RedHat'
|
when: ansible_os_family == 'RedHat'
|
||||||
|
|
||||||
- include: setup-Debian.yml
|
- include_tasks: setup-Debian.yml
|
||||||
when: ansible_os_family == 'Debian'
|
when: ansible_os_family == 'Debian'
|
||||||
|
|
||||||
# Replace default nginx config with nginx template
|
# Replace default nginx config with nginx template
|
||||||
@ -47,4 +47,4 @@
|
|||||||
- name: Ensure nginx is started and enabled to start at boot.
|
- name: Ensure nginx is started and enabled to start at boot.
|
||||||
service: name=nginx state=started enabled=yes
|
service: name=nginx state=started enabled=yes
|
||||||
|
|
||||||
- include: vhosts.yml
|
- include_tasks: vhosts.yml
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
---
|
---
|
||||||
- include: ../prerequisites/roles/fail2ban/tasks/configure_nginx_jail.yml
|
- include_tasks: ../prerequisites/roles/fail2ban/tasks/configure_nginx_jail.yml
|
@ -1,9 +1,9 @@
|
|||||||
---
|
---
|
||||||
# Install the common pre-requisites for the setting up bench
|
# Install the common pre-requisites for the setting up bench
|
||||||
- include: ../develop/install.yml
|
- include_tasks: ../develop/install.yml
|
||||||
|
|
||||||
- include: includes/setup_inputrc.yml
|
- include_tasks: includes/setup_inputrc.yml
|
||||||
|
|
||||||
# Setup Bench for production environment
|
# Setup Bench for production environment
|
||||||
- include: includes/setup_bench_production.yml
|
- include_tasks: includes/setup_bench_production.yml
|
||||||
when: not run_travis
|
when: not run_travis
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
---
|
---
|
||||||
- include: centos.yml
|
- include_tasks: centos.yml
|
||||||
when: ansible_distribution == 'CentOS' and ansible_distribution_major_version|int >= 6
|
when: ansible_distribution == 'CentOS' and ansible_distribution_major_version|int >= 6
|
||||||
|
|
||||||
- include: ubuntu.yml
|
- include_tasks: ubuntu.yml
|
||||||
when: ansible_distribution == 'Ubuntu' and ansible_distribution_version == '14.04'
|
when: ansible_distribution == 'Ubuntu' and ansible_distribution_version == '14.04'
|
||||||
|
|
||||||
- name: Add configuration
|
- name: Add configuration
|
||||||
@ -13,6 +13,6 @@
|
|||||||
- name: Start and enable service
|
- name: Start and enable service
|
||||||
service: name=mysql state=started enabled=yes
|
service: name=mysql state=started enabled=yes
|
||||||
|
|
||||||
- include: mysql_secure_installation.yml
|
- include_tasks: mysql_secure_installation.yml
|
||||||
debug: var=mysql_secure_installation
|
debug: var=mysql_secure_installation
|
||||||
when: mysql_secure_installation and mysql_root_password is defined
|
when: mysql_secure_installation and mysql_root_password is defined
|
||||||
|
@ -9,10 +9,10 @@
|
|||||||
when: nginx_user is not defined
|
when: nginx_user is not defined
|
||||||
|
|
||||||
# Setup/install tasks.
|
# Setup/install tasks.
|
||||||
- include: setup-RedHat.yml
|
- include_tasks: setup-RedHat.yml
|
||||||
when: ansible_os_family == 'RedHat'
|
when: ansible_os_family == 'RedHat'
|
||||||
|
|
||||||
- include: setup-Debian.yml
|
- include_tasks: setup-Debian.yml
|
||||||
when: ansible_os_family == 'Debian'
|
when: ansible_os_family == 'Debian'
|
||||||
|
|
||||||
# Nginx setup.
|
# Nginx setup.
|
||||||
@ -28,4 +28,4 @@
|
|||||||
- name: Ensure nginx is started and enabled to start at boot.
|
- name: Ensure nginx is started and enabled to start at boot.
|
||||||
service: name=nginx state=started enabled=yes
|
service: name=nginx state=started enabled=yes
|
||||||
|
|
||||||
- include: vhosts.yml
|
- include_tasks: vhosts.yml
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
- include: base.yml
|
- include_tasks: base.yml
|
||||||
- name: Clone bench
|
- name: Clone bench
|
||||||
hosts: all
|
hosts: all
|
||||||
user: "{{ frappe_user }}"
|
user: "{{ frappe_user }}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user