Skip to content

Instantly share code, notes, and snippets.

@lak
Created March 9, 2009 23:30
Show Gist options
  • Save lak/76552 to your computer and use it in GitHub Desktop.
Save lak/76552 to your computer and use it in GitHub Desktop.
class filesystems {
file { "/etc/exports.d":
ensure => directory,
purge => true,
notify => Exec[rebuild-exports]
}
exec { rebuild-exports:
command => "/bin/cat /etc/exports.d/* > /etc/exports",
refreshonly => true
}
define export($path,$options,$servers) {
file { "/etc/exports.d/$name":
# This template is left as an exercise to the reader
content => template("exports/export.erb"),
ensure => file,
notify => Exec[rebuild-exports]
}
}
}
class mystuff {
filesystems::export { "homes":
path => "/srv/homes",
options => [rw,sync,no_subtree_check],
servers => [hostname1, hostname2]
}
}
class otherstuff inherits mystuff {
Filesystems::Export["homes"] { servers +> hostname3 }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment