mirror of
https://github.com/frappe/bench.git
synced 2024-11-14 17:24:04 +00:00
compatibility with bench setup and install cmds
This commit is contained in:
parent
ebda0be772
commit
a9a327cff9
@ -10,7 +10,6 @@ def install():
|
|||||||
|
|
||||||
@click.command('prerequisites')
|
@click.command('prerequisites')
|
||||||
def install_prerequisites():
|
def install_prerequisites():
|
||||||
"Install prerequisites"
|
|
||||||
run_playbook('site.yml', tag='common, redis')
|
run_playbook('site.yml', tag='common, redis')
|
||||||
|
|
||||||
@click.command('mariadb')
|
@click.command('mariadb')
|
||||||
@ -19,31 +18,31 @@ def install_maridb(mysql_root_password=''):
|
|||||||
if mysql_root_password:
|
if mysql_root_password:
|
||||||
extra_vars.update({"mysql_root_password": mysql_root_password})
|
extra_vars.update({"mysql_root_password": mysql_root_password})
|
||||||
|
|
||||||
run_playbook('prerequisites/install_roles.yml', extra_vars=extra_vars, tag='mariadb')
|
run_playbook('site.yml', extra_vars=extra_vars, tag='mariadb')
|
||||||
|
|
||||||
@click.command('wkhtmltopdf')
|
@click.command('wkhtmltopdf')
|
||||||
def install_wkhtmltopdf():
|
def install_wkhtmltopdf():
|
||||||
run_playbook('prerequisites/install_roles.yml', extra_vars=extra_vars, tag='wkhtmltopdf')
|
run_playbook('site.yml', extra_vars=extra_vars, tag='wkhtmltopdf')
|
||||||
|
|
||||||
@click.command('nodejs')
|
@click.command('nodejs')
|
||||||
def install_nodejs():
|
def install_nodejs():
|
||||||
run_playbook('prerequisites/install_roles.yml', extra_vars=extra_vars, tag='nodejs')
|
run_playbook('site.yml', extra_vars=extra_vars, tag='nodejs')
|
||||||
|
|
||||||
@click.command('psutil')
|
@click.command('psutil')
|
||||||
def install_psutil():
|
def install_psutil():
|
||||||
run_playbook('prerequisites/install_roles.yml', extra_vars=extra_vars, tag='psutil')
|
run_playbook('site.yml', extra_vars=extra_vars, tag='psutil')
|
||||||
|
|
||||||
@click.command('supervisor')
|
@click.command('supervisor')
|
||||||
@click.option('--user')
|
@click.option('--user')
|
||||||
def install_supervisor(user=None):
|
def install_supervisor(user=None):
|
||||||
run_playbook('prerequisites/install_roles.yml', extra_vars=extra_vars, tag='supervisor')
|
run_playbook('site.yml', extra_vars=extra_vars, tag='supervisor')
|
||||||
if user:
|
if user:
|
||||||
setup_sudoers(user)
|
setup_sudoers(user)
|
||||||
|
|
||||||
@click.command('nginx')
|
@click.command('nginx')
|
||||||
@click.option('--user')
|
@click.option('--user')
|
||||||
def install_nginx(user=None):
|
def install_nginx(user=None):
|
||||||
run_playbook('prerequisites/install_roles.yml', extra_vars=extra_vars, tag='nginx')
|
run_playbook('site.yml', extra_vars=extra_vars, tag='nginx')
|
||||||
if user:
|
if user:
|
||||||
setup_sudoers(user)
|
setup_sudoers(user)
|
||||||
|
|
||||||
@ -53,7 +52,7 @@ def install_nginx(user=None):
|
|||||||
@click.option('--findtime', default=600, help='Duration (in seconds) for IP to be banned for. Negative number for "permanent" ban.')
|
@click.option('--findtime', default=600, help='Duration (in seconds) for IP to be banned for. Negative number for "permanent" ban.')
|
||||||
def install_failtoban(**kwargs):
|
def install_failtoban(**kwargs):
|
||||||
extra_vars.update(kwargs)
|
extra_vars.update(kwargs)
|
||||||
run_playbook('prerequisites/install_roles.yml', extra_vars=extra_vars, tag='fail2ban')
|
run_playbook('site.yml', extra_vars=extra_vars, tag='fail2ban')
|
||||||
|
|
||||||
install.add_command(install_prerequisites)
|
install.add_command(install_prerequisites)
|
||||||
install.add_command(install_maridb)
|
install.add_command(install_maridb)
|
||||||
|
@ -89,7 +89,7 @@ def setup_firewall(ssh_port=None, force=False):
|
|||||||
if not ssh_port:
|
if not ssh_port:
|
||||||
ssh_port = 22
|
ssh_port = 22
|
||||||
|
|
||||||
run_playbook('production/setup_firewall.yml', {"ssh_port": ssh_port})
|
run_playbook('roles/bench/tasks/setup_firewall.yml', {"ssh_port": ssh_port})
|
||||||
|
|
||||||
@click.command('ssh-port')
|
@click.command('ssh-port')
|
||||||
@click.argument('port')
|
@click.argument('port')
|
||||||
@ -103,7 +103,7 @@ def set_ssh_port(port, force=False):
|
|||||||
'Do you want to continue?'.format(port),
|
'Do you want to continue?'.format(port),
|
||||||
abort=True)
|
abort=True)
|
||||||
|
|
||||||
run_playbook('production/change_ssh_port.yml', {"ssh_port": port})
|
run_playbook('roles/bench/tasks/change_ssh_port.yml', {"ssh_port": port})
|
||||||
|
|
||||||
@click.command('lets-encrypt')
|
@click.command('lets-encrypt')
|
||||||
@click.argument('site')
|
@click.argument('site')
|
||||||
@ -214,9 +214,9 @@ def setup_roles(role, **kwargs):
|
|||||||
extra_vars.update(kwargs)
|
extra_vars.update(kwargs)
|
||||||
|
|
||||||
if role:
|
if role:
|
||||||
run_playbook('prerequisites/install_roles.yml', extra_vars=extra_vars, tag=role)
|
run_playbook('site.yml', extra_vars=extra_vars, tag=role)
|
||||||
else:
|
else:
|
||||||
run_playbook('prerequisites/install_roles.yml', extra_vars=extra_vars)
|
run_playbook('site.yml', extra_vars=extra_vars)
|
||||||
|
|
||||||
@click.command('fail2ban')
|
@click.command('fail2ban')
|
||||||
@click.option('--maxretry', default=6, help="Number of matches (i.e. value of the counter) which triggers ban action on the IP. Default is 6 seconds" )
|
@click.option('--maxretry', default=6, help="Number of matches (i.e. value of the counter) which triggers ban action on the IP. Default is 6 seconds" )
|
||||||
@ -224,7 +224,7 @@ def setup_roles(role, **kwargs):
|
|||||||
@click.option('--findtime', default=600, help='Duration (in seconds) for IP to be banned for. Negative number for "permanent" ban. Default is 600 seconds')
|
@click.option('--findtime', default=600, help='Duration (in seconds) for IP to be banned for. Negative number for "permanent" ban. Default is 600 seconds')
|
||||||
def setup_nginx_proxy_jail(**kwargs):
|
def setup_nginx_proxy_jail(**kwargs):
|
||||||
from bench.utils import run_playbook
|
from bench.utils import run_playbook
|
||||||
run_playbook('prerequisites/setup_nginx_proxy_jail.yml', extra_vars=kwargs)
|
run_playbook('roles/fail2ban/tasks/configure_nginx_jail.yml', extra_vars=kwargs)
|
||||||
|
|
||||||
setup.add_command(setup_sudoers)
|
setup.add_command(setup_sudoers)
|
||||||
setup.add_command(setup_nginx)
|
setup.add_command(setup_nginx)
|
||||||
|
@ -22,9 +22,9 @@
|
|||||||
- wkhtmltopdf
|
- wkhtmltopdf
|
||||||
|
|
||||||
- name: configure mariadb
|
- name: configure mariadb
|
||||||
include: ../prerequisites/roles/mariadb/tasks/main.yml
|
include: roles/mariadb/tasks/main.yml
|
||||||
vars:
|
vars:
|
||||||
mysql_conf_tpl: ../prerequisites/files/mariadb_config.cnf
|
mysql_conf_tpl: roles/mariadb/files/mariadb_config.cnf
|
||||||
|
|
||||||
- name: Install MySQLdb in global env
|
- name: Install MySQLdb in global env
|
||||||
pip: name=mysql-python version=1.2.5
|
pip: name=mysql-python version=1.2.5
|
||||||
|
@ -23,9 +23,9 @@
|
|||||||
- wkhtmltopdf
|
- wkhtmltopdf
|
||||||
|
|
||||||
- name: configure mariadb
|
- name: configure mariadb
|
||||||
include_tasks: ../prerequisites/roles/mariadb/tasks/main.yml
|
include_tasks: roles/mariadb/tasks/main.yml
|
||||||
vars:
|
vars:
|
||||||
mysql_conf_tpl: ../prerequisites/files/mariadb_config.cnf
|
mysql_conf_tpl: roles/mariadb/files/mariadb_config.cnf
|
||||||
|
|
||||||
# setup frappe-bench
|
# setup frappe-bench
|
||||||
- include_tasks: includes/setup_bench.yml
|
- include_tasks: includes/setup_bench.yml
|
||||||
|
Loading…
Reference in New Issue
Block a user