-
Notifications
You must be signed in to change notification settings - Fork 264
Expand file tree
/
Copy pathcommon.rb
More file actions
157 lines (122 loc) · 3.55 KB
/
Copy pathcommon.rb
File metadata and controls
157 lines (122 loc) · 3.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
module PuppetX
module Foreman
module Common
# Parameters common to several types that use the rest_v3 api provider
REST_API_COMMON_PARAMS = Proc.new do
ensurable
newparam(:base_url) do
desc 'Foreman\'s base url.'
end
newparam(:effective_user) do
desc 'Foreman\'s effective user for the registration (usually admin).'
end
newparam(:consumer_key) do
desc 'Foreman oauth consumer_key'
end
newparam(:consumer_secret) do
desc 'Foreman oauth consumer_secret'
end
newparam(:ssl_ca) do
desc 'Foreman SSL CA (certificate authority) for verification'
end
newparam(:timeout) do
desc "Timeout for HTTP(s) requests"
munge do |value|
value = value.shift if value.is_a?(Array)
begin
value = Integer(value)
rescue ArgumentError
raise ArgumentError, "The timeout must be a number.", $!.backtrace
end
[value, 0].max
end
defaultto 500
end
autorequire(:anchor) do
['foreman::service','foreman::providers::oauth']
end
end
FOREMAN_HOST_PARAMS = Proc.new do
newparam(:name, :namevar => true) do
desc 'The name of the resource.'
end
newparam(:hostname) do
desc 'The name of the host.'
end
end
FOREMAN_DOMAIN_PARAMS = Proc.new do
newparam(:name, :namevar => true) do
desc 'The name of the domain resource.'
end
newparam(:fullname) do
desc 'The name/description of the domain.'
end
newparam(:dns_id) do
desc 'DNS Smart Proxy ID.'
end
end
FOREMAN_SUBNET_PARAMS = Proc.new do
newparam(:name, :namevar => true) do
desc 'The name of the subnet resource.'
end
newparam(:description) do
desc 'The subnet description.'
end
newparam(:network_type) do
desc 'The subnet network type, either "IPv4" or "IPv6".'
end
newparam(:network) do
desc 'The subnet network address.'
end
newparam(:cidr) do
desc 'The subnet network CIDR.'
end
newparam(:mask) do
desc 'The subnet network mask.'
end
newparam(:gateway) do
desc 'The subnet gateway.'
end
newparam(:dns_primary) do
desc 'Primary DNS address.'
end
newparam(:dns_secondary) do
desc 'Secondary DNS address.'
end
newparam(:ipam) do
desc 'IPAM Source type.'
end
newparam(:to) do
desc 'Static IPAM end address.'
end
newparam(:from) do
desc 'Static IPAM start address.'
end
newparam(:vlanid) do
desc 'VLAN ID for this subnet.'
end
newparam(:domain_ids) do
desc 'Domain IDs or searches to attribute to subnet.'
end
newparam(:dhcp_id) do
desc 'DHCP Smart Proxy ID.'
end
newparam(:tftp_id) do
desc 'TFTP Smart Proxy ID.'
end
newparam(:httpboot_id) do
desc 'HTTP Boot Smart Proxy ID.'
end
newparam(:dns_id) do
desc 'DNS Smart Proxy ID.'
end
newparam(:template_id) do
desc 'Template Smart Proxy ID.'
end
newparam(:bmc_id) do
desc 'BMC Smart Proxy ID.'
end
end
end
end
end