----- Original Message ----- > On this page [1] it says that using Package with yum as a backend is > "versionable", i.e. "The provider is capable of interrogating the > package database for installed version(s), and can select which out of > a > set of available versions of a package to install if asked." > > The data (the version number) is clearly there, I just need a way of > getting at it!
The puppet model is not that the machine tells you what packages are on it but that you tell the machine what state it should be in. So lets say you're installing Foo then using puppet manifests you tell the machine to install version 1.2.3. This is data in your manifests and you should be able to use that data in other areas of your manifests if lets say you stored it in extlookup or an external node classifier or even node level variable. The yum provider is versionable which means you can tell it to install version 1.2.3 of something and it will verify and ensure that version is there. You need to think how you build machines from a different direction, you need to think how you tell the machine its desired state rather than the machine tell you what it is and then you make decisions based on that. All that being said, if its just one or two packages you care about you can simply add a fact for the package versions, but this fact will only show the version on the next puppet run not the one during which you install said package since the compile stage of the puppet run is happening on the master prior to installing the package. > > Cheers, > Jonathan > > > [1] http://docs.puppetlabs.com/guides/types/package.html > > On 24/01/11 14:21, Mohamed Lrhazi wrote: > > am just curious as to why do you think that would be possible? Did > > you > > use some other "puppet type" to similarly obtain information? like > > get > > the size of a file, using File type? > > > > Thanks, > > Mohamed. > > > > On Mon, Jan 24, 2011 at 9:15 AM, Jonathan Gazeley > > <jonathan.gaze...@bristol.ac.uk> wrote: > >> On 24/01/11 13:31, Felix Frank wrote: > >>> > >>> On 01/24/2011 02:07 PM, Jonathan Gazeley wrote: > >>>> > >>>> Hi all, > >>>> > >>>> Is there a way to use the Package type to find the version number > >>>> of an > >>>> installed RPM? > >>>> > >>>> I've consulted this page [1] and I can't see any documentation > >>>> there > >>>> that says this might be possible. > >>>> > >>>> I want to simply query my package manager and ask which version > >>>> of a > >>>> package is installed. I do not necessarily wish to ensure it is > >>>> upgraded, etc. > >>>> > >>>> I know it's possible to do this with an exec call to rpm or yum, > >>>> but I > >>>> want to do it "properly" :) > >>>> > >>>> [1] http://docs.puppetlabs.com/guides/types/package.html > >>> > >>> Define "properly" :-) What is puppet supposed to do with this > >>> piece of > >>> information? Log it somewhere? > >> > >> I want to place the version number in a variable, where it will be > >> used to > >> do some post-install config that depends on the version number :) > >> > >> By "properly" I meant to avoid exec calls unless as a last resort. > >> > >> Cheers, > >> Jonathan > >> > >>> > >>> Regards, > >>> Felix > >>> > >> > >> > >> -- > >> ---------------------------- > >> Jonathan Gazeley > >> Systems Support Specialist > >> ResNet | Wireless& VPN Team > >> IT Services > >> University of Bristol > >> ---------------------------- > >> > >> -- > >> 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+unsubscr...@googlegroups.com. > >> For more options, visit this group at > >> http://groups.google.com/group/puppet-users?hl=en. > >> > >> > > > > > -- > ---------------------------- > Jonathan Gazeley > Systems Support Specialist > ResNet | Wireless & VPN Team > IT Services > University of Bristol > ---------------------------- > > -- > 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+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. -- R.I.Pienaar -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.