Class: Invoker::Power::Distro::Ubuntu
- Inherits:
-
Debian
show all
- Defined in:
- lib/invoker/power/setup/distro/ubuntu.rb
Constant Summary
Constants inherited
from Base
Base::RESOLVER_DIR, Base::SOCAT_SHELLSCRIPT, Base::SOCAT_SYSTEMD
Instance Method Summary
collapse
Methods inherited from Base
distro, distro_installer, #initialize, #restart_services
Instance Method Details
#get_user_confirmation? ⇒ Boolean
37
38
39
40
41
42
|
# File 'lib/invoker/power/setup/distro/ubuntu.rb', line 37
def get_user_confirmation?
if using_systemd_resolved? && tld != 'localhost'
Invoker::Logger.puts("Ubuntu installations using systemd-resolved (typically Ubuntu 17+) only support the .localhost domain, so your tld setting (or the default) will be ignored.".colorize(:yellow))
end
super
end
|
#install_other ⇒ Object
25
26
27
|
# File 'lib/invoker/power/setup/distro/ubuntu.rb', line 25
def install_other
using_systemd_resolved? ? nil : super
end
|
#install_packages ⇒ Object
21
22
23
|
# File 'lib/invoker/power/setup/distro/ubuntu.rb', line 21
def install_packages
using_systemd_resolved? ? "socat" : super
end
|
#install_required_software ⇒ Object
12
13
14
15
16
17
18
19
|
# File 'lib/invoker/power/setup/distro/ubuntu.rb', line 12
def install_required_software
if using_systemd_resolved?
system("apt-get --assume-yes install socat")
else
super
end
end
|
#resolver_file ⇒ Object
29
30
31
|
# File 'lib/invoker/power/setup/distro/ubuntu.rb', line 29
def resolver_file
using_systemd_resolved? ? nil : super
end
|
#tld ⇒ Object
33
34
35
|
# File 'lib/invoker/power/setup/distro/ubuntu.rb', line 33
def tld
using_systemd_resolved? ? 'localhost' : @tld
end
|
#using_systemd_resolved? ⇒ Boolean
7
8
9
10
|
# File 'lib/invoker/power/setup/distro/ubuntu.rb', line 7
def using_systemd_resolved?
return @_using_systemd_resolved if defined?(@_using_systemd_resolved)
@_using_systemd_resolved = system("systemctl is-active --quiet systemd-resolved")
end
|