mirror of
https://github.com/frappe/bench.git
synced 2025-01-09 16:36:25 +00:00
[fix] add commands to sudoer
This commit is contained in:
parent
802fa1e239
commit
af16ee3eec
@ -47,7 +47,9 @@ def check_uid():
|
||||
sys.exit(1)
|
||||
|
||||
def cmd_requires_root():
|
||||
if len(sys.argv) > 2 and sys.argv[2] in ('production', 'sudoers', 'lets-encrypt', 'fonts', 'print', 'firewall', 'ssh-port', 'prerequisites', 'role'):
|
||||
if len(sys.argv) > 2 and sys.argv[2] in ('production', 'sudoers', 'lets-encrypt', 'fonts',
|
||||
'print', 'firewall', 'ssh-port', 'prerequisites', 'role', 'mariadb', 'wkhtmltopdf',
|
||||
'nodejs', 'psutil', 'nginx', 'fail2ban'):
|
||||
return True
|
||||
if len(sys.argv) >= 2 and sys.argv[1] in ('patch', 'renew-lets-encrypt', 'disable-production'):
|
||||
return True
|
||||
|
@ -17,8 +17,10 @@ def install_prerequisites():
|
||||
@click.option('--mysql_root_password')
|
||||
def install_maridb(mysql_root_password=''):
|
||||
"Install mariadb 10.1"
|
||||
extra_vars.update(mysql_root_password)
|
||||
run_playbook('prerequisites/install_roles.yml', extra_vars=extra_vars, tag='maridb')
|
||||
if mysql_root_password:
|
||||
extra_vars.update({"mysql_root_password": mysql_root_password})
|
||||
|
||||
run_playbook('prerequisites/install_roles.yml', extra_vars=extra_vars, tag='mariadb')
|
||||
|
||||
@click.command('wkhtmltopdf')
|
||||
def install_wkhtmltopdf():
|
||||
|
@ -20,7 +20,7 @@
|
||||
with_items:
|
||||
- 80
|
||||
- 443
|
||||
- {{ ssh_port }}
|
||||
- "{{ ssh_port }}"
|
||||
when: ansible_distribution == 'CentOS'
|
||||
|
||||
- name: Restart Firewall
|
||||
@ -41,6 +41,6 @@
|
||||
with_items:
|
||||
- 80
|
||||
- 443
|
||||
- {{ ssh_port }}
|
||||
- "{{ ssh_port }}"
|
||||
when: ansible_distribution == 'Ubuntu' or ansible_distribution == 'Debian'
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user