Skip to content

Instantly share code, notes, and snippets.

@stack72
Created June 11, 2013 11:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stack72/5756083 to your computer and use it in GitHub Desktop.
Save stack72/5756083 to your computer and use it in GitHub Desktop.
Sample to manage an entire host file on a Windows machine
class hosts {
file { 'hosts':
ensure => file,
path => 'c:/windows/system32/drivers/etc',
source => 'puppet:///modules/hosts/hosts',
notify => Exec['flush_dns'],
}
exec { 'flush_dns':
command => 'powershell.exe -executionpolicy unrestricted -Command "C:\windows\system32\ipconfig.exe /flushdns"',
path => $::path,
refreshonly => true,
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment