2 # Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
4 # Author: Emilien Macchi <emilien.macchi@enovance.com>
6 # Licensed under the Apache License, Version 2.0 (the "License"); you may
7 # not use this file except in compliance with the License. You may obtain
8 # a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 # License for the specific language governing permissions and limitations
18 # == Definition: openstacklib::service_validation
20 # This resource does service validation for an OpenStack service.
25 # Command to run for validating the service;
29 # The name of the service to validate;
30 # string; optional; default to the $title of the resource, i.e. 'nova-api'
33 # The path of the command to validate the service;
34 # string; optional; default to '/usr/bin:/bin:/usr/sbin:/sbin'
37 # The provider to use for the exec command;
38 # string; optional; default to 'shell'
41 # Number of times to retry validation;
42 # string; optional; default to '10'
45 # Number of seconds between validation attempts;
46 # string; optional; default to '2'
48 define openstacklib::service_validation(
50 $service_name = $name,
51 $path = '/usr/bin:/bin:/usr/sbin:/sbin',
57 exec { "execute ${service_name} validation":
59 provider => $provider,
62 try_sleep => $try_sleep,
65 anchor { "create ${service_name} anchor":
66 require => Exec["execute ${service_name} validation"],