Wrong service provider "debian" for ubuntu trusty

Bug #1631969 reported by Alex Muntada
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
puppet-ceph
New
Undecided
Unassigned

Bug Description

File manifests/params.pp sets default provider to "debian" for Ubuntu Trusty and later the service tries to use file «/etc/init.d/ceph-mon-a» which doesn't exist because ceph is installed using "upstart" provider instead.

Running the acceptance tests shows the same error that we've found after upgrading puppet-ceph module in our ceph cluster:

$ BEAKER_set=two-ubuntu-server-1404-x64 bundle exec rspec spec/acceptance

...

ceph mon osd
  default parameters
localhost $ scp /tmp/beaker20161010-25539-1nsm812 first:/tmp/apply_manifest.pp.xdLWNs {:ignore => }
    should install one monitor and one OSD on /srv/data (FAILED - 1)
Destroying vagrant boxes
==> second: Forcing shutdown of VM...
==> second: Destroying VM and associated drives...
==> first: Forcing shutdown of VM...
==> first: Destroying VM and associated drives...

Failures:

  1) ceph mon osd default parameters should install one monitor and one OSD on /srv/data
     Failure/Error: apply_manifest(pp, :catch_failures => true)
     Beaker::Host::CommandFailure:
       Host 'first' exited with 6 running:
        puppet apply --verbose --detailed-exitcodes /tmp/apply_manifest.pp.xdLWNs
       Last 10 lines of output were:
        Notice: /Stage[main]/Main/Ceph::Mon[a]/Exec[ceph-mon-mkfs-a]/returns: executed successfully
        Error: Execution of '/usr/sbin/update-rc.d ceph-mon-a defaults' returned 1: update-rc.d: /etc/init.d/ceph-mon-a: file does not exist
        Error: /Stage[main]/Main/Ceph::Mon[a]/Service[ceph-mon-a]/ensure: change from stopped to running failed: Execution of '/usr/sbin/update-rc.d ceph-mon-a defaults' returned 1: update-rc.d: /etc/init.d/ceph-mon-a: file does not exist
        Notice: /Stage[main]/Main/Ceph::Mon[a]/Service[ceph-mon-a]: Triggered 'refresh' from 12 events
        Notice: /Stage[main]/Main/Ceph::Osd[/srv/data]/Exec[ceph-osd-prepare-/srv/data]: Dependency Service[ceph-mon-a] has failures: true
        Notice: /Stage[main]/Main/Ceph::Osd[/srv/data]/Exec[ceph-osd-activate-/srv/data]: Dependency Service[ceph-mon-a] has failures: true
        Warning: /Stage[main]/Main/Ceph::Osd[/srv/data]/Exec[ceph-osd-prepare-/srv/data]: Skipping because of failed dependencies
        Warning: /Stage[main]/Main/Ceph::Osd[/srv/data]/Exec[ceph-osd-activate-/srv/data]: Skipping because of failed dependencies
        Info: Creating state file /var/lib/puppet/state/state.yaml
        Notice: Finished catalog run in 70.55 seconds

     # ./vendor/ruby/2.3.0/gems/beaker-2.51.0/lib/beaker/host.rb:351:in `exec'
     # ./vendor/ruby/2.3.0/gems/beaker-2.51.0/lib/beaker/dsl/helpers/host_helpers.rb:83:in `block in on'
     # ./vendor/ruby/2.3.0/gems/beaker-2.51.0/lib/beaker/shared/host_manager.rb:127:in `run_block_on'
     # ./vendor/ruby/2.3.0/gems/beaker-2.51.0/lib/beaker/dsl/patterns.rb:37:in `block_on'
     # ./vendor/ruby/2.3.0/gems/beaker-2.51.0/lib/beaker/dsl/helpers/host_helpers.rb:63:in `on'
     # ./vendor/ruby/2.3.0/gems/beaker-2.51.0/lib/beaker/dsl/helpers/puppet_helpers.rb:480:in `block in apply_manifest_on'
     # ./vendor/ruby/2.3.0/gems/beaker-2.51.0/lib/beaker/shared/host_manager.rb:127:in `run_block_on'
     # ./vendor/ruby/2.3.0/gems/beaker-2.51.0/lib/beaker/dsl/patterns.rb:37:in `block_on'
     # ./vendor/ruby/2.3.0/gems/beaker-2.51.0/lib/beaker/dsl/helpers/puppet_helpers.rb:409:in `apply_manifest_on'
     # ./vendor/ruby/2.3.0/gems/beaker-2.51.0/lib/beaker/dsl/helpers/puppet_helpers.rb:487:in `apply_manifest'
     # ./spec/acceptance/ceph_mon_osd_spec.rb:50:in `block (3 levels) in <top (required)>'

Finished in 11 minutes 29 seconds (files took 4 minutes 5.6 seconds to load)
1 example, 1 failure

Failed examples:

rspec ./spec/acceptance/ceph_mon_osd_spec.rb:24 # ceph mon osd default parameters should install one monitor and one OSD on /srv/data

Revision history for this message
Alex Muntada (alex.muntada) wrote :

The following patch fixes the issue for trusty (haven't tried it in other platforms):

diff --git a/manifests/mon.pp b/manifests/mon.pp
index a6b5712..4ac53c5 100644
--- a/manifests/mon.pp
+++ b/manifests/mon.pp
@@ -88,8 +88,8 @@ define ceph::mon (
     if $::service_provider == 'upstart' {
       $init = 'upstart'
       Service {
- name => "ceph-mon-${id}",
- provider => $::ceph::params::service_provider,
+ name => "ceph-mon",
+ provider => $::service_provider,
         start => "start ceph-mon id=${id}",
         stop => "stop ceph-mon id=${id}",
         status => "status ceph-mon id=${id}",
diff --git a/manifests/rgw.pp b/manifests/rgw.pp
index da5557e..4271ff9 100644
--- a/manifests/rgw.pp
+++ b/manifests/rgw.pp
@@ -170,11 +170,11 @@ define ceph::rgw (
     }

     Service {
- name => "radosgw-${name}",
+ name => "radosgw",
       start => "start radosgw id=${name}",
       stop => "stop radosgw id=${name}",
       status => "status radosgw id=${name}",
- provider => $::ceph::params::service_provider,
+ provider => $::service_provider,
     }
   # Everything else that is supported by puppet-ceph should run systemd.
   } else {

It seems clear that provider should be $::service_provider instead of default value from params.pp.

On the other side, the name of an upstart service must match the file in "/etc/init/${name}.conf".

Hope this helps,
Alex

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.