Last active
December 24, 2015 22:39
-
-
Save groob/6874282 to your computer and use it in GitHub Desktop.
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
class bootstrap::nosslsearch { | |
host { 'www.google.com': | |
ensure => 'present', | |
ip => $::nosslsearch_ip_address, | |
target => '/etc/hosts', | |
notify => Exec["flushdnscache"], | |
} | |
exec { 'flushdnscache': | |
command => "/usr/bin/dscacheutil -flushcache", | |
refreshonly => true, | |
} | |
} |
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
#nosslsearch_ip_address.rb | |
Facter.add(:nosslsearch_ip_address) do | |
confine :kernel => "Darwin" | |
setcode do | |
Facter::Util::Resolution.exec("/usr/bin/dig nosslsearch.google.com | grep google.com | tail -n 1 | awk '{print $5}'") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment