Current section

Files

Jump to
mix_deploy priv templates sudoers.eex
Raw

priv/templates/sudoers.eex

Cmnd_Alias <%= String.upcase(to_string(app_name)) %>_SYSTEMCTL = /bin/systemctl start <%= service_name %>, \
/bin/systemctl stop <%= service_name %>, \
/bin/systemctl restart <%= service_name %>, \
/bin/systemctl status <%= service_name %>, \
/bin/systemctl is-active <%= service_name %>
<%= if sudo_deploy do %>
<%= deploy_user %> ALL=(ALL) NOPASSWD: <%= String.upcase(to_string(app_name)) %>_SYSTEMCTL
Defaults:<%= deploy_user %> !requiretty
<% end %>
<%= if sudo_app do %>
<%= app_user %> ALL=(ALL) NOPASSWD: <%= String.upcase(to_string(app_name)) %>_SYSTEMCTL
Defaults:<%= app_user %> !requiretty
<% end %>