Issue #6470 has been updated by Matt Taggart.

In comment 6 micah wonders why there are both architecture and hardwaremodel. I 
suspect it's more useful on other archs like ARM where you might want to make 
decisions based on the particular model (like if it doesn't have FP or 
something). Since uname reveals both it probably makes sense to have separate 
facts for them.
----------------------------------------
Bug #6470: Ubuntu server architecture detected as "x86_64" while it should be 
"amd64"
https://projects.puppetlabs.com/issues/6470

Author: Dominick Rivard
Status: Duplicate
Priority: Normal
Assignee: Adrien Thebo
Category: library
Target version: 1.5.9
Keywords: 
Branch: 
Affected Facter version: 


it seems to be the same issue as this ticket 
[[http://projects.puppetlabs.com/issues/4980]] but with another distro<br/>
We are running Ubuntu servers and the fact architecture return this:

architecture => x86_64<br/>
operatingsystem => Ubuntu<br/>
puppetversion => 2.6.4<br/>
facterversion => 1.5.8<br/>

I would expect the architecture fact to return amd64<br/>
in the file facter/architecture.rb<br/>

        # line 9 
        when "Debian", "Gentoo", "GNU/kFreeBSD"
        
        # I would suggest
        when "Debian", "Gentoo", "GNU/kFreeBSD", "Ubuntu"

        # it would look like this
        Facter.add(:architecture) do
                confine :kernel => [:linux, :"gnu/kfreebsd"]
                setcode do
                    model = Facter.value(:hardwaremodel)
                    case model
                    # most linuxen use "x86_64"
                    when "x86_64"
                        case Facter.value(:operatingsystem)
                        when "Debian", "Gentoo", "GNU/kFreeBSD", "Ubuntu"
                            "amd64"
                        else
                            model
                        end
                    when /(i[3456]86|pentium)/
                        case Facter.value(:operatingsystem)
                        when "Gentoo"
                            "x86"
                        else
                            "i386"
                        end
                    else
                        model
                    end
                end
        end

This would be helpful while installing package through dpkg and for custom 
build packages<br/>
For now I created a custom fact to overcome this issue

        require 'facter'

        if Facter.value(:architecture) == "x86_64"
                packagearchitecture = "amd64"
        else
                packagearchitecture = "i386"
        end

        #
        # Get the DEBian package architecture that needs to be install
        # ex: i386, amd64
        #
        Facter.add('packagearchitecture') do
                setcode do
                        packagearchitecture
                end
        end

Thank you!


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

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

Reply via email to