Jira (PUP-5874) Purging doesn't work when a package dependancy is required inside same catalog

2 views
Skip to first unread message

Jonathan Tripathy (JIRA)

unread,
Feb 10, 2016, 1:19:04 PM2/10/16
to puppe...@googlegroups.com
Jonathan Tripathy created an issue
 
Puppet / Bug PUP-5874
Purging doesn't work when a package dependancy is required inside same catalog
Issue Type: Bug Bug
Assignee: Branan Riley
Created: 2016/02/10 10:18 AM
Priority: Normal Normal
Reporter: Jonathan Tripathy

I noticed this issue inside the puppetlabs-firewall module, however the situation is probably relevant to many other modules as well.

If I have the following manifest:

class {'firewall':}
resources {'firewall': purge=>true}

I get the following error, as the firewall class isn't being executed first:

# /opt/puppetlabs/bin/puppet apply site.pp
Notice: Compiled catalog for ja35cpxhttwrv7e.delivery.puppetlabs.net in environment production in 0.76 seconds
Error: /Stage[main]/Main/Resources[firewall]: Failed to generate additional resources using 'generate': Command iptables_save is missing
Notice: /Stage[main]/Firewall::Linux/Package[iptables]/ensure: created
Notice: /Stage[main]/Firewall::Linux::Debian/Package[iptables-persistent]/ensure: created
Notice: Applied catalog in 2.66 seconds

The firewall class should be executed first as the firewall types (that are generated by the 'resources' metatype) has an autorequire on Package['iptables'] (which is inside the firewall class), however the autorequire isn't being executed.

Naturally, this works the second time around, as the iptables package has been installed on the system.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.12#64027-sha1:e3691cc)
Atlassian logo

Jonathan Tripathy (JIRA)

unread,
Feb 10, 2016, 1:21:03 PM2/10/16
to puppe...@googlegroups.com
Jonathan Tripathy updated an issue
Change By: Jonathan Tripathy
I noticed this issue inside the puppetlabs-firewall module, however the situation is probably relevant to many other modules as well.

If I have the following manifest:

{code}

class {'firewall':}
resources {'firewall': purge=>true}
{code}


I get the following error, as the firewall class isn't being executed first:
{code}

# /opt/puppetlabs/bin/puppet apply site.pp
Notice: Compiled catalog for ja35cpxhttwrv7e.delivery.puppetlabs.net in environment production in 0.76 seconds
Error: /Stage[main]/Main/Resources[firewall]: Failed to generate additional resources using 'generate': Command iptables_save is missing
Notice: /Stage[main]/Firewall::Linux/Package[iptables]/ensure: created
Notice: /Stage[main]/Firewall::Linux::Debian/Package[iptables-persistent]/ensure: created
Notice: Applied catalog in 2.66 seconds
{code}


The firewall class should be executed first as the firewall types (that are generated by the 'resources' metatype) has an autorequire on Package['iptables'] (which is inside the firewall class), however the autorequire isn't being executed.

Note: Before the first run, the iptables package was removed by me to replicate this issue using the following command:
{code}
apt-get remove iptables --purge
{code}

Naturally, this works the second time around, as the iptables package has been installed on the system.

Branan Riley (JIRA)

unread,
Feb 10, 2016, 1:35:05 PM2/10/16
to puppe...@googlegroups.com

Branan Riley (JIRA)

unread,
Feb 10, 2016, 4:52:04 PM2/10/16
to puppe...@googlegroups.com
Branan Riley commented on Bug PUP-5874
 
Re: Purging doesn't work when a package dependancy is required inside same catalog

My understanding of what's happening here:

Resources to be purged are generated before any resources in the catalog are applied. This is done by calling `self.instances` on the to-be-purged type. If that type can't query its instances due to a missing package, the Resources instance will fail to generate its children, and no purging will happen.

If we moved purge to use `eval_generate` this would work, but at the expense of breaking autorequires against purged resources, wihch I just fixed in

PUP-1963 . Possibly we want to have an option on the Resources type for whether it should `generate` or `eval_generate`, but the naming of that, and the tradeoffs it creates around relationships to the Resources type and the instances it generates, need to be thought out very carefully.

Chris Denneen (JIRA)

unread,
Mar 28, 2017, 5:29:03 PM3/28/17
to puppe...@googlegroups.com
Chris Denneen commented on Bug PUP-5874

Branan Riley I know this has been open a while. What's the fix to avoid the iptables_save missing Error being generated?

This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe)
Atlassian logo

Henrik Lindberg (JIRA)

unread,
May 15, 2017, 3:54:03 PM5/15/17
to puppe...@googlegroups.com

Geoff Nichols (JIRA)

unread,
May 25, 2017, 1:24:04 PM5/25/17
to puppe...@googlegroups.com

Robert (JIRA)

unread,
Apr 30, 2018, 6:48:02 PM4/30/18
to puppe...@googlegroups.com
Robert commented on Bug PUP-5874
 
Re: Purging doesn't work when a package dependancy is required inside same catalog

Anyone have any ideas on how to get around this problem? Should this be reported as a bug related to the puppet resource "purge" functionality instead of the firewall?

This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Rob Braden (JIRA)

unread,
May 13, 2019, 2:57:03 PM5/13/19
to puppe...@googlegroups.com
Rob Braden assigned an issue to Unassigned
 
Change By: Rob Braden
Assignee: Branan Riley
Reply all
Reply to author
Forward
0 new messages