diff --git a/deployment/puppet/ceph/manifests/init.pp b/deployment/puppet/ceph/manifests/init.pp index f57970a299..8262615ff1 100644 --- a/deployment/puppet/ceph/manifests/init.pp +++ b/deployment/puppet/ceph/manifests/init.pp @@ -115,28 +115,8 @@ class ceph ( 'primary-controller', 'controller', 'ceph-mon': { include ceph::mon - # DO NOT SPLIT ceph auth command lines! See http://tracker.ceph.com/issues/3279 - ceph::pool {$glance_pool: - user => $glance_user, - acl => "mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=${glance_pool}'", - keyring_owner => 'glance', - } - - ceph::pool {$cinder_pool: - user => $cinder_user, - acl => "mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=${cinder_pool}, allow rx pool=${glance_pool}'", - keyring_owner => 'cinder', - } - - ceph::pool {$cinder_backup_pool: - user => $cinder_backup_user, - acl => "mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=${cinder_backup_pool}, allow rx pool=${cinder_pool}'", - keyring_owner => 'cinder', - } - Class['ceph::conf'] -> Class['ceph::mon'] -> - Ceph::Pool[$glance_pool] -> Ceph::Pool[$cinder_pool] -> - Ceph::Pool[$cinder_backup_pool] -> Service['ceph'] + Service['ceph'] if ($::ceph::use_rgw) { include ceph::radosgw @@ -156,27 +136,6 @@ class ceph ( } } - 'compute': { - ceph::pool {$compute_pool: - user => $compute_user, - acl => "mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=${cinder_pool}, allow rx pool=${glance_pool}, allow rwx pool=${compute_pool}'", - keyring_owner => 'nova', - } - - include ceph::nova_compute - - if ($ephemeral_ceph) { - include ceph::ephemeral - Class['ceph::conf'] -> Class['ceph::ephemeral'] ~> - Service[$::ceph::params::service_nova_compute] - } - - Class['ceph::conf'] -> - Ceph::Pool[$compute_pool] -> - Class['ceph::nova_compute'] ~> - Service[$::ceph::params::service_nova_compute] - } - 'ceph-mds': { include ceph::mds } default: {} diff --git a/deployment/puppet/osnailyfacter/modular/ceph/compute.pp b/deployment/puppet/osnailyfacter/modular/astute/ceph_compute.pp similarity index 86% rename from deployment/puppet/osnailyfacter/modular/ceph/compute.pp rename to deployment/puppet/osnailyfacter/modular/astute/ceph_compute.pp index 57e8f18e66..281f58a1df 100644 --- a/deployment/puppet/osnailyfacter/modular/ceph/compute.pp +++ b/deployment/puppet/osnailyfacter/modular/astute/ceph_compute.pp @@ -1,4 +1,4 @@ -notice('MODULAR: ceph/compute.pp') +notice('MODULAR: astute/ceph_compute.pp') $storage_hash = hiera('storage', {}) $controllers = hiera('controllers') @@ -66,6 +66,24 @@ if $use_ceph { ephemeral_ceph => $storage_hash['ephemeral_ceph'] } + service { $::ceph::params::service_nova_compute :} + + include ceph::nova_compute + + if ($ephemeral_ceph) { + include ceph::ephemeral + Class['ceph::conf'] -> Class['ceph::ephemeral'] ~> + Service[$::ceph::params::service_nova_compute] + } + + Class['ceph::conf'] -> + Class['ceph::nova_compute'] ~> + Service[$::ceph::params::service_nova_compute] + + Exec { path => [ '/bin/', '/sbin/' , '/usr/bin/', '/usr/sbin/' ], + cwd => '/root', + } + } diff --git a/deployment/puppet/osnailyfacter/modular/ceph/compute_post.rb b/deployment/puppet/osnailyfacter/modular/astute/ceph_compute_post.rb similarity index 100% rename from deployment/puppet/osnailyfacter/modular/ceph/compute_post.rb rename to deployment/puppet/osnailyfacter/modular/astute/ceph_compute_post.rb diff --git a/deployment/puppet/osnailyfacter/modular/astute/ceph_pools.pp b/deployment/puppet/osnailyfacter/modular/astute/ceph_pools.pp new file mode 100644 index 0000000000..8e89e5b7e7 --- /dev/null +++ b/deployment/puppet/osnailyfacter/modular/astute/ceph_pools.pp @@ -0,0 +1,91 @@ +notice('MODULAR: ceph/ceph_pools') + +$storage_hash = hiera('storage', {}) +$osd_pool_default_pg_num = $storage_hash['pg_num'] +$osd_pool_default_pgp_num = $storage_hash['pg_num'] +# Cinder settings +$cinder_user = 'volumes' +$cinder_pool = 'volumes' +# Cinder Backup settings +$cinder_backup_user = 'backups' +$cinder_backup_pool = 'backups' +# Glance settings +$glance_user = 'images' +$glance_pool = 'images' +#Nova Compute settings +$compute_user = 'compute' +$compute_pool = 'compute' + + +Exec { path => [ '/bin/', '/sbin/' , '/usr/bin/', '/usr/sbin/' ], + cwd => '/root', +} + +# DO NOT SPLIT ceph auth command lines! See http://tracker.ceph.com/issues/3279 +ceph::pool {$glance_pool: + user => $glance_user, + acl => "mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=${glance_pool}'", + keyring_owner => 'glance', + pg_num => $osd_pool_default_pg_num, + pgp_num => $osd_pool_default_pg_num, +} + +ceph::pool {$cinder_pool: + user => $cinder_user, + acl => "mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=${cinder_pool}, allow rx pool=${glance_pool}'", + keyring_owner => 'cinder', + pg_num => $osd_pool_default_pg_num, + pgp_num => $osd_pool_default_pg_num, +} + +ceph::pool {$cinder_backup_pool: + user => $cinder_backup_user, + acl => "mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=${cinder_backup_pool}, allow rx pool=${cinder_pool}'", + keyring_owner => 'cinder', + pg_num => $osd_pool_default_pg_num, + pgp_num => $osd_pool_default_pg_num, +} + +ceph::pool {$compute_pool: + user => $compute_user, + acl => "mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=${cinder_pool}, allow rx pool=${glance_pool}, allow rwx pool=${compute_pool}'", + keyring_owner => 'nova', + pg_num => $osd_pool_default_pg_num, + pgp_num => $osd_pool_default_pg_num, +} + +Ceph::Pool[$glance_pool] -> Ceph::Pool[$cinder_pool] -> Ceph::Pool[$cinder_backup_pool] -> Ceph::Pool[$compute_pool] + +if ($storage_hash['volumes_ceph']) { + include ::cinder::params + service { 'cinder-volume': + ensure => 'running', + name => $::cinder::params::volume_service, + hasstatus => true, + hasrestart => true, + } + + Ceph::Pool[$cinder_pool] ~> Service['cinder-volume'] + + service { 'cinder-backup': + ensure => 'running', + name => $::cinder::params::backup_service, + hasstatus => true, + hasrestart => true, + } + + Ceph::Pool[$cinder_backup_pool] ~> Service['cinder-backup'] +} + +if ($storage_hash['images_ceph']) { + include ::glance::params + service { 'glance-api': + ensure => 'running', + name => $::glance::params::api_service_name, + hasstatus => true, + hasrestart => true, + } + + Ceph::Pool[$glance_pool] ~> Service['glance-api'] +} + diff --git a/deployment/puppet/osnailyfacter/modular/astute/tasks.yaml b/deployment/puppet/osnailyfacter/modular/astute/tasks.yaml index 81161ebf0e..1df634a9ef 100644 --- a/deployment/puppet/osnailyfacter/modular/astute/tasks.yaml +++ b/deployment/puppet/osnailyfacter/modular/astute/tasks.yaml @@ -8,6 +8,32 @@ cmd: ruby /etc/puppet/modules/osnailyfacter/modular/astute/enable_quorum.rb timeout: 180 +- id: ceph-compute + type: puppet + role: [compute] + requires: [ceph_create_pools] + required_for: [post_deployment_end] + condition: "settings:storage.objects_ceph.value == true or settings:storage.images_ceph.value == true or settings:storage.volumes_ceph.value == true or settings:storage.ephemeral_ceph.value == true" + parameters: + puppet_manifest: /etc/puppet/modules/osnailyfacter/modular/astute/ceph_compute.pp + puppet_modules: /etc/puppet/modules + timeout: 3600 + cwd: / + test_post: + cmd: ruby /etc/puppet/modules/osnailyfacter/modular/astute/ceph_compute_post.rb + +- id: ceph_create_pools + type: puppet + role: [primary-controller, controller] + requires: [post_deployment_start] + required_for: [ceph_ready_check] + condition: "settings:storage.objects_ceph.value == true or settings:storage.images_ceph.value == true or settings:storage.volumes_ceph.value == true or settings:storage.ephemeral_ceph.value == true" + parameters: + puppet_manifest: /etc/puppet/modules/osnailyfacter/modular/astute/ceph_pools.pp + puppet_modules: /etc/puppet/modules + timeout: 3600 + cwd: / + - id: ceph_ready_check type: shell role: [primary-controller] diff --git a/deployment/puppet/osnailyfacter/modular/ceph/tasks.yaml b/deployment/puppet/osnailyfacter/modular/ceph/tasks.yaml index 8f60406428..d833d8b5ee 100644 --- a/deployment/puppet/osnailyfacter/modular/ceph/tasks.yaml +++ b/deployment/puppet/osnailyfacter/modular/ceph/tasks.yaml @@ -22,14 +22,4 @@ puppet_modules: /etc/puppet/modules timeout: 3600 -- id: ceph-compute - type: puppet - groups: [compute] - required_for: [deploy_end] - requires: [top-role-compute] - parameters: - puppet_manifest: /etc/puppet/modules/osnailyfacter/modular/ceph/compute.pp - puppet_modules: /etc/puppet/modules - timeout: 3600 - test_post: - cmd: ruby /etc/puppet/modules/osnailyfacter/modular/ceph/compute_post.rb + diff --git a/tests/noop/spec/hosts/astute/ceph_compute_spec.rb b/tests/noop/spec/hosts/astute/ceph_compute_spec.rb new file mode 100644 index 0000000000..e12af1c8a9 --- /dev/null +++ b/tests/noop/spec/hosts/astute/ceph_compute_spec.rb @@ -0,0 +1,7 @@ +require 'spec_helper' +require 'shared-examples' +manifest = 'astute/ceph_compute.pp' + +describe manifest do + test_ubuntu_and_centos manifest +end diff --git a/tests/noop/spec/hosts/ceph/compute_spec.rb b/tests/noop/spec/hosts/astute/ceph_pools_spec.rb similarity index 76% rename from tests/noop/spec/hosts/ceph/compute_spec.rb rename to tests/noop/spec/hosts/astute/ceph_pools_spec.rb index e47fb31de6..c9c59fba74 100644 --- a/tests/noop/spec/hosts/ceph/compute_spec.rb +++ b/tests/noop/spec/hosts/astute/ceph_pools_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' require 'shared-examples' -manifest = 'ceph/compute.pp' +manifest = 'astute/ceph_pools.pp' describe manifest do test_ubuntu_and_centos manifest