This repository has been archived by the owner on Jun 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #297 Adding capabilties to manage dnsmasq on Arch
- Loading branch information
1 parent
5601c90
commit 1077e14
Showing
5 changed files
with
64 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module Landrush | ||
module Cap | ||
module Arch | ||
module DnsmasqInstalled | ||
def self.dnsmasq_installed(_env, *_args) | ||
system('pacman -Q dnsmasq > /dev/null 2>&1') | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module Landrush | ||
module Cap | ||
module Arch | ||
module InstallDnsmasq | ||
class << self | ||
def install_dnsmasq(_env) | ||
system('pacman -Sy --noconfirm > /dev/null 2>&1') | ||
system('sudo pacman -S --noconfirm dnsmasq > /dev/null 2>&1') | ||
|
||
system('sudo sed -i "/^#conf-dir=\/etc\/dnsmasq.d$/s/^#//g" /etc/dnsmasq.conf') | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module Landrush | ||
module Cap | ||
module Arch | ||
module RestartDnsmasq | ||
class << self | ||
SED_COMMAND = <<-EOF.gsub(/^ +/, '') | ||
sudo sed -i.orig '1 i\ | ||
# Added by landrush, a vagrant plugin \\ | ||
nameserver 127.0.0.1 \\ | ||
' /etc/resolv.conf | ||
EOF | ||
|
||
def restart_dnsmasq(_env) | ||
system(SED_COMMAND) unless system("cat /etc/resolv.conf | grep 'nameserver 127.0.0.1' > /dev/null 2>&1") | ||
system('sudo systemctl restart dnsmasq') | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters