Skip to content

Instantly share code, notes, and snippets.

@tdtds tdtds/module.pp
Last active Dec 17, 2015

Embed
What would you like to do?
puppet内からpuppet moduleのインストールを管理する
define puppet::module(
$ensure = installed,
){
$module = regsubst($name, '^.*?-(.*)$', '\1')
if $ensure == installed {
exec { "install":
path => ['/bin', '/usr/local/bin'],
command => "puppet module install ${name}",
creates => "/etc/puppet/modules/${module}",
}
}else{
exec { "uninstall":
path => ['/usr/bin', '/usr/local/bin'],
command => "puppet module uninstall ${name}",
onlyif => "test -d /etc/puppet/modules/${module}",
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.