diff --git a/manifests/object/set_io_scheduler.pp b/manifests/object/set_io_scheduler.pp new file mode 100644 index 00000000..8f0d0a7a --- /dev/null +++ b/manifests/object/set_io_scheduler.pp @@ -0,0 +1,26 @@ +# +# Copyright (C) 2014 eNovance SAS +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# Swift set_io_scheduler +# +define cloud::object::set_io_scheduler(){ + # TODO: Add it on server boot + exec{"/bin/echo deadline > /sys/block/${name}/queue/scheduler": + onlyif => [ + "/usr/bin/test '-e /sys/block/${name}/queue/scheduler'", + "/bin/grep -v -F '[deadline]' /sys/block/${name}/queue/scheduler" + ], + } +} diff --git a/manifests/object/storage.pp b/manifests/object/storage.pp index 7954c1f7..8512a354 100644 --- a/manifests/object/storage.pp +++ b/manifests/object/storage.pp @@ -15,16 +15,7 @@ # # Swift Storage node # - -define set_io_scheduler(){ - # TODO: Add it on server boot - exec{"/bin/echo deadline > /sys/block/${name}/queue/scheduler": - onlyif => [ - "/usr/bin/test '-e /sys/block/${name}/queue/scheduler'", - "/bin/grep -v -F '[deadline]' /sys/block/${name}/queue/scheduler" - ], - } -} +import 'set_io_scheduler.pp' # swift storage class cloud::object::storage ( @@ -95,8 +86,8 @@ allow_versions = on $object_nodes = flatten([ range('sdc','sdd')]) swift::storage::xfs { $object_nodes: } swift::storage::xfs { 'sdb': } - set_io_scheduler{'sdb':} - set_io_scheduler{$object_nodes:} + cloud::object::set_io_scheduler {'sdb':} + cloud::object::set_io_scheduler {$object_nodes:} @@ring_container_device { "${storage_eth}:${container_port}/sdb": zone => $swift_zone,