|
| 1 | +# frozen_string_literal: true |
| 2 | + |
1 | 3 | require 'puppet/provider/parsedfile'
|
2 | 4 |
|
3 |
| -module Puppet |
4 |
| - newtype(:oratab) do |
| 5 | +Puppet::Type.newtype(:oratab) do |
5 | 6 |
|
6 |
| - @doc = "Define database instaces in /etc/oratab with instance name |
7 |
| - home directory and a flag which indicates if the instance should |
8 |
| - be started together with the database" |
| 7 | + @doc = "Define database instaces in /etc/oratab with instance name |
| 8 | + home directory and a flag which indicates if the instance should |
| 9 | + be started together with the database" |
9 | 10 |
|
10 |
| - newparam(:name) do |
11 |
| - desc "The instance's name" |
| 11 | + newparam(:name) do |
| 12 | + desc "The instance's name" |
12 | 13 |
|
13 |
| - isnamevar |
| 14 | + isnamevar |
14 | 15 |
|
15 |
| - validate do |value| |
16 |
| - raise Puppet::Error, "Name must not contain whitespace: #{value}" if value =~ /\s/ |
17 |
| - raise Puppet::Error, "Name must not be empty" if value.empty? |
18 |
| - end |
| 16 | + validate do |value| |
| 17 | + raise Puppet::Error, "Name must not contain whitespace: #{value}" if value =~ /\s/ |
| 18 | + raise Puppet::Error, "Name must not be empty" if value.empty? |
19 | 19 | end
|
| 20 | + end |
20 | 21 |
|
21 |
| - ensurable |
| 22 | + ensurable |
22 | 23 |
|
23 |
| - newproperty(:home) do |
24 |
| - desc "The home directory of the instance. This must be an absolute |
25 |
| - path" |
| 24 | + newproperty(:home) do |
| 25 | + desc "The home directory of the instance. This must be an absolute |
| 26 | + path" |
26 | 27 |
|
27 |
| - validate do |value| |
28 |
| - raise Puppet::Error, "Home must be an absolute path: #{value}" unless value =~ /^\// |
29 |
| - end |
| 28 | + validate do |value| |
| 29 | + raise Puppet::Error, "Home must be an absolute path: #{value}" unless value =~ /^\// |
30 | 30 | end
|
| 31 | + end |
31 | 32 |
|
32 |
| - newproperty(:atboot) do |
33 |
| - desc "If the instance should start together with the database itself |
34 |
| - set this property to `yes` otherwise to `no`" |
| 33 | + newproperty(:atboot) do |
| 34 | + desc "If the instance should start together with the database itself |
| 35 | + set this property to `yes` otherwise to `no`" |
35 | 36 |
|
36 |
| - newvalues :yes, :no |
37 |
| - aliasvalue :Y, :yes |
38 |
| - aliasvalue :N, :no |
39 |
| - end |
| 37 | + newvalues :yes, :no |
| 38 | + aliasvalue :Y, :yes |
| 39 | + aliasvalue :N, :no |
| 40 | + end |
40 | 41 |
|
41 |
| - newproperty(:description) do |
42 |
| - desc "An optional description that will be added as an inline comment |
43 |
| - in the target file" |
| 42 | + newproperty(:description) do |
| 43 | + desc "An optional description that will be added as an inline comment |
| 44 | + in the target file" |
44 | 45 |
|
45 |
| - end |
| 46 | + end |
46 | 47 |
|
47 |
| - newproperty(:target) do |
48 |
| - desc "The path of the target file to store the instance information in" |
| 48 | + newproperty(:target) do |
| 49 | + desc "The path of the target file to store the instance information in" |
49 | 50 |
|
50 |
| - defaultto do |
51 |
| - if @resource.class.defaultprovider.ancestors.include?(Puppet::Provider::ParsedFile) |
52 |
| - @resource.class.defaultprovider.default_target |
53 |
| - end |
| 51 | + defaultto do |
| 52 | + if @resource.class.defaultprovider.ancestors.include?(Puppet::Provider::ParsedFile) |
| 53 | + @resource.class.defaultprovider.default_target |
54 | 54 | end
|
55 | 55 | end
|
56 | 56 | end
|
|
0 commit comments