Ubuntu's facter variable $operatingsystem changed from debian to ubuntu and has broken service providers.

Bug #368832 reported by Cody Herriges
38
This bug affects 5 people
Affects Status Importance Assigned to Milestone
puppet (Ubuntu)
Fix Released
Undecided
Unassigned
Nominated for Jaunty by nreilly
Declined for Karmic by Chuck Short

Bug Description

Binary package hint: puppet

There is no ubuntu provider declared for services controlled by puppet. Up until the current release of Ubuntu 9.04 the facter variable $operatingsystem was being returned as debian and so now is being returned as ubuntu. I have found it sufficient to copy /usr/lib/ruby/1.8/puppet/provider/service/debian.rb to /usr/lib/ruby/1.8/puppet/provider/service/ubuntu.rb and then searching and replacing all instances of the word debian with ubuntu, it only changes 3 lines. After doing this things work in a proper manner. Without doing this you get the error from puppet that there are multiple default providers and it will choose one for you and it often decides to pick freebsd. The other fix would be to re-write all our puppet configs so that each service declaration has the line 'provider => debian' but that kinda seems suboptimal and contrary to the decision by ubuntu to change the facter variable, $operatingsystem from debian to ubuntu.

Ubuntu Version: Jaunty 9.04
puppet Package Version: 0.24.5-3

Revision history for this message
Cody Herriges (ody-cat) wrote :

I suppose that actually changing line 8 of the the debian.rb file to 'defaultfor :operatingsystem => [:debian, :ubuntu]' would be a better solution, as this is what is done with Redhat derivatives. Which would likely be something good to push upstream.

Revision history for this message
John Cooper (choffee) wrote :
Revision history for this message
Michiel Eghuizen (michieleghuizen) wrote :

That patch works,

But I also needed to patch puppet lib with the following patch, found at: http://projects.reductivelabs.com/issues/1647 to make puppet work fully.

Revision history for this message
nreilly (nreilly) wrote :
Changed in puppet (Ubuntu):
status: New → Confirmed
Revision history for this message
greenmoss (ktyubuntu) wrote :

I can't add much to this ticket, except that it has also affected me, and a request to please push the fix to Jaunty.

Also, I didn't find this page when searching for the error string on Google, so here is the error string for others' benefit:

warning: Found multiple default providers for service: freebsd, debian; using freebsd

Revision history for this message
nutznboltz (nutznboltz-deactivatedaccount) wrote :

$ sudo facter | grep architecture
architecture => x86_64

Used to say "amd64".

Suggested fix:

$ diff -u architecture.rb.DIST architecture.rb--- architecture.rb.DIST 2009-07-01 17:38:55.267135355 -0400
+++ architecture.rb 2009-07-01 17:56:41.577135248 -0400
@@ -5,7 +5,7 @@
         case model
         # most linuxen use "x86_64"
         when 'x86_64':
- Facter.value(:operatingsystem) == "Debian" ? "amd64" : model;
+ %w{Debian Ubuntu}.include?(Facter.value(:operatingsystem)) ? "amd64" : model;
         when /(i[3456]86|pentium)/: "i386"
         else
             model

Revision history for this message
Chuck Short (zulcss) wrote :

This is already fixed for karmic.

Regards
chuck

Chuck Short (zulcss)
Changed in puppet (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.