[Puppet Users] Why doesn't my install_options get picked by my package resource?

54 views
Skip to first unread message

Russell Cecala

unread,
Apr 22, 2015, 7:44:36 PM4/22/15
to puppet-users
Here is what I am doing ...

        [root@mgmt-el7-002 ~]# puppet -V

        3.6.2 (Puppet Enterprise 3.3.2)

        [root@mgmt-el7-002 ~]# cat kernel_upgrade.pp

        package {'kernel-3.10.0-123.20.1.el7':

                ensure => present,

                allow_virtual => false,

                install_options => [ { '--enablerepo' => 'Redhat_7_Updates'} ],

        }


        [root@mgmt-el7-002 ~]# puppet apply kernel_upgrade.pp

... and here is the error I am getting ...

        Notice: Compiled catalog for mgmt-el7-002 in environment production in 0.38 seconds

        Error: Execution of '/usr/bin/yum -d 0 -e 0 -y list kernel-3.10.0-123.20.1.el7' returned 1: Error: No matching Packages to list

        Error: /Stage[main]/Main/Package[kernel-3.10.0-123.20.1.el7]/ensure: change from absent to present failed: Execution of '/usr/bin/yum -d 0 -e 0 -y list kernel-3.10.0-123.20.1.el7' returned 1: Error: No matching Packages to list

        Notice: Finished catalog run in 1.89 seconds

        [root@mgmt-el7-002 ~]# yum --enablerepo=Redhat_7_Updates list kernel-3.10.0-123.20.1.el7

        Loaded plugins: fastestmirror, priorities, product-id, subscription-manager

        This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

        Loading mirror speeds from cached hostfile

         * Openstack-Juno-Repo: wwwin-kickstart-sj.example.com

         * example-linux-common: wwwin-kickstart-dev.example.com

         * example-linux-server: wwwin-kickstart-dev.example.com

        91 packages excluded due to repository priority protections

        Available Packages

        kernel.x86_64                       3.10.0-123.20.1.el7               Redhat_7_Updates                              

I am kinda of confused as to how to enable a yum repo in my package resource. 


Thanks!

jcbollinger

unread,
Apr 23, 2015, 10:30:52 AM4/23/15
to puppet...@googlegroups.com


On Wednesday, April 22, 2015 at 6:44:36 PM UTC-5, red wrote:
Here is what I am doing ...

        [root@mgmt-el7-002 ~]# puppet -V

        3.6.2 (Puppet Enterprise 3.3.2)

        [root@mgmt-el7-002 ~]# cat kernel_upgrade.pp

        package {'kernel-3.10.0-123.20.1.el7':

                ensure => present,

                allow_virtual => false,

                install_options => [ { '--enablerepo' => 'Redhat_7_Updates'} ],

        }


        [root@mgmt-el7-002 ~]# puppet apply kernel_upgrade.pp

... and here is the error I am getting ...

        Notice: Compiled catalog for mgmt-el7-002 in environment production in 0.38 seconds

        Error: Execution of '/usr/bin/yum -d 0 -e 0 -y list kernel-3.10.0-123.20.1.el7' returned 1: Error: No matching Packages to list

[...]
 

I am kinda of confused as to how to enable a yum repo in my package resource. 


I am uncertain why the --enablerepo option you specified is not making it through to the yum command that Puppet actually executes, but I would not be shocked to find that that particular option is being intentionally stripped.  Allowing repos to be enabled or disabled on a per-package basis could produce inconsistent behavior because Puppet prefetches the latest available version code for all available packages before it applies any package, and uses those in its evaluation of whether package resources need to be synced.

Is there some reason why you cannot just set the repo itself enabled by default?  Even if you want to allow only certain packages to be installed from it, that can be set up in the repo configuration.  Puppet even has a Yumrepo resource type that can help you manage this.


John

Kylo Ginsberg

unread,
Apr 24, 2015, 12:25:16 AM4/24/15
to puppet...@googlegroups.com
On Wed, Apr 22, 2015 at 4:44 PM, Russell Cecala <red.cric...@gmail.com> wrote:
Here is what I am doing ...

        [root@mgmt-el7-002 ~]# puppet -V

        3.6.2 (Puppet Enterprise 3.3.2)

        [root@mgmt-el7-002 ~]# cat kernel_upgrade.pp

        package {'kernel-3.10.0-123.20.1.el7':

                ensure => present,

                allow_virtual => false,

                install_options => [ { '--enablerepo' => 'Redhat_7_Updates'} ],

        }


        [root@mgmt-el7-002 ~]# puppet apply kernel_upgrade.pp

... and here is the error I am getting ...

        Notice: Compiled catalog for mgmt-el7-002 in environment production in 0.38 seconds

        Error: Execution of '/usr/bin/yum -d 0 -e 0 -y list kernel-3.10.0-123.20.1.el7' returned 1: Error: No matching Packages to list

        Error: /Stage[main]/Main/Package[kernel-3.10.0-123.20.1.el7]/ensure: change from absent to present failed: Execution of '/usr/bin/yum -d 0 -e 0 -y list kernel-3.10.0-123.20.1.el7' returned 1: Error: No matching Packages to list

        Notice: Finished catalog run in 1.89 seconds

I think you may be running into https://tickets.puppetlabs.com/browse/PUP-2971, which is fixed in puppet 3.7.

Hth,

Kylo 

        [root@mgmt-el7-002 ~]# yum --enablerepo=Redhat_7_Updates list kernel-3.10.0-123.20.1.el7

        Loaded plugins: fastestmirror, priorities, product-id, subscription-manager

        This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

        Loading mirror speeds from cached hostfile

         * Openstack-Juno-Repo: wwwin-kickstart-sj.example.com

         * example-linux-common: wwwin-kickstart-dev.example.com

         * example-linux-server: wwwin-kickstart-dev.example.com

        91 packages excluded due to repository priority protections

        Available Packages

        kernel.x86_64                       3.10.0-123.20.1.el7               Redhat_7_Updates                              

I am kinda of confused as to how to enable a yum repo in my package resource. 


Thanks!

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAHu%2B3Oz5%2BGz_iF%2BY88MvwJDjNXoUafxP6K7KV65bh4VEb0Qh2w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.



--
Kylo Ginsberg | ky...@puppetlabs.com | irc: kylo | twitter: @kylog

PuppetConf 2015 is coming to Portland, Oregon! Join us October 5-9.
Register now to take advantage of the Early Adopter discount save $349!
Reply all
Reply to author
Forward
0 new messages