Class: BoringServices::Services::Nginx

Inherits:
Base
  • Object
show all
Defined in:
lib/boring_services/services/nginx.rb

Instance Attribute Summary

Attributes inherited from Base

#config, #service_config, #ssh_executor

Instance Method Summary collapse

Methods inherited from Base

#initialize, #reconfigure

Constructor Details

This class inherits a constructor from BoringServices::Services::Base

Instance Method Details

#installObject



4
5
6
7
8
9
10
11
12
# File 'lib/boring_services/services/nginx.rb', line 4

def install
  execute_on_host do
    puts "  Installing Nginx on #{label || host}..."
    ssh_executor.install_package('nginx')
    configure_nginx
    ssh_executor.systemd_enable('nginx')
    ssh_executor.systemd_start('nginx')
  end
end

#restartObject



23
24
25
26
27
28
# File 'lib/boring_services/services/nginx.rb', line 23

def restart
  execute_on_host do
    puts "  Restarting Nginx on #{label || host}..."
    ssh_executor.systemd_restart('nginx')
  end
end

#uninstallObject



14
15
16
17
18
19
20
21
# File 'lib/boring_services/services/nginx.rb', line 14

def uninstall
  execute_on_host do
    puts "  Uninstalling Nginx from #{label || host}..."
    ssh_executor.systemd_stop('nginx')
    ssh_executor.systemd_disable('nginx')
    ssh_executor.uninstall_package('nginx')
  end
end