what fact would people suggest I use to distinguish 5.x from 6.x
(quite a lot of subsystems are different between major releases)?
lsb* facts don't seem to be present on centos 6 - is this an EPEL bug,
or have they
just been removed in Facter?
Thanks!
case $::operatingsystemrelease {
/^5/: {
}
/^6/: {
}
}
> --
> 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.
>
>
Just started a rollout of centos 6.x across our Puppet deployment
(100-odd servers).
what fact would people suggest I use to distinguish 5.x from 6.x
(quite a lot of subsystems are different between major releases)?
Want to use hiera for determining package names etc between major
versions (e.g. sendmail on 5.x, postfix on 6.x)
- will look up based on OS_flavour+ major_release
(Centos-5.json, RHEL-6.json, etc.) and that should get me sorted.
Thanks a lot!
I think that will fail on centos. This line is better, works on
centos/rhel.
I think that will fail on centos. This line is better, works on centos/rhel.On 8 February 2012 02:37, d...@looprock.com<technopatholog...@gmail.com> wrote:
I use this:
Facter.add("operatingsystemrelease_mv") do
setcode do
%x{cat /etc/redhat-release |awk \{'print $3'\}|cut -
c1}.chomp
end
end
cat /etc/redhat-release |awk -Frelease {'print $2'} | awk {'print $1'} | awk -F. {'print $1'}
--
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+unsubscribe@googlegroups.com.
Gary, I've been solving this problem by using the following inline_template in the modules that need to get the major release version:$os_major_ver = inline_template("<%= operatingsystemrelease.split('.')[0] %>")I'm new to Puppet, and I like the elegance of your example below - to implement it, would I need to put that block in <modulename>/lib/facter/operatingsystemmajor.rb? I assume I'd need to put that in every module that'd use it. Is there a better way? I currently use that block in 3 or 4 modules.Thanks!Jeffrey.
On Sun, Feb 12, 2012 at 6:25 PM, Gary Larizza <ga...@puppetlabs.com> wrote:
There's also the 'operatingsystemrelease' fact that will evaluate to the full version. You could do this:Facter.add('operatingsystemmajor') dosetcode doFacter.value('operatingsystemrelease').split('.').firstendend
--
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.
--
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.
Yes, thanks. My only concern though is that catalogs will fail to compile if that particular module that it's located in isn't included in that node definition. I worry that any successors will not be able to easily figure out what I've done.
Could I create a module named "global" and have it simply be where things like that live? What's the minimum I'd need to have in it? An init.pp with simply "class global { }"? Are there other, better ways?Thanks again,Jeffrey.On Mon, Feb 13, 2012 at 11:29 AM, Gary Larizza <ga...@puppetlabs.com> wrote:Hi Jeffrey,You're correct about the placement of the file, however you don't need to include it in EVERY module you use. That fact only needs to be in ONE of your modules for every node to utilize it as a Facter fact (currently, ANY Facter facts that are in your $modulepatch get loaded by ALL of your nodes).So repeating this code is very redundant. Does this makes sense?
--
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.