Hi all,
I''m writing a recipe for mariadb. It all works (I think, if you see
any mistakes other then my question, feel free to point them out ;) ),
except for the gpg key adding. Can anyone tell me what I''m doing
wrong?
define debian::apt::key($ensure, $apt_key_url = "http://
www.example.com/apt/keys") {
case $ensure {
"present": {
exec { "apt-key present $name":
command => "/usr/bin/wget -q
$apt_key_url/$name -O -|/usr/bin/apt-key add -",
unless => "/usr/bin/apt-key list|/bin/
grep -c $name",
}
}
"absent": {
exec { "apt-key absent $name":
command => "/usr/bin/apt-key del
$name",
onlyif => "/usr/bin/apt-key list|/bin/
grep -c $name",
}
}
default: {
fail "Invalid ''ensure'' value
''$ensure'' for
apt::key"
}
}
}
class debian::apt {
file { "/etc/apt/sources.list":
owner => "root",
group => "root",
mode => 0444,
content => template("common/sources.list.erb"),
}
exec {"/usr/bin/apt-get -q -q update":
refreshonly => true,
subscribe => File["/etc/apt/sources.list"],
require => File["/etc/apt/sources.list"],
}
debian::apt::key { "ourdelta":
ensure => "present",
apt_key_url => "http://ourdelta.org/deb/
ourdelta.gpg"
}
}
And it''s called as follows:
class common{
# make sure all servers have an appropriate apt sources.list
include debian::apt
<..snip..>
}
node "yadda" {
include common
}
Can anybody tell me what i did wrong?
thanks in advance!
--
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.
On Nov 3, 2010, at 12:23 AM, Walter Heck wrote:> Hi all, > > I''m writing a recipe for mariadb. It all works (I think, if you see > any mistakes other then my question, feel free to point them out ;) ), > except for the gpg key adding. Can anyone tell me what I''m doing > wrong? >What happens? Error message? Silently fails? -- 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.
Walter Heck
2010-Nov-04 03:12 UTC
[Puppet Users] Re: apt gpg key class + define not working
On Nov 4, 12:25 am, Patrick <kc7...@gmail.com> wrote:> What happens? Error message? Silently fails?This has been fixed. There were two silly mistakes. First: debian::apt::key is called with a url of "http://ourdelta.org/deb/ ourdelta.gpg", but the code adds $name behind that. Because of that the url returned a 404. The other mistake was that the exec command is missing "; /usr/bin/apt-get -q -q update" so that it actually runs an apt-get update after adding the key. Thanks to the helpful folks on irc for troubleshooting it with me :) Walter -- 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.