OSDN Git Service

adds the `platform_utils::pip` recipe.
[metasearch/grid-chef-repo.git] / cookbooks / platform_utils / libraries / package_utils.rb
1 #
2 # Cookbook Name:: platform_utils
3 # Library:: PackageUtils
4 #
5 # Copyright 2017, whitestar
6 #
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
10 #
11 #     http://www.apache.org/licenses/LICENSE-2.0
12 #
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
18 #
19
20 module PlatformUtils
21   # Package utilities methods
22   module PackageUtils
23     def cron_pkg_name
24       case node['platform_family']
25       when 'debian'then 'cron'
26       when 'rhel'  then 'crontabs'
27       end
28     end
29
30     def cron_serv_name
31       case node['platform_family']
32       when 'debian'then 'cron'
33       when 'rhel'  then 'crond'
34       end
35     end
36
37     def httpd_pkg_name
38       case node['platform_family']
39       when 'debian'then 'apache2'
40       when 'rhel'  then 'httpd'
41       end
42     end
43
44     def httpd_serv_name
45       case node['platform_family']
46       when 'debian'then 'apache2'
47       when 'rhel'  then 'httpd'
48       end
49     end
50
51     def jsvc_pkg_name
52       case node['platform_family']
53       when 'debian' then 'jsvc'
54       when 'rhel'   then 'jakarta-commons-daemon-jsvc'
55       end
56     end
57
58     def libbz2_pkg_name
59       case node['platform_family']
60       when 'debian' then 'libbz2-1.0'
61       when 'rhel'   then 'bzip2-libs'
62       end
63     end
64   end
65 end