1# (c) 2019, Evgeni Golov <evgeni@redhat.com>
2#
3# This program is free software: you can redistribute it and/or modify
4# it under the terms of the GNU General Public License as published by
5# the Free Software Foundation, either version 3 of the License, or
6# (at your option) any later version.
7#
8# This program is distributed in the hope that it will be useful,
9# but WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11# GNU General Public License for more details.
12#
13# You should have received a copy of the GNU General Public License
14# along with this program.  If not, see <http://www.gnu.org/licenses/>.
15#
16
17from __future__ import absolute_import, division, print_function
18__metaclass__ = type
19
20
21class ModuleDocFragment(object):
22
23    # Foreman documentation fragment
24    DOCUMENTATION = '''
25requirements:
26  - requests
27options:
28  server_url:
29    description:
30      - URL of the Foreman server.
31      - If the value is not specified in the task, the value of environment variable C(FOREMAN_SERVER_URL) will be used instead.
32    required: true
33    type: str
34  username:
35    description:
36      - Username accessing the Foreman server.
37      - If the value is not specified in the task, the value of environment variable C(FOREMAN_USERNAME) will be used instead.
38    required: true
39    type: str
40  password:
41    description:
42      - Password of the user accessing the Foreman server.
43      - If the value is not specified in the task, the value of environment variable C(FOREMAN_PASSWORD) will be used instead.
44    required: true
45    type: str
46  validate_certs:
47    description:
48      - Whether or not to verify the TLS certificates of the Foreman server.
49      - If the value is not specified in the task, the value of environment variable C(FOREMAN_VALIDATE_CERTS) will be used instead.
50    default: true
51    type: bool
52'''
53
54    NESTED_PARAMETERS = '''
55options:
56  parameters:
57    description:
58      - Entity domain specific host parameters
59    required: false
60    type: list
61    elements: dict
62    suboptions:
63      name:
64        description:
65          - Name of the parameter
66        required: true
67        type: str
68      value:
69        description:
70          - Value of the parameter
71        required: true
72        type: raw
73      parameter_type:
74        description:
75          - Type of the parameter
76        default: 'string'
77        choices:
78          - 'string'
79          - 'boolean'
80          - 'integer'
81          - 'real'
82          - 'array'
83          - 'hash'
84          - 'yaml'
85          - 'json'
86        type: str
87'''
88
89    OS_FAMILY = '''
90options:
91  os_family:
92    description:
93      - The OS family the entity shall be assigned with.
94    required: false
95    choices:
96      - AIX
97      - Altlinux
98      - Archlinux
99      - Coreos
100      - Debian
101      - Freebsd
102      - Gentoo
103      - Junos
104      - NXOS
105      - Rancheros
106      - Redhat
107      - Solaris
108      - Suse
109      - Windows
110      - Xenserver
111    type: str
112'''
113
114    TAXONOMY = '''
115options:
116  organizations:
117    description: List of organizations the entity should be assigned to
118    type: list
119    elements: str
120  locations:
121    description: List of locations the entity should be assigned to
122    type: list
123    elements: str
124'''
125
126    ENTITY_STATE = '''
127options:
128  state:
129    description:
130      - State of the entity
131    default: present
132    choices:
133      - present
134      - absent
135    type: str
136'''
137
138    ENTITY_STATE_WITH_DEFAULTS = '''
139options:
140  state:
141    description:
142      - State of the entity
143      - C(present_with_defaults) will ensure the entity exists, but won't update existing ones
144    default: present
145    choices:
146      - present
147      - present_with_defaults
148      - absent
149    type: str
150'''
151
152    HOST_OPTIONS = '''
153options:
154  compute_resource:
155    description: Compute resource name
156    required: false
157    type: str
158  compute_profile:
159    description: Compute profile name
160    required: false
161    type: str
162  domain:
163    description: Domain name
164    required: false
165    type: str
166  subnet:
167    description: IPv4 Subnet name
168    required: false
169    type: str
170  subnet6:
171    description: IPv6 Subnet name
172    required: false
173    type: str
174  root_pass:
175    description:
176      - Root password.
177      - Will result in the entity always being updated, as the current password cannot be retrieved.
178    type: str
179    required: false
180  realm:
181    description: Realm name
182    required: false
183    type: str
184  architecture:
185    description: Architecture name
186    required: False
187    type: str
188  medium:
189    aliases: [ media ]
190    description:
191      - Medium name
192      - Mutually exclusive with I(kickstart_repository).
193    required: False
194    type: str
195  pxe_loader:
196    description: PXE Bootloader
197    required: false
198    choices:
199      - PXELinux BIOS
200      - PXELinux UEFI
201      - Grub UEFI
202      - Grub2 BIOS
203      - Grub2 ELF
204      - Grub2 UEFI
205      - Grub2 UEFI SecureBoot
206      - Grub2 UEFI HTTP
207      - Grub2 UEFI HTTPS
208      - Grub2 UEFI HTTPS SecureBoot
209      - iPXE Embedded
210      - iPXE UEFI HTTP
211      - iPXE Chain BIOS
212      - iPXE Chain UEFI
213      - None
214    type: str
215  ptable:
216    description: Partition table name
217    required: False
218    type: str
219  environment:
220    description: Puppet environment name
221    required: false
222    type: str
223  puppetclasses:
224    description: List of puppet classes to include in this host group. Must exist for hostgroup's puppet environment.
225    required: false
226    type: list
227    elements: str
228  config_groups:
229    description: Config groups list
230    required: false
231    type: list
232    elements: str
233  puppet_proxy:
234    description: Puppet server proxy name
235    required: false
236    type: str
237  puppet_ca_proxy:
238    description: Puppet CA proxy name
239    required: false
240    type: str
241  openscap_proxy:
242    description:
243      - OpenSCAP proxy name.
244      - Only available when the OpenSCAP plugin is installed.
245    required: false
246    type: str
247  content_source:
248    description:
249      - Content source.
250      - Only available for Katello installations.
251    required: false
252    type: str
253  lifecycle_environment:
254    description:
255      - Lifecycle environment.
256      - Only available for Katello installations.
257    required: false
258    type: str
259  kickstart_repository:
260    description:
261      - Kickstart repository name.
262      - You need to provide this to use the "Synced Content" feature.
263      - Mutually exclusive with I(medium).
264      - Only available for Katello installations.
265    required: false
266    type: str
267  content_view:
268    description:
269      - Content view.
270      - Only available for Katello installations.
271    required: false
272    type: str
273  activation_keys:
274    description:
275      - Activation Keys used for deployment.
276      - Comma separated list.
277      - Only available for Katello installations.
278    required: false
279    type: str
280'''
281
282    ORGANIZATION = '''
283options:
284  organization:
285    description:
286      - Organization that the entity is in
287    required: true
288    type: str
289'''
290
291    SCAP_DATASTREAM = '''
292options:
293  scap_file:
294    description:
295      - File containing XML DataStream content.
296      - Required when creating a new DataStream.
297    required: false
298    type: path
299  original_filename:
300    description:
301      - Original file name of the XML file.
302      - If unset, the filename of I(scap_file) will be used.
303    required: false
304    type: str
305'''
306
307    OPERATINGSYSTEMS = '''
308options:
309  operatingsystems:
310    description:
311      - List of operating systems the entity should be assigned to.
312      - Operating systems are looked up by their title which is composed as "<name> <major>.<minor>".
313      - You can omit the version part as long as you only have one operating system by that name.
314    required: false
315    type: list
316    elements: str
317'''
318
319    OPERATINGSYSTEM = '''
320options:
321  operatingsystem:
322    description:
323      - Operating systems are looked up by their title which is composed as "<name> <major>.<minor>".
324      - You can omit the version part as long as you only have one operating system by that name.
325    type: str
326    required: False
327'''
328
329    INFOMODULE = '''
330options:
331  name:
332    description:
333      - Name of the resource to fetch information for.
334      - Mutually exclusive with I(search).
335    required: false
336    type: str
337  location:
338    description:
339      - Label of the Location to scope the search for.
340    required: false
341    type: str
342  organization:
343    description:
344      - Name of the Organization to scope the search for.
345    required: false
346    type: str
347  search:
348    description:
349      - Search query to use
350      - If None, and I(name) is not set, all resources are returned.
351      - Mutually exclusive with I(name).
352    type: str
353'''
354
355    INFOMODULEWITHOUTNAME = '''
356options:
357  location:
358    description:
359      - Label of the Location to scope the search for.
360    required: false
361    type: str
362  organization:
363    description:
364      - Name of the Organization to scope the search for.
365    required: false
366    type: str
367  search:
368    description:
369      - Search query to use
370      - If None, all resources are returned.
371    type: str
372'''
373
374    KATELLOINFOMODULE = '''
375options:
376  organization:
377    required: true
378'''
379