diff --git a/bench/commands/install.py b/bench/commands/install.py index e8c031ab..715078ac 100644 --- a/bench/commands/install.py +++ b/bench/commands/install.py @@ -34,6 +34,10 @@ def install_nodejs(): def install_psutil(): run_playbook('prerequisites/install_roles.yml', extra_vars=extra_vars, tag='psutil') +@click.command('supervisor') +def install_supervisor(): + run_playbook('prerequisites/install_roles.yml', extra_vars=extra_vars, tag='supervisor') + @click.command('nginx') def install_nginx(): run_playbook('prerequisites/install_roles.yml', extra_vars=extra_vars, tag='nginx') @@ -47,5 +51,6 @@ install.add_command(install_maridb) install.add_command(install_wkhtmltopdf) install.add_command(install_nodejs) install.add_command(install_psutil) +install.add_command(install_supervisor) install.add_command(install_nginx) install.add_command(install_failtoban) \ No newline at end of file diff --git a/playbooks/prerequisites/install_prerequisites.yml b/playbooks/prerequisites/install_prerequisites.yml index 6fb0a066..93350a0f 100644 --- a/playbooks/prerequisites/install_prerequisites.yml +++ b/playbooks/prerequisites/install_prerequisites.yml @@ -33,7 +33,6 @@ - redis - screen - sudo - - supervisor - tcl-devel - tk-devel - vim @@ -72,7 +71,6 @@ - python-tk - redis-server - screen - - supervisor - vim - xfonts-75dpi - xfonts-base diff --git a/playbooks/prerequisites/install_roles.yml b/playbooks/prerequisites/install_roles.yml index b1d8fa6b..c66b829d 100644 --- a/playbooks/prerequisites/install_roles.yml +++ b/playbooks/prerequisites/install_roles.yml @@ -19,6 +19,7 @@ - { role: wkhtmltopdf, tags: "wkhtmltopdf" } - { role: nodejs, tags: "nodejs" } - { role: psutil, tags: "psutil" } + - { role: supervisor, tags: "supervisor", when: production } - { role: nginx, tags: "nginx", when: production } - { role: fail2ban, tags: "fail2ban" , when: production } tasks: diff --git a/playbooks/prerequisites/roles/supervisor/tasks/main.yml b/playbooks/prerequisites/roles/supervisor/tasks/main.yml new file mode 100644 index 00000000..5926f27d --- /dev/null +++ b/playbooks/prerequisites/roles/supervisor/tasks/main.yml @@ -0,0 +1,8 @@ +--- +- name: Install supervisor on centos + yum: name=supervisor state=present + when: ansible_os_family == 'RedHat' + +- name: Install supervisor on debian + apt: pkg=supervisor state=present force=yes + when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'