puppetlabs/apt and apt::ppa

1,410 views
Skip to first unread message

Andrey Ageyev

unread,
Dec 25, 2012, 9:22:35 PM12/25/12
to puppet...@googlegroups.com
Greetings,

I'm trying to add ppa:nginx/stable repo for Ubuntu 12.04.1 LTS.
Server: puppetmaster-common 3.0.1-1puppetlabs1 
Agent: puppet  2.7.11

And when I try to apply manifest - getting: 
puppet agent -t
info: Caching catalog for wproxy71.tpnt.net
err: Failed to apply catalog: Could not find dependency File[/etc/apt/sources.list.d] for Exec[add-apt-repository-ppa:openstack-ppa/bleeding-edge] at /etc/puppet/modules/apt/manifests/ppa.pp:38

The folder - /etc/apt/sources.list.d exists.
Does anybody know what's can be wrong?

Thanks,
Andrey.


Brian Lalor

unread,
Dec 25, 2012, 9:31:45 PM12/25/12
to puppet...@googlegroups.com
Is that directory managed as a resource with puppet? Puppet doesn't recognize non-managed resources as dependencies. 

--
Brian Lalor

Andrey Ageyev

unread,
Dec 25, 2012, 9:52:32 PM12/25/12
to puppet...@googlegroups.com
This directory exists in the fresh ubuntu system.

I only found this, but there is no solution or workaround.

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To post to this group, send email to puppet...@googlegroups.com.
To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Andrey Ageyev

unread,
Dec 25, 2012, 10:23:34 PM12/25/12
to puppet...@googlegroups.com
Fixed by removing dependency File[$sources_list_d] in apt/manifests/ppa.pp around line 33:

require   => [
    File[$sources_list_d],
    Package["${package}"],
],

to 
require   => Package["${package}"],


среда, 26 декабря 2012 г., 4:22:35 UTC+2 пользователь Andrey Ageyev написал:

Gareth Rushgrove

unread,
Dec 26, 2012, 6:34:07 AM12/26/12
to puppet...@googlegroups.com
On 26 December 2012 03:23, Andrey Ageyev <a.ag...@gmail.com> wrote:
> Fixed by removing dependency File[$sources_list_d] in apt/manifests/ppa.pp
> around line 33:
>
> require => [
> File[$sources_list_d],
> Package["${package}"],
> ],
>
> to
> require => Package["${package}"],
>

If you want to do this without changing the module (which will make
future updates easier) then you can just specify that resource in your
manifests:

file { '/etc/apt/sources.list.d':
ensure => directory,
}

I'm not sure why the module has a dependency on something that it
doesn't manage though, I tend to try and avoid doing that if possible.

G

>
> среда, 26 декабря 2012 г., 4:22:35 UTC+2 пользователь Andrey Ageyev написал:
>>
>> Greetings,
>>
>> I'm trying to add ppa:nginx/stable repo for Ubuntu 12.04.1 LTS.
>> Server: puppetmaster-common 3.0.1-1puppetlabs1
>> Agent: puppet 2.7.11
>>
>> And when I try to apply manifest - getting:
>> puppet agent -t
>> info: Caching catalog for wproxy71.tpnt.net
>> err: Failed to apply catalog: Could not find dependency
>> File[/etc/apt/sources.list.d] for
>> Exec[add-apt-repository-ppa:openstack-ppa/bleeding-edge] at
>> /etc/puppet/modules/apt/manifests/ppa.pp:38
>>
>> The folder - /etc/apt/sources.list.d exists.
>> Does anybody know what's can be wrong?
>>
>> Thanks,
>> Andrey.
>>
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/puppet-users/-/CEgiBNLSA6cJ.
>
> To post to this group, send email to puppet...@googlegroups.com.
> To unsubscribe from this group, send email to
> puppet-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.



--
Gareth Rushgrove
@garethr

devopsweekly.com
morethanseven.net
garethrushgrove.com

Matthias Viehweger

unread,
Jan 2, 2013, 7:59:21 AM1/2/13
to puppet...@googlegroups.com
Hi Gareth!

On Wed, Dec 26, 2012 at 11:34:07AM +0000, Gareth Rushgrove wrote:
> I'm not sure why the module has a dependency on something that it
> doesn't manage though, I tend to try and avoid doing that if possible.

I have those in my modules a lot. Otherwise I would get god-modules or
wrong ordering.

In this case, the apt/sources.list.d-directory is a direct concern of
apt and should IMHO be managed by the module.

Cheers,
Matthias
--
Serververwaltung und Softwareentwicklung

https://www.heute-kaufen.de
Prinzessinnenstraße 20 - 10969 Berlin
signature.asc
Reply all
Reply to author
Forward
0 new messages