1 # |
|
2 # CDDL HEADER START |
|
3 # |
|
4 # The contents of this file are subject to the terms of the |
|
5 # Common Development and Distribution License (the "License"). |
|
6 # You may not use this file except in compliance with the License. |
|
7 # |
|
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
|
9 # or http://www.opensolaris.org/os/licensing. |
|
10 # See the License for the specific language governing permissions |
|
11 # and limitations under the License. |
|
12 # |
|
13 # When distributing Covered Code, include this CDDL HEADER in each |
|
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
|
15 # If applicable, add the following below this CDDL HEADER, with the |
|
16 # fields enclosed by brackets "[]" replaced with your own identifying |
|
17 # information: Portions Copyright [yyyy] [name of copyright owner] |
|
18 # |
|
19 # CDDL HEADER END |
|
20 # |
|
21 |
|
22 # |
|
23 # Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. |
|
24 # |
|
25 |
|
26 Puppet::Type.newtype(:address_object) do |
|
27 @doc = "Manage the configuration of Oracle Solaris address objects" |
|
28 |
|
29 ensurable |
|
30 |
|
31 newparam(:name) do |
|
32 desc "The name of the address object or interface" |
|
33 isnamevar |
|
34 end |
|
35 |
|
36 newparam(:temporary) do |
|
37 desc "Optional parameter that specifies that the address object is |
|
38 temporary. Temporary address objects last until the next reboot." |
|
39 newvalues(:true, :false) |
|
40 end |
|
41 |
|
42 newproperty(:address_type) do |
|
43 desc "The type of address object to create. Valid values are static, |
|
44 dhcp, addrconf." |
|
45 # add from_gz as a valid value, even though users should not specify it |
|
46 newvalues(:static, :dhcp, :addrconf, :from_gz) |
|
47 end |
|
48 |
|
49 newproperty(:enable) do |
|
50 desc "Specifies the address object should be enabled or disabled. |
|
51 This property is only applied temporarily, until next reboot." |
|
52 newvalues(:true, :false) |
|
53 end |
|
54 |
|
55 newproperty(:address) do |
|
56 desc "A literal IP address or a hostname corresponding to the local |
|
57 end-point. An optional prefix length may be specified. Only |
|
58 valid with an address_type of 'static'" |
|
59 end |
|
60 |
|
61 newproperty(:remote_address) do |
|
62 desc "A literal IP address or a hostname corresponding to an optional |
|
63 remote end-point. An optional prefix length may be specified. |
|
64 Only valid with an address_type of 'static'" |
|
65 end |
|
66 |
|
67 newproperty(:down) do |
|
68 desc "Specifies that the configured address should be marked down. |
|
69 Only valid with an address_type of 'static'." |
|
70 newvalues(:true, :false) |
|
71 end |
|
72 |
|
73 newproperty(:seconds) do |
|
74 desc "Specifies the amount of time in seconds to wait until the |
|
75 operation completes. Only valid with an address_type of |
|
76 'dhcp'. Valid values are a numerical value in seconds or |
|
77 'forever'" |
|
78 end |
|
79 |
|
80 newproperty(:hostname) do |
|
81 desc "Specifies the hostname to which the client would like the DHCP |
|
82 server to map the client's leased IPv4 address. Only valid |
|
83 with an address_type of 'dhcp'" |
|
84 end |
|
85 |
|
86 newproperty(:interface_id) do |
|
87 desc "Specifies the local interface ID to be used for generating |
|
88 auto-configured addresses. Only valid with an address_type of |
|
89 'addrconf'" |
|
90 end |
|
91 |
|
92 newproperty(:remote_interface_id) do |
|
93 desc "Specifies an optional remote interface ID to be used for |
|
94 generating auto-configured addresses. Only valid with an |
|
95 address_type of 'addrconf'" |
|
96 end |
|
97 |
|
98 newproperty(:stateful) do |
|
99 desc "Specifies if stateful auto-configuration should be enabled or |
|
100 not." |
|
101 newvalues(:yes, :no) |
|
102 end |
|
103 |
|
104 newproperty(:stateless) do |
|
105 desc "Specifies if stateless auto-configuration should be enabled or |
|
106 not." |
|
107 newvalues(:yes, :no) |
|
108 end |
|
109 end |
|