Hello I answer myself....well yes is possible using tools like
pkgsync. Here the receipt:
Exec { path => "/usr/bin:/bin:/usr/sbin:/sbin" }
class pkgsync_setup {
file { ["/etc/pkgsync/musthave", "/etc/pkgsync/mayhave",
"/etc/
pkgsync/maynothave"]:
ensure => present
}
file { [ "/var/lib/puppet/pkgsync", "/etc/pkgsync"]:
ensure =>
directory }
file { "/var/lib/puppet/pkgsync/musthave.d": ensure => directory,
purge => true,
backup => false,
recurse => true,
notify => Exec[pkgsync-
musthave-rebuild]
}
file { "/var/lib/puppet/pkgsync/mayhave.d": ensure => directory,
purge => true,
backup => false,
recurse => true,
notify => Exec[pkgsync-
mayhave-rebuild]
}
file { "/var/lib/puppet/pkgsync/maynothave.d": ensure =>
directory,
purge => true,
backup => false,
recurse => true,
notify => Exec[pkgsync-
maynothave-rebuild]
}
exec { "pkgsync-musthave-rebuild":
command => "find /var/lib/puppet/pkgsync/musthave.d/ -
type f | xargs cat > /etc/pkgsync/musthave",
refreshonly => true,
notify => Exec[pkgsync]
}
exec { "pkgsync-mayhave-rebuild":
command => "find /var/lib/puppet/pkgsync/mayhave.d/ -
type f | xargs cat > /etc/pkgsync/mayhave",
refreshonly => true,
}
exec { "pkgsync-maynothave-rebuild":
command => "find /var/lib/puppet/pkgsync/maynothave.d/
-type f | xargs cat > /etc/pkgsync/maynothave",
refreshonly => true,
}
exec { "pkgsync": refreshonly => true, command =>
"pkgsync -s" }
}
define pkgsync($ensure) {
include pkgsync_setup
file { "pkgsync_$ensure_$name":
name => $ensure ? {
present => "/var/lib/puppet/pkgsync/musthave.d/$name",
absent => "/var/lib/puppet/pkgsync/maynothave.d/$name",
optional => "/var/lib/puppet/pkgsync/mayhave.d/$name"
},
ensure => present,
content => "$name\n",
notify => $ensure ? {
present => Exec[pkgsync-musthave-rebuild],
absent => Exec[pkgsync-maynothave-rebuild],
optional => Exec[pkgsync-mayhave-rebuild]
}
}
}
What I cannot understand is that. In this receipt if somenthing go
wrong user are not warned. I mean....
file { ["/etc/pkgsync/musthave", "/etc/pkgsync/mayhave",
"/etc/pkgsync/
maynothave"]:
ensure => present
This will check if those files are present if not I suppose all will
be stopped, and indeed this appen in my simulation, but no warning, no
message... There is a way to ask puppet to be more... verbose? For
example ask to yes check this file and if you cannot find they, scream
or just say something! :-)
On Oct 21, 6:34 pm, Reno <renato.tuv...@gmail.com>
wrote:> Suppose to have a small net with 5 machines 1 is the puppet master and
> 4 are clients.
>
> We want to use puppet to be sure that the packages installed in each
> machine will be the same, so that we will modify the master config to
> add, remove or update package in all the machines.
>
> is possible to do that with puppet?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---