mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-03-26 21:33:02 +00:00
Issue #1: Restructure role into collection using content_collector.
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
the .tito/packages directory contains metadata files
|
||||
named after their packages. Each file has the latest tagged
|
||||
version and the project's relative directory.
|
||||
@@ -1 +0,0 @@
|
||||
0.4.0-8 ./
|
||||
@@ -1,30 +0,0 @@
|
||||
[asb-copr]
|
||||
releaser = tito.release.CoprReleaser
|
||||
project_name = @ansible-service-broker/ansible-service-broker-latest
|
||||
upload_command = scp -4 %(srpm)s $fas_username@fedorapeople.org:/srv/repos/asb
|
||||
remote_location = http://repos.fedorapeople.org/asb/
|
||||
copr_options = --timeout 600
|
||||
|
||||
[asb-copr-test]
|
||||
releaser = tito.release.CoprReleaser
|
||||
project_name = @ansible-service-broker/ansible-service-broker-nightly
|
||||
upload_command = scp -4 %(srpm)s $fas_username@fedorapeople.org:/srv/repos/asb
|
||||
remote_location = http://repos.fedorapeople.org/asb/
|
||||
copr_options = --timeout 600
|
||||
builder.test = 1
|
||||
|
||||
[asb-brew-36]
|
||||
releaser = tito.release.DistGitReleaser
|
||||
branches = rhaos-3.6-asb-rhel-7
|
||||
|
||||
[asb-brew-37]
|
||||
releaser = tito.release.DistGitReleaser
|
||||
branches = rhaos-3.7-asb-rhel-7
|
||||
|
||||
[asb-brew-38]
|
||||
releaser = tito.release.DistGitReleaser
|
||||
branches = rhaos-3.8-asb-rhel-7
|
||||
|
||||
[asb-brew-39]
|
||||
releaser = tito.release.DistGitReleaser
|
||||
branches = rhaos-3.9-asb-rhel-7
|
||||
@@ -1,5 +0,0 @@
|
||||
[buildconfig]
|
||||
builder = tito.builder.Builder
|
||||
tagger = tito.tagger.ReleaseTagger
|
||||
changelog_do_not_remove_cherrypick = 0
|
||||
changelog_format = %s (%ae)
|
||||
34
.travis.yml
34
.travis.yml
@@ -1,34 +0,0 @@
|
||||
---
|
||||
language: python
|
||||
python: "2.7"
|
||||
|
||||
# Use the new container infrastructure
|
||||
sudo: false
|
||||
|
||||
# Install ansible
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- python-pip
|
||||
|
||||
install:
|
||||
# Install prereqs
|
||||
- pip install https://github.com/ansible/ansible/archive/devel.tar.gz
|
||||
- pip install openshift
|
||||
- pip list | grep openshift
|
||||
|
||||
# Start OpenShift
|
||||
- docker run --publish 8443:8443 -d --name openshift openshift/origin:v3.7.1 start master --listen https://0.0.0.0:8443
|
||||
- sleep 15
|
||||
|
||||
# Fetch a copy of the kube config file
|
||||
- docker exec -it openshift cat /var/lib/origin/openshift.local.config/master/admin.kubeconfig >tests/konfig.json
|
||||
|
||||
- printf '[defaults]\nroles_path=../' >ansible.cfg
|
||||
- echo "localhost ansible_connection=local ansible_python_interpreter=$(which python)">tests/inventory
|
||||
|
||||
script:
|
||||
- ansible-playbook -i tests/inventory -vvv tests/test.yml
|
||||
|
||||
notifications:
|
||||
webhooks: https://galaxy.ansible.com/api/v1/notifications/
|
||||
811
LICENSE
811
LICENSE
@@ -1,201 +1,674 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
1. Definitions.
|
||||
Preamble
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
0. Definitions.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
1. Source Code.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "{}"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
Copyright {yyyy} {name of copyright owner}
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
2. Basic Permissions.
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||
@@ -1,7 +1,5 @@
|
||||
# Kubernetes Collection for Ansible
|
||||
|
||||
[](https://travis-ci.org/ansible-collections/kubernetes)
|
||||
|
||||
This repo hosts the `community.kubernetes` Ansible Collection.
|
||||
|
||||
As this is an independent Collection, it can be released on its own release cadence.
|
||||
@@ -16,4 +14,4 @@ For more information see `#ansible-community` on Freenode IRC, or the [Kubernete
|
||||
|
||||
GNU General Public License v3.0 or later
|
||||
|
||||
See LICENCING to see the full text.
|
||||
See LICENCE to see the full text.
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
Name: ansible-kubernetes-modules
|
||||
Version: 0.4.0
|
||||
Release: 8%{?dist}
|
||||
Summary: Ansible role containing pre-release K8s modules
|
||||
License: ASL 2.0
|
||||
URL: https://github.com/ansible/%{name}
|
||||
Source0: https://github.com/ansible/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz
|
||||
|
||||
BuildArch: noarch
|
||||
|
||||
Requires: ansible >= 2.3.0.0
|
||||
Requires: python-openshift >= 0.4
|
||||
|
||||
%description
|
||||
%{summary}
|
||||
|
||||
%prep
|
||||
%autosetup -p1
|
||||
|
||||
%build
|
||||
|
||||
%install
|
||||
mkdir -p %{buildroot}%{_sysconfdir}/ansible/roles/ansible.kubernetes-modules
|
||||
mv * %{buildroot}%{_sysconfdir}/ansible/roles/ansible.kubernetes-modules
|
||||
|
||||
%check
|
||||
|
||||
%files
|
||||
%{_sysconfdir}/ansible/roles/ansible.kubernetes-modules
|
||||
|
||||
%changelog
|
||||
* Fri Jan 19 2018 David Zager <david.j.zager@gmail.com> 0.4.0-8
|
||||
- when in checkmode _create returns None and cannot have to_dict() called (#27)
|
||||
(trbs@users.noreply.github.com)
|
||||
- Show openshift version (chousekn@redhat.com)
|
||||
- Unpin openshift (chousekn@redhat.com)
|
||||
- regen modules (fabian@fabianism.us)
|
||||
- Pin openshift. Trying Origin 3.6.7. (chousekn@redhat.com)
|
||||
|
||||
* Wed Jan 17 2018 David Zager <david.j.zager@gmail.com> 0.4.0-7
|
||||
- Bump package version for 4.x (david.j.zager@gmail.com)
|
||||
- Update releasers (david.j.zager@gmail.com)
|
||||
- update generated modules (#26) (fabian@fabianism.us)
|
||||
|
||||
* Mon Oct 16 2017 Jason Montleon <jmontleo@redhat.com> 0.3.1-6
|
||||
- Update to latest k8s_common (chousekn@redhat.com)
|
||||
|
||||
* Fri Oct 13 2017 Jason Montleon <jmontleo@redhat.com> 0.3.1-5
|
||||
- increment release
|
||||
|
||||
* Fri Oct 13 2017 Jason Montleon <jmontleo@redhat.com> 0.3.1-4
|
||||
- Bump version
|
||||
|
||||
* Fri Oct 13 2017 Jason Montleon <jmontleo@redhat.com> 0.3.1-3
|
||||
- add python-openshift rpm dependency (jmontleo@redhat.com)
|
||||
- Travis file cleanup (#13) (chousekn@redhat.com)
|
||||
- Removes -i inventory (chousekn@redhat.com)
|
||||
- Removes ansible-galaxy install (chousekn@redhat.com)
|
||||
- Regen modules. Add tests. (chousekn@redhat.com)
|
||||
- Add Travis button (chousekn@redhat.com)
|
||||
- Add simple module test (chousekn@redhat.com)
|
||||
- Adds latest generated modules (chousekn@redhat.com)
|
||||
|
||||
* Fri Oct 06 2017 Jason Montleon <jmontleo@redhat.com> 0.3.1-2
|
||||
- new package built with tito
|
||||
|
||||
* Fri Oct 06 2017 Jason Montleon <jmontleo@redhat.com>
|
||||
- new package built with tito
|
||||
|
||||
* Fri May 12 2017 Jason Montleon <jmontleo@redhat.com> - 0.0.1-1
|
||||
- initial package
|
||||
@@ -1,3 +0,0 @@
|
||||
---
|
||||
install_python_requirements: no
|
||||
virtualenv:
|
||||
20
galaxy.yml
Normal file
20
galaxy.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
authors: []
|
||||
dependencies: {}
|
||||
description: Kubernetes Collection for Ansible.
|
||||
documentation: ''
|
||||
homepage: ''
|
||||
issues: https://github.com/ansible-collections/kubernetes/issues
|
||||
license_file: LICENSE
|
||||
name: kubernetes
|
||||
namespace: community
|
||||
readme: README.md
|
||||
repository: https://github.com/ansible-collections/kubernetes
|
||||
tags:
|
||||
- kubernetes
|
||||
- k8s
|
||||
- cloud
|
||||
- infrastructure
|
||||
- openshift
|
||||
- okd
|
||||
- cluster
|
||||
version: 0.9.0
|
||||
@@ -1,580 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_apps_v1beta1_deployment
|
||||
short_description: Kubernetes Deployment
|
||||
description:
|
||||
- Manage the lifecycle of a deployment object. Supports check mode, and attempts to
|
||||
to be idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
spec_min_ready_seconds:
|
||||
description:
|
||||
- Minimum number of seconds for which a newly created pod should be ready without
|
||||
any of its container crashing, for it to be considered available. Defaults to
|
||||
0 (pod will be considered available as soon as it is ready)
|
||||
aliases:
|
||||
- min_ready_seconds
|
||||
type: int
|
||||
spec_paused:
|
||||
description:
|
||||
- Indicates that the deployment is paused.
|
||||
aliases:
|
||||
- paused
|
||||
type: bool
|
||||
spec_progress_deadline_seconds:
|
||||
description:
|
||||
- The maximum time in seconds for a deployment to make progress before it is considered
|
||||
to be failed. The deployment controller will continue to process failed deployments
|
||||
and a condition with a ProgressDeadlineExceeded reason will be surfaced in the
|
||||
deployment status. Note that progress will not be estimated during the time
|
||||
a deployment is paused. Defaults to 600s.
|
||||
aliases:
|
||||
- progress_deadline_seconds
|
||||
type: int
|
||||
spec_replicas:
|
||||
description:
|
||||
- Number of desired pods. This is a pointer to distinguish between explicit zero
|
||||
and not specified. Defaults to 1.
|
||||
aliases:
|
||||
- replicas
|
||||
type: int
|
||||
spec_revision_history_limit:
|
||||
description:
|
||||
- The number of old ReplicaSets to retain to allow rollback. This is a pointer
|
||||
to distinguish between explicit zero and not specified. Defaults to 2.
|
||||
aliases:
|
||||
- revision_history_limit
|
||||
type: int
|
||||
spec_rollback_to_revision:
|
||||
description:
|
||||
- The revision to rollback to. If set to 0, rollback to the last revision.
|
||||
aliases:
|
||||
- rollback_to_revision
|
||||
type: int
|
||||
spec_selector_match_expressions:
|
||||
description:
|
||||
- matchExpressions is a list of label selector requirements. The requirements
|
||||
are ANDed.
|
||||
aliases:
|
||||
- selector_match_expressions
|
||||
type: list
|
||||
spec_selector_match_labels:
|
||||
description:
|
||||
- matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
|
||||
map is equivalent to an element of matchExpressions, whose key field is "key",
|
||||
the operator is "In", and the values array contains only "value". The requirements
|
||||
are ANDed.
|
||||
aliases:
|
||||
- selector_match_labels
|
||||
type: dict
|
||||
spec_strategy_rolling_update_max_surge:
|
||||
description:
|
||||
- 'The maximum number of pods that can be scheduled above the desired number of
|
||||
pods. Value can be an absolute number (ex: 5) or a percentage of desired pods
|
||||
(ex: 10%). This can not be 0 if MaxUnavailable is 0. Absolute number is calculated
|
||||
from percentage by rounding up. Defaults to 25%. Example: when this is set to
|
||||
30%, the new RC can be scaled up immediately when the rolling update starts,
|
||||
such that the total number of old and new pods do not exceed 130% of desired
|
||||
pods. Once old pods have been killed, new RC can be scaled up further, ensuring
|
||||
that total number of pods running at any time during the update is atmost 130%
|
||||
of desired pods.'
|
||||
aliases:
|
||||
- strategy_rolling_update_max_surge
|
||||
type: object
|
||||
spec_strategy_rolling_update_max_unavailable:
|
||||
description:
|
||||
- 'The maximum number of pods that can be unavailable during the update. Value
|
||||
can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
|
||||
Absolute number is calculated from percentage by rounding down. This can not
|
||||
be 0 if MaxSurge is 0. Defaults to 25%. Example: when this is set to 30%, the
|
||||
old RC can be scaled down to 70% of desired pods immediately when the rolling
|
||||
update starts. Once new pods are ready, old RC can be scaled down further, followed
|
||||
by scaling up the new RC, ensuring that the total number of pods available at
|
||||
all times during the update is at least 70% of desired pods.'
|
||||
aliases:
|
||||
- strategy_rolling_update_max_unavailable
|
||||
type: object
|
||||
spec_strategy_type:
|
||||
description:
|
||||
- Type of deployment. Can be "Recreate" or "RollingUpdate". Default is RollingUpdate.
|
||||
aliases:
|
||||
- strategy_type
|
||||
spec_template_metadata_annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
spec_template_metadata_labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
spec_template_metadata_name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
spec_template_metadata_namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
spec_template_spec_active_deadline_seconds:
|
||||
description:
|
||||
- Optional duration in seconds the pod may be active on the node relative to StartTime
|
||||
before the system will actively try to mark it failed and kill associated containers.
|
||||
Value must be a positive integer.
|
||||
aliases:
|
||||
- active_deadline_seconds
|
||||
type: int
|
||||
spec_template_spec_affinity_node_affinity_preferred_during_scheduling_ignored_during_execution:
|
||||
description:
|
||||
- The scheduler will prefer to schedule pods to nodes that satisfy the affinity
|
||||
expressions specified by this field, but it may choose a node that violates
|
||||
one or more of the expressions. The node that is most preferred is the one with
|
||||
the greatest sum of weights, i.e. for each node that meets all of the scheduling
|
||||
requirements (resource request, requiredDuringScheduling affinity expressions,
|
||||
etc.), compute a sum by iterating through the elements of this field and adding
|
||||
"weight" to the sum if the node matches the corresponding matchExpressions;
|
||||
the node(s) with the highest sum are the most preferred.
|
||||
aliases:
|
||||
- affinity_node_affinity_preferred_during_scheduling_ignored_during_execution
|
||||
type: list
|
||||
spec_template_spec_affinity_node_affinity_required_during_scheduling_ignored_during_execution_node_selector_terms:
|
||||
description:
|
||||
- Required. A list of node selector terms. The terms are ORed.
|
||||
aliases:
|
||||
- affinity_node_affinity_required_during_scheduling_ignored_during_execution_node_selector_terms
|
||||
type: list
|
||||
spec_template_spec_affinity_pod_affinity_preferred_during_scheduling_ignored_during_execution:
|
||||
description:
|
||||
- The scheduler will prefer to schedule pods to nodes that satisfy the affinity
|
||||
expressions specified by this field, but it may choose a node that violates
|
||||
one or more of the expressions. The node that is most preferred is the one with
|
||||
the greatest sum of weights, i.e. for each node that meets all of the scheduling
|
||||
requirements (resource request, requiredDuringScheduling affinity expressions,
|
||||
etc.), compute a sum by iterating through the elements of this field and adding
|
||||
"weight" to the sum if the node has pods which matches the corresponding podAffinityTerm;
|
||||
the node(s) with the highest sum are the most preferred.
|
||||
aliases:
|
||||
- affinity_pod_affinity_preferred_during_scheduling_ignored_during_execution
|
||||
type: list
|
||||
spec_template_spec_affinity_pod_affinity_required_during_scheduling_ignored_during_execution:
|
||||
description:
|
||||
- If the affinity requirements specified by this field are not met at scheduling
|
||||
time, the pod will not be scheduled onto the node. If the affinity requirements
|
||||
specified by this field cease to be met at some point during pod execution (e.g.
|
||||
due to a pod label update), the system may or may not try to eventually evict
|
||||
the pod from its node. When there are multiple elements, the lists of nodes
|
||||
corresponding to each podAffinityTerm are intersected, i.e. all terms must be
|
||||
satisfied.
|
||||
aliases:
|
||||
- affinity_pod_affinity_required_during_scheduling_ignored_during_execution
|
||||
type: list
|
||||
spec_template_spec_affinity_pod_anti_affinity_preferred_during_scheduling_ignored_during_execution:
|
||||
description:
|
||||
- The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity
|
||||
expressions specified by this field, but it may choose a node that violates
|
||||
one or more of the expressions. The node that is most preferred is the one with
|
||||
the greatest sum of weights, i.e. for each node that meets all of the scheduling
|
||||
requirements (resource request, requiredDuringScheduling anti-affinity expressions,
|
||||
etc.), compute a sum by iterating through the elements of this field and adding
|
||||
"weight" to the sum if the node has pods which matches the corresponding podAffinityTerm;
|
||||
the node(s) with the highest sum are the most preferred.
|
||||
aliases:
|
||||
- affinity_pod_anti_affinity_preferred_during_scheduling_ignored_during_execution
|
||||
type: list
|
||||
spec_template_spec_affinity_pod_anti_affinity_required_during_scheduling_ignored_during_execution:
|
||||
description:
|
||||
- If the anti-affinity requirements specified by this field are not met at scheduling
|
||||
time, the pod will not be scheduled onto the node. If the anti-affinity requirements
|
||||
specified by this field cease to be met at some point during pod execution (e.g.
|
||||
due to a pod label update), the system may or may not try to eventually evict
|
||||
the pod from its node. When there are multiple elements, the lists of nodes
|
||||
corresponding to each podAffinityTerm are intersected, i.e. all terms must be
|
||||
satisfied.
|
||||
aliases:
|
||||
- affinity_pod_anti_affinity_required_during_scheduling_ignored_during_execution
|
||||
type: list
|
||||
spec_template_spec_automount_service_account_token:
|
||||
description:
|
||||
- AutomountServiceAccountToken indicates whether a service account token should
|
||||
be automatically mounted.
|
||||
aliases:
|
||||
- automount_service_account_token
|
||||
type: bool
|
||||
spec_template_spec_containers:
|
||||
description:
|
||||
- List of containers belonging to the pod. Containers cannot currently be added
|
||||
or removed. There must be at least one container in a Pod. Cannot be updated.
|
||||
aliases:
|
||||
- containers
|
||||
type: list
|
||||
spec_template_spec_dns_policy:
|
||||
description:
|
||||
- Set DNS policy for containers within the pod. One of 'ClusterFirstWithHostNet',
|
||||
'ClusterFirst' or 'Default'. Defaults to "ClusterFirst". To have DNS options
|
||||
set along with hostNetwork, you have to specify DNS policy explicitly to 'ClusterFirstWithHostNet'.
|
||||
aliases:
|
||||
- dns_policy
|
||||
spec_template_spec_host_aliases:
|
||||
description:
|
||||
- HostAliases is an optional list of hosts and IPs that will be injected into
|
||||
the pod's hosts file if specified. This is only valid for non-hostNetwork pods.
|
||||
aliases:
|
||||
- host_aliases
|
||||
type: list
|
||||
spec_template_spec_host_ipc:
|
||||
description:
|
||||
- "Use the host's ipc namespace. Optional: Default to false."
|
||||
aliases:
|
||||
- host_ipc
|
||||
type: bool
|
||||
spec_template_spec_host_network:
|
||||
description:
|
||||
- Host networking requested for this pod. Use the host's network namespace. If
|
||||
this option is set, the ports that will be used must be specified. Default to
|
||||
false.
|
||||
aliases:
|
||||
- host_network
|
||||
type: bool
|
||||
spec_template_spec_host_pid:
|
||||
description:
|
||||
- "Use the host's pid namespace. Optional: Default to false."
|
||||
aliases:
|
||||
- host_pid
|
||||
type: bool
|
||||
spec_template_spec_hostname:
|
||||
description:
|
||||
- Specifies the hostname of the Pod If not specified, the pod's hostname will
|
||||
be set to a system-defined value.
|
||||
aliases:
|
||||
- hostname
|
||||
spec_template_spec_image_pull_secrets:
|
||||
description:
|
||||
- ImagePullSecrets is an optional list of references to secrets in the same namespace
|
||||
to use for pulling any of the images used by this PodSpec. If specified, these
|
||||
secrets will be passed to individual puller implementations for them to use.
|
||||
For example, in the case of docker, only DockerConfig type secrets are honored.
|
||||
aliases:
|
||||
- image_pull_secrets
|
||||
type: list
|
||||
spec_template_spec_init_containers:
|
||||
description:
|
||||
- List of initialization containers belonging to the pod. Init containers are
|
||||
executed in order prior to containers being started. If any init container fails,
|
||||
the pod is considered to have failed and is handled according to its restartPolicy.
|
||||
The name for an init container or normal container must be unique among all
|
||||
containers. Init containers may not have Lifecycle actions, Readiness probes,
|
||||
or Liveness probes. The resourceRequirements of an init container are taken
|
||||
into account during scheduling by finding the highest request/limit for each
|
||||
resource type, and then using the max of of that value or the sum of the normal
|
||||
containers. Limits are applied to init containers in a similar fashion. Init
|
||||
containers cannot currently be added or removed. Cannot be updated.
|
||||
aliases:
|
||||
- init_containers
|
||||
type: list
|
||||
spec_template_spec_node_name:
|
||||
description:
|
||||
- NodeName is a request to schedule this pod onto a specific node. If it is non-empty,
|
||||
the scheduler simply schedules this pod onto that node, assuming that it fits
|
||||
resource requirements.
|
||||
aliases:
|
||||
- node_name
|
||||
spec_template_spec_node_selector:
|
||||
description:
|
||||
- NodeSelector is a selector which must be true for the pod to fit on a node.
|
||||
Selector which must match a node's labels for the pod to be scheduled on that
|
||||
node.
|
||||
aliases:
|
||||
- node_selector
|
||||
type: dict
|
||||
spec_template_spec_priority:
|
||||
description:
|
||||
- The priority value. Various system components use this field to find the priority
|
||||
of the pod. When Priority Admission Controller is enabled, it prevents users
|
||||
from setting this field. The admission controller populates this field from
|
||||
PriorityClassName. The higher the value, the higher the priority.
|
||||
aliases:
|
||||
- priority
|
||||
type: int
|
||||
spec_template_spec_priority_class_name:
|
||||
description:
|
||||
- If specified, indicates the pod's priority. "SYSTEM" is a special keyword which
|
||||
indicates the highest priority. Any other name must be defined by creating a
|
||||
PriorityClass object with that name. If not specified, the pod priority will
|
||||
be default or zero if there is no default.
|
||||
aliases:
|
||||
- priority_class_name
|
||||
spec_template_spec_restart_policy:
|
||||
description:
|
||||
- Restart policy for all containers within the pod. One of Always, OnFailure,
|
||||
Never. Default to Always.
|
||||
aliases:
|
||||
- restart_policy
|
||||
spec_template_spec_scheduler_name:
|
||||
description:
|
||||
- If specified, the pod will be dispatched by specified scheduler. If not specified,
|
||||
the pod will be dispatched by default scheduler.
|
||||
aliases:
|
||||
- scheduler_name
|
||||
spec_template_spec_security_context_fs_group:
|
||||
description:
|
||||
- "A special supplemental group that applies to all containers in a pod. Some\
|
||||
\ volume types allow the Kubelet to change the ownership of that volume to be\
|
||||
\ owned by the pod: 1. The owning GID will be the FSGroup 2. The setgid bit\
|
||||
\ is set (new files created in the volume will be owned by FSGroup) 3. The permission\
|
||||
\ bits are OR'd with rw-rw---- If unset, the Kubelet will not modify the ownership\
|
||||
\ and permissions of any volume."
|
||||
aliases:
|
||||
- security_context_fs_group
|
||||
type: int
|
||||
spec_template_spec_security_context_run_as_non_root:
|
||||
description:
|
||||
- Indicates that the container must run as a non-root user. If true, the Kubelet
|
||||
will validate the image at runtime to ensure that it does not run as UID 0 (root)
|
||||
and fail to start the container if it does. If unset or false, no such validation
|
||||
will be performed. May also be set in SecurityContext. If set in both SecurityContext
|
||||
and PodSecurityContext, the value specified in SecurityContext takes precedence.
|
||||
aliases:
|
||||
- security_context_run_as_non_root
|
||||
type: bool
|
||||
spec_template_spec_security_context_run_as_user:
|
||||
description:
|
||||
- The UID to run the entrypoint of the container process. Defaults to user specified
|
||||
in image metadata if unspecified. May also be set in SecurityContext. If set
|
||||
in both SecurityContext and PodSecurityContext, the value specified in SecurityContext
|
||||
takes precedence for that container.
|
||||
aliases:
|
||||
- security_context_run_as_user
|
||||
type: int
|
||||
spec_template_spec_security_context_se_linux_options_level:
|
||||
description:
|
||||
- Level is SELinux level label that applies to the container.
|
||||
aliases:
|
||||
- security_context_se_linux_options_level
|
||||
spec_template_spec_security_context_se_linux_options_role:
|
||||
description:
|
||||
- Role is a SELinux role label that applies to the container.
|
||||
aliases:
|
||||
- security_context_se_linux_options_role
|
||||
spec_template_spec_security_context_se_linux_options_type:
|
||||
description:
|
||||
- Type is a SELinux type label that applies to the container.
|
||||
aliases:
|
||||
- security_context_se_linux_options_type
|
||||
spec_template_spec_security_context_se_linux_options_user:
|
||||
description:
|
||||
- User is a SELinux user label that applies to the container.
|
||||
aliases:
|
||||
- security_context_se_linux_options_user
|
||||
spec_template_spec_security_context_supplemental_groups:
|
||||
description:
|
||||
- A list of groups applied to the first process run in each container, in addition
|
||||
to the container's primary GID. If unspecified, no groups will be added to any
|
||||
container.
|
||||
aliases:
|
||||
- security_context_supplemental_groups
|
||||
type: list
|
||||
spec_template_spec_service_account:
|
||||
description:
|
||||
- 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. Deprecated:
|
||||
Use serviceAccountName instead.'
|
||||
aliases:
|
||||
- service_account
|
||||
spec_template_spec_service_account_name:
|
||||
description:
|
||||
- ServiceAccountName is the name of the ServiceAccount to use to run this pod.
|
||||
aliases:
|
||||
- service_account_name
|
||||
spec_template_spec_subdomain:
|
||||
description:
|
||||
- If specified, the fully qualified Pod hostname will be "<hostname>.<subdomain>.<pod
|
||||
namespace>.svc.<cluster domain>". If not specified, the pod will not have a
|
||||
domainname at all.
|
||||
aliases:
|
||||
- subdomain
|
||||
spec_template_spec_termination_grace_period_seconds:
|
||||
description:
|
||||
- Optional duration in seconds the pod needs to terminate gracefully. May be decreased
|
||||
in delete request. Value must be non-negative integer. The value zero indicates
|
||||
delete immediately. If this value is nil, the default grace period will be used
|
||||
instead. The grace period is the duration in seconds after the processes running
|
||||
in the pod are sent a termination signal and the time when the processes are
|
||||
forcibly halted with a kill signal. Set this value longer than the expected
|
||||
cleanup time for your process. Defaults to 30 seconds.
|
||||
aliases:
|
||||
- termination_grace_period_seconds
|
||||
type: int
|
||||
spec_template_spec_tolerations:
|
||||
description:
|
||||
- If specified, the pod's tolerations.
|
||||
aliases:
|
||||
- tolerations
|
||||
type: list
|
||||
spec_template_spec_volumes:
|
||||
description:
|
||||
- List of volumes that can be mounted by containers belonging to the pod.
|
||||
aliases:
|
||||
- volumes
|
||||
type: list
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
deployment:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object metadata.
|
||||
type: complex
|
||||
spec:
|
||||
description:
|
||||
- Specification of the desired behavior of the Deployment.
|
||||
type: complex
|
||||
status:
|
||||
description:
|
||||
- Most recently observed status of the Deployment.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('deployment', 'apps_v1beta1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,165 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_apps_v1beta1_deployment_list
|
||||
short_description: Kubernetes DeploymentList
|
||||
description:
|
||||
- Retrieve a list of deployments. List operations provide a snapshot read of the underlying
|
||||
objects, returning a resource_version representing a consistent version of the listed
|
||||
objects.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
deployment_list:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
items:
|
||||
description:
|
||||
- Items is the list of Deployments.
|
||||
type: list
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value,
|
||||
and may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object metadata.
|
||||
type: complex
|
||||
spec:
|
||||
description:
|
||||
- Specification of the desired behavior of the Deployment.
|
||||
type: complex
|
||||
status:
|
||||
description:
|
||||
- Most recently observed status of the Deployment.
|
||||
type: complex
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard list metadata.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('deployment_list', 'apps_v1beta1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,148 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_apps_v1beta1_scale
|
||||
short_description: Kubernetes Scale
|
||||
description:
|
||||
- Manage the lifecycle of a scale object. Supports check mode, and attempts to to
|
||||
be idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
spec_replicas:
|
||||
description:
|
||||
- desired number of instances for the scaled object.
|
||||
aliases:
|
||||
- replicas
|
||||
type: int
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
scale:
|
||||
type: complex
|
||||
returned: on success
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object metadata;
|
||||
type: complex
|
||||
spec:
|
||||
description:
|
||||
- defines the behavior of the scale.
|
||||
type: complex
|
||||
status:
|
||||
description:
|
||||
- current status of the scale.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('scale', 'apps_v1beta1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,582 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_extensions_v1beta1_deployment
|
||||
short_description: Kubernetes Deployment
|
||||
description:
|
||||
- Manage the lifecycle of a deployment object. Supports check mode, and attempts to
|
||||
to be idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
spec_min_ready_seconds:
|
||||
description:
|
||||
- Minimum number of seconds for which a newly created pod should be ready without
|
||||
any of its container crashing, for it to be considered available. Defaults to
|
||||
0 (pod will be considered available as soon as it is ready)
|
||||
aliases:
|
||||
- min_ready_seconds
|
||||
type: int
|
||||
spec_paused:
|
||||
description:
|
||||
- Indicates that the deployment is paused and will not be processed by the deployment
|
||||
controller.
|
||||
aliases:
|
||||
- paused
|
||||
type: bool
|
||||
spec_progress_deadline_seconds:
|
||||
description:
|
||||
- The maximum time in seconds for a deployment to make progress before it is considered
|
||||
to be failed. The deployment controller will continue to process failed deployments
|
||||
and a condition with a ProgressDeadlineExceeded reason will be surfaced in the
|
||||
deployment status. Note that progress will not be estimated during the time
|
||||
a deployment is paused. This is not set by default.
|
||||
aliases:
|
||||
- progress_deadline_seconds
|
||||
type: int
|
||||
spec_replicas:
|
||||
description:
|
||||
- Number of desired pods. This is a pointer to distinguish between explicit zero
|
||||
and not specified. Defaults to 1.
|
||||
aliases:
|
||||
- replicas
|
||||
type: int
|
||||
spec_revision_history_limit:
|
||||
description:
|
||||
- The number of old ReplicaSets to retain to allow rollback. This is a pointer
|
||||
to distinguish between explicit zero and not specified.
|
||||
aliases:
|
||||
- revision_history_limit
|
||||
type: int
|
||||
spec_rollback_to_revision:
|
||||
description:
|
||||
- The revision to rollback to. If set to 0, rollback to the last revision.
|
||||
aliases:
|
||||
- rollback_to_revision
|
||||
type: int
|
||||
spec_selector_match_expressions:
|
||||
description:
|
||||
- matchExpressions is a list of label selector requirements. The requirements
|
||||
are ANDed.
|
||||
aliases:
|
||||
- selector_match_expressions
|
||||
type: list
|
||||
spec_selector_match_labels:
|
||||
description:
|
||||
- matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
|
||||
map is equivalent to an element of matchExpressions, whose key field is "key",
|
||||
the operator is "In", and the values array contains only "value". The requirements
|
||||
are ANDed.
|
||||
aliases:
|
||||
- selector_match_labels
|
||||
type: dict
|
||||
spec_strategy_rolling_update_max_surge:
|
||||
description:
|
||||
- 'The maximum number of pods that can be scheduled above the desired number of
|
||||
pods. Value can be an absolute number (ex: 5) or a percentage of desired pods
|
||||
(ex: 10%). This can not be 0 if MaxUnavailable is 0. Absolute number is calculated
|
||||
from percentage by rounding up. By default, a value of 1 is used. Example: when
|
||||
this is set to 30%, the new RC can be scaled up immediately when the rolling
|
||||
update starts, such that the total number of old and new pods do not exceed
|
||||
130% of desired pods. Once old pods have been killed, new RC can be scaled up
|
||||
further, ensuring that total number of pods running at any time during the update
|
||||
is atmost 130% of desired pods.'
|
||||
aliases:
|
||||
- strategy_rolling_update_max_surge
|
||||
type: object
|
||||
spec_strategy_rolling_update_max_unavailable:
|
||||
description:
|
||||
- 'The maximum number of pods that can be unavailable during the update. Value
|
||||
can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
|
||||
Absolute number is calculated from percentage by rounding down. This can not
|
||||
be 0 if MaxSurge is 0. By default, a fixed value of 1 is used. Example: when
|
||||
this is set to 30%, the old RC can be scaled down to 70% of desired pods immediately
|
||||
when the rolling update starts. Once new pods are ready, old RC can be scaled
|
||||
down further, followed by scaling up the new RC, ensuring that the total number
|
||||
of pods available at all times during the update is at least 70% of desired
|
||||
pods.'
|
||||
aliases:
|
||||
- strategy_rolling_update_max_unavailable
|
||||
type: object
|
||||
spec_strategy_type:
|
||||
description:
|
||||
- Type of deployment. Can be "Recreate" or "RollingUpdate". Default is RollingUpdate.
|
||||
aliases:
|
||||
- strategy_type
|
||||
spec_template_metadata_annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
spec_template_metadata_labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
spec_template_metadata_name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
spec_template_metadata_namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
spec_template_spec_active_deadline_seconds:
|
||||
description:
|
||||
- Optional duration in seconds the pod may be active on the node relative to StartTime
|
||||
before the system will actively try to mark it failed and kill associated containers.
|
||||
Value must be a positive integer.
|
||||
aliases:
|
||||
- active_deadline_seconds
|
||||
type: int
|
||||
spec_template_spec_affinity_node_affinity_preferred_during_scheduling_ignored_during_execution:
|
||||
description:
|
||||
- The scheduler will prefer to schedule pods to nodes that satisfy the affinity
|
||||
expressions specified by this field, but it may choose a node that violates
|
||||
one or more of the expressions. The node that is most preferred is the one with
|
||||
the greatest sum of weights, i.e. for each node that meets all of the scheduling
|
||||
requirements (resource request, requiredDuringScheduling affinity expressions,
|
||||
etc.), compute a sum by iterating through the elements of this field and adding
|
||||
"weight" to the sum if the node matches the corresponding matchExpressions;
|
||||
the node(s) with the highest sum are the most preferred.
|
||||
aliases:
|
||||
- affinity_node_affinity_preferred_during_scheduling_ignored_during_execution
|
||||
type: list
|
||||
spec_template_spec_affinity_node_affinity_required_during_scheduling_ignored_during_execution_node_selector_terms:
|
||||
description:
|
||||
- Required. A list of node selector terms. The terms are ORed.
|
||||
aliases:
|
||||
- affinity_node_affinity_required_during_scheduling_ignored_during_execution_node_selector_terms
|
||||
type: list
|
||||
spec_template_spec_affinity_pod_affinity_preferred_during_scheduling_ignored_during_execution:
|
||||
description:
|
||||
- The scheduler will prefer to schedule pods to nodes that satisfy the affinity
|
||||
expressions specified by this field, but it may choose a node that violates
|
||||
one or more of the expressions. The node that is most preferred is the one with
|
||||
the greatest sum of weights, i.e. for each node that meets all of the scheduling
|
||||
requirements (resource request, requiredDuringScheduling affinity expressions,
|
||||
etc.), compute a sum by iterating through the elements of this field and adding
|
||||
"weight" to the sum if the node has pods which matches the corresponding podAffinityTerm;
|
||||
the node(s) with the highest sum are the most preferred.
|
||||
aliases:
|
||||
- affinity_pod_affinity_preferred_during_scheduling_ignored_during_execution
|
||||
type: list
|
||||
spec_template_spec_affinity_pod_affinity_required_during_scheduling_ignored_during_execution:
|
||||
description:
|
||||
- If the affinity requirements specified by this field are not met at scheduling
|
||||
time, the pod will not be scheduled onto the node. If the affinity requirements
|
||||
specified by this field cease to be met at some point during pod execution (e.g.
|
||||
due to a pod label update), the system may or may not try to eventually evict
|
||||
the pod from its node. When there are multiple elements, the lists of nodes
|
||||
corresponding to each podAffinityTerm are intersected, i.e. all terms must be
|
||||
satisfied.
|
||||
aliases:
|
||||
- affinity_pod_affinity_required_during_scheduling_ignored_during_execution
|
||||
type: list
|
||||
spec_template_spec_affinity_pod_anti_affinity_preferred_during_scheduling_ignored_during_execution:
|
||||
description:
|
||||
- The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity
|
||||
expressions specified by this field, but it may choose a node that violates
|
||||
one or more of the expressions. The node that is most preferred is the one with
|
||||
the greatest sum of weights, i.e. for each node that meets all of the scheduling
|
||||
requirements (resource request, requiredDuringScheduling anti-affinity expressions,
|
||||
etc.), compute a sum by iterating through the elements of this field and adding
|
||||
"weight" to the sum if the node has pods which matches the corresponding podAffinityTerm;
|
||||
the node(s) with the highest sum are the most preferred.
|
||||
aliases:
|
||||
- affinity_pod_anti_affinity_preferred_during_scheduling_ignored_during_execution
|
||||
type: list
|
||||
spec_template_spec_affinity_pod_anti_affinity_required_during_scheduling_ignored_during_execution:
|
||||
description:
|
||||
- If the anti-affinity requirements specified by this field are not met at scheduling
|
||||
time, the pod will not be scheduled onto the node. If the anti-affinity requirements
|
||||
specified by this field cease to be met at some point during pod execution (e.g.
|
||||
due to a pod label update), the system may or may not try to eventually evict
|
||||
the pod from its node. When there are multiple elements, the lists of nodes
|
||||
corresponding to each podAffinityTerm are intersected, i.e. all terms must be
|
||||
satisfied.
|
||||
aliases:
|
||||
- affinity_pod_anti_affinity_required_during_scheduling_ignored_during_execution
|
||||
type: list
|
||||
spec_template_spec_automount_service_account_token:
|
||||
description:
|
||||
- AutomountServiceAccountToken indicates whether a service account token should
|
||||
be automatically mounted.
|
||||
aliases:
|
||||
- automount_service_account_token
|
||||
type: bool
|
||||
spec_template_spec_containers:
|
||||
description:
|
||||
- List of containers belonging to the pod. Containers cannot currently be added
|
||||
or removed. There must be at least one container in a Pod. Cannot be updated.
|
||||
aliases:
|
||||
- containers
|
||||
type: list
|
||||
spec_template_spec_dns_policy:
|
||||
description:
|
||||
- Set DNS policy for containers within the pod. One of 'ClusterFirstWithHostNet',
|
||||
'ClusterFirst' or 'Default'. Defaults to "ClusterFirst". To have DNS options
|
||||
set along with hostNetwork, you have to specify DNS policy explicitly to 'ClusterFirstWithHostNet'.
|
||||
aliases:
|
||||
- dns_policy
|
||||
spec_template_spec_host_aliases:
|
||||
description:
|
||||
- HostAliases is an optional list of hosts and IPs that will be injected into
|
||||
the pod's hosts file if specified. This is only valid for non-hostNetwork pods.
|
||||
aliases:
|
||||
- host_aliases
|
||||
type: list
|
||||
spec_template_spec_host_ipc:
|
||||
description:
|
||||
- "Use the host's ipc namespace. Optional: Default to false."
|
||||
aliases:
|
||||
- host_ipc
|
||||
type: bool
|
||||
spec_template_spec_host_network:
|
||||
description:
|
||||
- Host networking requested for this pod. Use the host's network namespace. If
|
||||
this option is set, the ports that will be used must be specified. Default to
|
||||
false.
|
||||
aliases:
|
||||
- host_network
|
||||
type: bool
|
||||
spec_template_spec_host_pid:
|
||||
description:
|
||||
- "Use the host's pid namespace. Optional: Default to false."
|
||||
aliases:
|
||||
- host_pid
|
||||
type: bool
|
||||
spec_template_spec_hostname:
|
||||
description:
|
||||
- Specifies the hostname of the Pod If not specified, the pod's hostname will
|
||||
be set to a system-defined value.
|
||||
aliases:
|
||||
- hostname
|
||||
spec_template_spec_image_pull_secrets:
|
||||
description:
|
||||
- ImagePullSecrets is an optional list of references to secrets in the same namespace
|
||||
to use for pulling any of the images used by this PodSpec. If specified, these
|
||||
secrets will be passed to individual puller implementations for them to use.
|
||||
For example, in the case of docker, only DockerConfig type secrets are honored.
|
||||
aliases:
|
||||
- image_pull_secrets
|
||||
type: list
|
||||
spec_template_spec_init_containers:
|
||||
description:
|
||||
- List of initialization containers belonging to the pod. Init containers are
|
||||
executed in order prior to containers being started. If any init container fails,
|
||||
the pod is considered to have failed and is handled according to its restartPolicy.
|
||||
The name for an init container or normal container must be unique among all
|
||||
containers. Init containers may not have Lifecycle actions, Readiness probes,
|
||||
or Liveness probes. The resourceRequirements of an init container are taken
|
||||
into account during scheduling by finding the highest request/limit for each
|
||||
resource type, and then using the max of of that value or the sum of the normal
|
||||
containers. Limits are applied to init containers in a similar fashion. Init
|
||||
containers cannot currently be added or removed. Cannot be updated.
|
||||
aliases:
|
||||
- init_containers
|
||||
type: list
|
||||
spec_template_spec_node_name:
|
||||
description:
|
||||
- NodeName is a request to schedule this pod onto a specific node. If it is non-empty,
|
||||
the scheduler simply schedules this pod onto that node, assuming that it fits
|
||||
resource requirements.
|
||||
aliases:
|
||||
- node_name
|
||||
spec_template_spec_node_selector:
|
||||
description:
|
||||
- NodeSelector is a selector which must be true for the pod to fit on a node.
|
||||
Selector which must match a node's labels for the pod to be scheduled on that
|
||||
node.
|
||||
aliases:
|
||||
- node_selector
|
||||
type: dict
|
||||
spec_template_spec_priority:
|
||||
description:
|
||||
- The priority value. Various system components use this field to find the priority
|
||||
of the pod. When Priority Admission Controller is enabled, it prevents users
|
||||
from setting this field. The admission controller populates this field from
|
||||
PriorityClassName. The higher the value, the higher the priority.
|
||||
aliases:
|
||||
- priority
|
||||
type: int
|
||||
spec_template_spec_priority_class_name:
|
||||
description:
|
||||
- If specified, indicates the pod's priority. "SYSTEM" is a special keyword which
|
||||
indicates the highest priority. Any other name must be defined by creating a
|
||||
PriorityClass object with that name. If not specified, the pod priority will
|
||||
be default or zero if there is no default.
|
||||
aliases:
|
||||
- priority_class_name
|
||||
spec_template_spec_restart_policy:
|
||||
description:
|
||||
- Restart policy for all containers within the pod. One of Always, OnFailure,
|
||||
Never. Default to Always.
|
||||
aliases:
|
||||
- restart_policy
|
||||
spec_template_spec_scheduler_name:
|
||||
description:
|
||||
- If specified, the pod will be dispatched by specified scheduler. If not specified,
|
||||
the pod will be dispatched by default scheduler.
|
||||
aliases:
|
||||
- scheduler_name
|
||||
spec_template_spec_security_context_fs_group:
|
||||
description:
|
||||
- "A special supplemental group that applies to all containers in a pod. Some\
|
||||
\ volume types allow the Kubelet to change the ownership of that volume to be\
|
||||
\ owned by the pod: 1. The owning GID will be the FSGroup 2. The setgid bit\
|
||||
\ is set (new files created in the volume will be owned by FSGroup) 3. The permission\
|
||||
\ bits are OR'd with rw-rw---- If unset, the Kubelet will not modify the ownership\
|
||||
\ and permissions of any volume."
|
||||
aliases:
|
||||
- security_context_fs_group
|
||||
type: int
|
||||
spec_template_spec_security_context_run_as_non_root:
|
||||
description:
|
||||
- Indicates that the container must run as a non-root user. If true, the Kubelet
|
||||
will validate the image at runtime to ensure that it does not run as UID 0 (root)
|
||||
and fail to start the container if it does. If unset or false, no such validation
|
||||
will be performed. May also be set in SecurityContext. If set in both SecurityContext
|
||||
and PodSecurityContext, the value specified in SecurityContext takes precedence.
|
||||
aliases:
|
||||
- security_context_run_as_non_root
|
||||
type: bool
|
||||
spec_template_spec_security_context_run_as_user:
|
||||
description:
|
||||
- The UID to run the entrypoint of the container process. Defaults to user specified
|
||||
in image metadata if unspecified. May also be set in SecurityContext. If set
|
||||
in both SecurityContext and PodSecurityContext, the value specified in SecurityContext
|
||||
takes precedence for that container.
|
||||
aliases:
|
||||
- security_context_run_as_user
|
||||
type: int
|
||||
spec_template_spec_security_context_se_linux_options_level:
|
||||
description:
|
||||
- Level is SELinux level label that applies to the container.
|
||||
aliases:
|
||||
- security_context_se_linux_options_level
|
||||
spec_template_spec_security_context_se_linux_options_role:
|
||||
description:
|
||||
- Role is a SELinux role label that applies to the container.
|
||||
aliases:
|
||||
- security_context_se_linux_options_role
|
||||
spec_template_spec_security_context_se_linux_options_type:
|
||||
description:
|
||||
- Type is a SELinux type label that applies to the container.
|
||||
aliases:
|
||||
- security_context_se_linux_options_type
|
||||
spec_template_spec_security_context_se_linux_options_user:
|
||||
description:
|
||||
- User is a SELinux user label that applies to the container.
|
||||
aliases:
|
||||
- security_context_se_linux_options_user
|
||||
spec_template_spec_security_context_supplemental_groups:
|
||||
description:
|
||||
- A list of groups applied to the first process run in each container, in addition
|
||||
to the container's primary GID. If unspecified, no groups will be added to any
|
||||
container.
|
||||
aliases:
|
||||
- security_context_supplemental_groups
|
||||
type: list
|
||||
spec_template_spec_service_account:
|
||||
description:
|
||||
- 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. Deprecated:
|
||||
Use serviceAccountName instead.'
|
||||
aliases:
|
||||
- service_account
|
||||
spec_template_spec_service_account_name:
|
||||
description:
|
||||
- ServiceAccountName is the name of the ServiceAccount to use to run this pod.
|
||||
aliases:
|
||||
- service_account_name
|
||||
spec_template_spec_subdomain:
|
||||
description:
|
||||
- If specified, the fully qualified Pod hostname will be "<hostname>.<subdomain>.<pod
|
||||
namespace>.svc.<cluster domain>". If not specified, the pod will not have a
|
||||
domainname at all.
|
||||
aliases:
|
||||
- subdomain
|
||||
spec_template_spec_termination_grace_period_seconds:
|
||||
description:
|
||||
- Optional duration in seconds the pod needs to terminate gracefully. May be decreased
|
||||
in delete request. Value must be non-negative integer. The value zero indicates
|
||||
delete immediately. If this value is nil, the default grace period will be used
|
||||
instead. The grace period is the duration in seconds after the processes running
|
||||
in the pod are sent a termination signal and the time when the processes are
|
||||
forcibly halted with a kill signal. Set this value longer than the expected
|
||||
cleanup time for your process. Defaults to 30 seconds.
|
||||
aliases:
|
||||
- termination_grace_period_seconds
|
||||
type: int
|
||||
spec_template_spec_tolerations:
|
||||
description:
|
||||
- If specified, the pod's tolerations.
|
||||
aliases:
|
||||
- tolerations
|
||||
type: list
|
||||
spec_template_spec_volumes:
|
||||
description:
|
||||
- List of volumes that can be mounted by containers belonging to the pod.
|
||||
aliases:
|
||||
- volumes
|
||||
type: list
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
deployment:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object metadata.
|
||||
type: complex
|
||||
spec:
|
||||
description:
|
||||
- Specification of the desired behavior of the Deployment.
|
||||
type: complex
|
||||
status:
|
||||
description:
|
||||
- Most recently observed status of the Deployment.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('deployment', 'extensions_v1beta1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,165 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_extensions_v1beta1_deployment_list
|
||||
short_description: Kubernetes DeploymentList
|
||||
description:
|
||||
- Retrieve a list of deployments. List operations provide a snapshot read of the underlying
|
||||
objects, returning a resource_version representing a consistent version of the listed
|
||||
objects.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
deployment_list:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
items:
|
||||
description:
|
||||
- Items is the list of Deployments.
|
||||
type: list
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value,
|
||||
and may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object metadata.
|
||||
type: complex
|
||||
spec:
|
||||
description:
|
||||
- Specification of the desired behavior of the Deployment.
|
||||
type: complex
|
||||
status:
|
||||
description:
|
||||
- Most recently observed status of the Deployment.
|
||||
type: complex
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard list metadata.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('deployment_list', 'extensions_v1beta1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,148 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_extensions_v1beta1_scale
|
||||
short_description: Kubernetes Scale
|
||||
description:
|
||||
- Manage the lifecycle of a scale object. Supports check mode, and attempts to to
|
||||
be idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
spec_replicas:
|
||||
description:
|
||||
- desired number of instances for the scaled object.
|
||||
aliases:
|
||||
- replicas
|
||||
type: int
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
scale:
|
||||
type: complex
|
||||
returned: on success
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object metadata;
|
||||
type: complex
|
||||
spec:
|
||||
description:
|
||||
- defines the behavior of the scale.
|
||||
type: complex
|
||||
status:
|
||||
description:
|
||||
- current status of the scale.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('scale', 'extensions_v1beta1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,175 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_binding
|
||||
short_description: Kubernetes Binding
|
||||
description:
|
||||
- Manage the lifecycle of a binding object. Supports check mode, and attempts to to
|
||||
be idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
target_api_version:
|
||||
description:
|
||||
- API version of the referent.
|
||||
aliases:
|
||||
- api_version
|
||||
target_field_path:
|
||||
description:
|
||||
- 'If referring to a piece of an object instead of an entire object, this string
|
||||
should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2].
|
||||
For example, if the object reference is to a container within a pod, this would
|
||||
take on a value like: "spec.containers{name}" (where "name" refers to the name
|
||||
of the container that triggered the event) or if no container name is specified
|
||||
"spec.containers[2]" (container with index 2 in this pod). This syntax is chosen
|
||||
only to have some well-defined way of referencing a part of an object.'
|
||||
aliases:
|
||||
- field_path
|
||||
target_kind:
|
||||
description:
|
||||
- Kind of the referent.
|
||||
aliases:
|
||||
- kind
|
||||
target_name:
|
||||
description:
|
||||
- Name of the referent.
|
||||
target_namespace:
|
||||
description:
|
||||
- Namespace of the referent.
|
||||
target_resource_version:
|
||||
description:
|
||||
- Specific resourceVersion to which this reference is made, if any.
|
||||
aliases:
|
||||
- resource_version
|
||||
target_uid:
|
||||
description:
|
||||
- UID of the referent.
|
||||
aliases:
|
||||
- uid
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
binding:
|
||||
type: complex
|
||||
returned: on success
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
target:
|
||||
description:
|
||||
- The target object that you want to bind to the standard object.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('binding', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,202 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_cluster_role
|
||||
short_description: Kubernetes ClusterRole
|
||||
description:
|
||||
- Manage the lifecycle of a cluster_role object. Supports check mode, and attempts
|
||||
to to be idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
rules:
|
||||
description:
|
||||
- Rules holds all the PolicyRules for this ClusterRole
|
||||
type: list
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
cluster_role:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
rules:
|
||||
description:
|
||||
- Rules holds all the PolicyRules for this ClusterRole
|
||||
type: list
|
||||
contains:
|
||||
api_groups:
|
||||
description:
|
||||
- APIGroups is the name of the APIGroup that contains the resources. If
|
||||
multiple API groups are specified, any action requested against one of
|
||||
the enumerated resources in any API group will be allowed.
|
||||
type: list
|
||||
contains: str
|
||||
non_resource_ur_ls:
|
||||
description:
|
||||
- NonResourceURLs is a set of partial urls that a user should have access
|
||||
to. *s are allowed, but only as the full, final step in the path Since
|
||||
non-resource URLs are not namespaced, this field is only applicable for
|
||||
ClusterRoles referenced from a ClusterRoleBinding. Rules can either apply
|
||||
to API resources (such as "pods" or "secrets") or non-resource URL paths
|
||||
(such as "/api"), but not both.
|
||||
type: list
|
||||
contains: str
|
||||
resource_names:
|
||||
description:
|
||||
- ResourceNames is an optional white list of names that the rule applies
|
||||
to. An empty set means that everything is allowed.
|
||||
type: list
|
||||
contains: str
|
||||
resources:
|
||||
description:
|
||||
- Resources is a list of resources this rule applies to. ResourceAll represents
|
||||
all resources.
|
||||
type: list
|
||||
contains: str
|
||||
verbs:
|
||||
description:
|
||||
- Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions
|
||||
contained in this rule. VerbAll represents all kinds.
|
||||
type: list
|
||||
contains: str
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('cluster_role', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,207 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_cluster_role_binding
|
||||
short_description: Kubernetes ClusterRoleBinding
|
||||
description:
|
||||
- Manage the lifecycle of a cluster_role_binding object. Supports check mode, and
|
||||
attempts to to be idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
role_ref_api_group:
|
||||
description:
|
||||
- APIGroup is the group for the resource being referenced
|
||||
aliases:
|
||||
- api_group
|
||||
role_ref_kind:
|
||||
description:
|
||||
- Kind is the type of resource being referenced
|
||||
aliases:
|
||||
- kind
|
||||
role_ref_name:
|
||||
description:
|
||||
- Name is the name of resource being referenced
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
subjects:
|
||||
description:
|
||||
- Subjects holds references to the objects the role applies to.
|
||||
type: list
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
cluster_role_binding:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
role_ref:
|
||||
description:
|
||||
- RoleRef can only reference a ClusterRole in the global namespace. If the RoleRef
|
||||
cannot be resolved, the Authorizer must return an error.
|
||||
type: complex
|
||||
subjects:
|
||||
description:
|
||||
- Subjects holds references to the objects the role applies to.
|
||||
type: list
|
||||
contains:
|
||||
api_group:
|
||||
description:
|
||||
- APIGroup holds the API group of the referenced subject. Defaults to ""
|
||||
for ServiceAccount subjects. Defaults to "rbac.authorization.k8s.io" for
|
||||
User and Group subjects.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind of object being referenced. Values defined by this API group are
|
||||
"User", "Group", and "ServiceAccount". If the Authorizer does not recognized
|
||||
the kind value, the Authorizer should report an error.
|
||||
type: str
|
||||
name:
|
||||
description:
|
||||
- Name of the object being referenced.
|
||||
type: str
|
||||
namespace:
|
||||
description:
|
||||
- Namespace of the referenced object. If the object kind is non-namespace,
|
||||
such as "User" or "Group", and this value is not empty the Authorizer
|
||||
should report an error.
|
||||
type: str
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('cluster_role_binding', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,189 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_cluster_role_binding_list
|
||||
short_description: Kubernetes ClusterRoleBindingList
|
||||
description:
|
||||
- Retrieve a list of cluster_role_bindings. List operations provide a snapshot read
|
||||
of the underlying objects, returning a resource_version representing a consistent
|
||||
version of the listed objects.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
cluster_role_binding_list:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
items:
|
||||
description:
|
||||
- Items is a list of ClusterRoleBindings
|
||||
type: list
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value,
|
||||
and may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
role_ref:
|
||||
description:
|
||||
- RoleRef can only reference a ClusterRole in the global namespace. If the
|
||||
RoleRef cannot be resolved, the Authorizer must return an error.
|
||||
type: complex
|
||||
subjects:
|
||||
description:
|
||||
- Subjects holds references to the objects the role applies to.
|
||||
type: list
|
||||
contains:
|
||||
api_group:
|
||||
description:
|
||||
- APIGroup holds the API group of the referenced subject. Defaults to
|
||||
"" for ServiceAccount subjects. Defaults to "rbac.authorization.k8s.io"
|
||||
for User and Group subjects.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind of object being referenced. Values defined by this API group
|
||||
are "User", "Group", and "ServiceAccount". If the Authorizer does
|
||||
not recognized the kind value, the Authorizer should report an error.
|
||||
type: str
|
||||
name:
|
||||
description:
|
||||
- Name of the object being referenced.
|
||||
type: str
|
||||
namespace:
|
||||
description:
|
||||
- Namespace of the referenced object. If the object kind is non-namespace,
|
||||
such as "User" or "Group", and this value is not empty the Authorizer
|
||||
should report an error.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('cluster_role_binding_list', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,197 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_cluster_role_list
|
||||
short_description: Kubernetes ClusterRoleList
|
||||
description:
|
||||
- Retrieve a list of cluster_roles. List operations provide a snapshot read of the
|
||||
underlying objects, returning a resource_version representing a consistent version
|
||||
of the listed objects.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
cluster_role_list:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
items:
|
||||
description:
|
||||
- Items is a list of ClusterRoles
|
||||
type: list
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value,
|
||||
and may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
rules:
|
||||
description:
|
||||
- Rules holds all the PolicyRules for this ClusterRole
|
||||
type: list
|
||||
contains:
|
||||
api_groups:
|
||||
description:
|
||||
- APIGroups is the name of the APIGroup that contains the resources.
|
||||
If multiple API groups are specified, any action requested against
|
||||
one of the enumerated resources in any API group will be allowed.
|
||||
type: list
|
||||
contains: str
|
||||
non_resource_ur_ls:
|
||||
description:
|
||||
- NonResourceURLs is a set of partial urls that a user should have access
|
||||
to. *s are allowed, but only as the full, final step in the path Since
|
||||
non-resource URLs are not namespaced, this field is only applicable
|
||||
for ClusterRoles referenced from a ClusterRoleBinding. Rules can either
|
||||
apply to API resources (such as "pods" or "secrets") or non-resource
|
||||
URL paths (such as "/api"), but not both.
|
||||
type: list
|
||||
contains: str
|
||||
resource_names:
|
||||
description:
|
||||
- ResourceNames is an optional white list of names that the rule applies
|
||||
to. An empty set means that everything is allowed.
|
||||
type: list
|
||||
contains: str
|
||||
resources:
|
||||
description:
|
||||
- Resources is a list of resources this rule applies to. ResourceAll
|
||||
represents all resources.
|
||||
type: list
|
||||
contains: str
|
||||
verbs:
|
||||
description:
|
||||
- Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions
|
||||
contained in this rule. VerbAll represents all kinds.
|
||||
type: list
|
||||
contains: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('cluster_role_list', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,162 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_component_status
|
||||
short_description: Kubernetes ComponentStatus
|
||||
description:
|
||||
- Manage the lifecycle of a component_status object. Supports check mode, and attempts
|
||||
to to be idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
conditions:
|
||||
description:
|
||||
- List of component conditions observed
|
||||
type: list
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
component_status:
|
||||
type: complex
|
||||
returned: on success
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
conditions:
|
||||
description:
|
||||
- List of component conditions observed
|
||||
type: list
|
||||
contains:
|
||||
error:
|
||||
description:
|
||||
- Condition error code for a component. For example, a health check error
|
||||
code.
|
||||
type: str
|
||||
message:
|
||||
description:
|
||||
- Message about the condition for a component. For example, information
|
||||
about a health check.
|
||||
type: str
|
||||
status:
|
||||
description:
|
||||
- 'Status of the condition for a component. Valid values for "Healthy":
|
||||
"True", "False", or "Unknown".'
|
||||
type: str
|
||||
type:
|
||||
description:
|
||||
- 'Type of condition for a component. Valid value: "Healthy"'
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('component_status', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,157 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_component_status_list
|
||||
short_description: Kubernetes ComponentStatusList
|
||||
description:
|
||||
- Retrieve a list of component_status. List operations provide a snapshot read of
|
||||
the underlying objects, returning a resource_version representing a consistent version
|
||||
of the listed objects.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
component_status_list:
|
||||
type: complex
|
||||
returned: on success
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
items:
|
||||
description:
|
||||
- List of ComponentStatus objects.
|
||||
type: list
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value,
|
||||
and may reject unrecognized values.
|
||||
type: str
|
||||
conditions:
|
||||
description:
|
||||
- List of component conditions observed
|
||||
type: list
|
||||
contains:
|
||||
error:
|
||||
description:
|
||||
- Condition error code for a component. For example, a health check
|
||||
error code.
|
||||
type: str
|
||||
message:
|
||||
description:
|
||||
- Message about the condition for a component. For example, information
|
||||
about a health check.
|
||||
type: str
|
||||
status:
|
||||
description:
|
||||
- 'Status of the condition for a component. Valid values for "Healthy":
|
||||
"True", "False", or "Unknown".'
|
||||
type: str
|
||||
type:
|
||||
description:
|
||||
- 'Type of condition for a component. Valid value: "Healthy"'
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard list metadata.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('component_status_list', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,169 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_config_map
|
||||
short_description: Kubernetes ConfigMap
|
||||
description:
|
||||
- Manage the lifecycle of a config_map object. Supports check mode, and attempts to
|
||||
to be idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
data:
|
||||
description:
|
||||
- Data contains the configuration data. Each key must consist of alphanumeric
|
||||
characters, '-', '_' or '.'.
|
||||
type: dict
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
config_map:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
data:
|
||||
description:
|
||||
- Data contains the configuration data. Each key must consist of alphanumeric
|
||||
characters, '-', '_' or '.'.
|
||||
type: complex
|
||||
contains: str, str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('config_map', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,163 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_config_map_list
|
||||
short_description: Kubernetes ConfigMapList
|
||||
description:
|
||||
- Retrieve a list of config_maps. List operations provide a snapshot read of the underlying
|
||||
objects, returning a resource_version representing a consistent version of the listed
|
||||
objects.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
config_map_list:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
items:
|
||||
description:
|
||||
- Items is the list of ConfigMaps.
|
||||
type: list
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value,
|
||||
and may reject unrecognized values.
|
||||
type: str
|
||||
data:
|
||||
description:
|
||||
- Data contains the configuration data. Each key must consist of alphanumeric
|
||||
characters, '-', '_' or '.'.
|
||||
type: complex
|
||||
contains: str, str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- ''
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('config_map_list', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,250 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_endpoints
|
||||
short_description: Kubernetes Endpoints
|
||||
description:
|
||||
- Manage the lifecycle of a endpoints object. Supports check mode, and attempts to
|
||||
to be idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
subsets:
|
||||
description:
|
||||
- The set of all endpoints is the union of all subsets. Addresses are placed into
|
||||
subsets according to the IPs they share. A single address with multiple ports,
|
||||
some of which are ready and some of which are not (because they come from different
|
||||
containers) will result in the address being displayed in different subsets
|
||||
for the different ports. No address will appear in both Addresses and NotReadyAddresses
|
||||
in the same subset. Sets of addresses and ports that comprise a service.
|
||||
type: list
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
endpoints:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
subsets:
|
||||
description:
|
||||
- The set of all endpoints is the union of all subsets. Addresses are placed
|
||||
into subsets according to the IPs they share. A single address with multiple
|
||||
ports, some of which are ready and some of which are not (because they come
|
||||
from different containers) will result in the address being displayed in different
|
||||
subsets for the different ports. No address will appear in both Addresses
|
||||
and NotReadyAddresses in the same subset. Sets of addresses and ports that
|
||||
comprise a service.
|
||||
type: list
|
||||
contains:
|
||||
addresses:
|
||||
description:
|
||||
- IP addresses which offer the related ports that are marked as ready. These
|
||||
endpoints should be considered safe for load balancers and clients to
|
||||
utilize.
|
||||
type: list
|
||||
contains:
|
||||
hostname:
|
||||
description:
|
||||
- The Hostname of this endpoint
|
||||
type: str
|
||||
ip:
|
||||
description:
|
||||
- The IP of this endpoint. May not be loopback (127.0.0.0/8), link-local
|
||||
(169.254.0.0/16), or link-local multicast ((224.0.0.0/24). IPv6 is
|
||||
also accepted but not fully supported on all platforms. Also, certain
|
||||
kubernetes components, like kube-proxy, are not IPv6 ready.
|
||||
type: str
|
||||
node_name:
|
||||
description:
|
||||
- 'Optional: Node hosting this endpoint. This can be used to determine
|
||||
endpoints local to a node.'
|
||||
type: str
|
||||
target_ref:
|
||||
description:
|
||||
- Reference to object providing the endpoint.
|
||||
type: complex
|
||||
not_ready_addresses:
|
||||
description:
|
||||
- IP addresses which offer the related ports but are not currently marked
|
||||
as ready because they have not yet finished starting, have recently failed
|
||||
a readiness check, or have recently failed a liveness check.
|
||||
type: list
|
||||
contains:
|
||||
hostname:
|
||||
description:
|
||||
- The Hostname of this endpoint
|
||||
type: str
|
||||
ip:
|
||||
description:
|
||||
- The IP of this endpoint. May not be loopback (127.0.0.0/8), link-local
|
||||
(169.254.0.0/16), or link-local multicast ((224.0.0.0/24). IPv6 is
|
||||
also accepted but not fully supported on all platforms. Also, certain
|
||||
kubernetes components, like kube-proxy, are not IPv6 ready.
|
||||
type: str
|
||||
node_name:
|
||||
description:
|
||||
- 'Optional: Node hosting this endpoint. This can be used to determine
|
||||
endpoints local to a node.'
|
||||
type: str
|
||||
target_ref:
|
||||
description:
|
||||
- Reference to object providing the endpoint.
|
||||
type: complex
|
||||
ports:
|
||||
description:
|
||||
- Port numbers available on the related IP addresses.
|
||||
type: list
|
||||
contains:
|
||||
name:
|
||||
description:
|
||||
- The name of this port (corresponds to ServicePort.Name). Must be a
|
||||
DNS_LABEL. Optional only if one port is defined.
|
||||
type: str
|
||||
port:
|
||||
description:
|
||||
- The port number of the endpoint.
|
||||
type: int
|
||||
protocol:
|
||||
description:
|
||||
- The IP protocol for this port. Must be UDP or TCP. Default is TCP.
|
||||
type: str
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('endpoints', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,241 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_endpoints_list
|
||||
short_description: Kubernetes EndpointsList
|
||||
description:
|
||||
- Retrieve a list of endpoints. List operations provide a snapshot read of the underlying
|
||||
objects, returning a resource_version representing a consistent version of the listed
|
||||
objects.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
endpoints_list:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
items:
|
||||
description:
|
||||
- List of endpoints.
|
||||
type: list
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value,
|
||||
and may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
subsets:
|
||||
description:
|
||||
- The set of all endpoints is the union of all subsets. Addresses are placed
|
||||
into subsets according to the IPs they share. A single address with multiple
|
||||
ports, some of which are ready and some of which are not (because they
|
||||
come from different containers) will result in the address being displayed
|
||||
in different subsets for the different ports. No address will appear in
|
||||
both Addresses and NotReadyAddresses in the same subset. Sets of addresses
|
||||
and ports that comprise a service.
|
||||
type: list
|
||||
contains:
|
||||
addresses:
|
||||
description:
|
||||
- IP addresses which offer the related ports that are marked as ready.
|
||||
These endpoints should be considered safe for load balancers and clients
|
||||
to utilize.
|
||||
type: list
|
||||
contains:
|
||||
hostname:
|
||||
description:
|
||||
- The Hostname of this endpoint
|
||||
type: str
|
||||
ip:
|
||||
description:
|
||||
- The IP of this endpoint. May not be loopback (127.0.0.0/8), link-local
|
||||
(169.254.0.0/16), or link-local multicast ((224.0.0.0/24). IPv6
|
||||
is also accepted but not fully supported on all platforms. Also,
|
||||
certain kubernetes components, like kube-proxy, are not IPv6 ready.
|
||||
type: str
|
||||
node_name:
|
||||
description:
|
||||
- 'Optional: Node hosting this endpoint. This can be used to determine
|
||||
endpoints local to a node.'
|
||||
type: str
|
||||
target_ref:
|
||||
description:
|
||||
- Reference to object providing the endpoint.
|
||||
type: complex
|
||||
not_ready_addresses:
|
||||
description:
|
||||
- IP addresses which offer the related ports but are not currently marked
|
||||
as ready because they have not yet finished starting, have recently
|
||||
failed a readiness check, or have recently failed a liveness check.
|
||||
type: list
|
||||
contains:
|
||||
hostname:
|
||||
description:
|
||||
- The Hostname of this endpoint
|
||||
type: str
|
||||
ip:
|
||||
description:
|
||||
- The IP of this endpoint. May not be loopback (127.0.0.0/8), link-local
|
||||
(169.254.0.0/16), or link-local multicast ((224.0.0.0/24). IPv6
|
||||
is also accepted but not fully supported on all platforms. Also,
|
||||
certain kubernetes components, like kube-proxy, are not IPv6 ready.
|
||||
type: str
|
||||
node_name:
|
||||
description:
|
||||
- 'Optional: Node hosting this endpoint. This can be used to determine
|
||||
endpoints local to a node.'
|
||||
type: str
|
||||
target_ref:
|
||||
description:
|
||||
- Reference to object providing the endpoint.
|
||||
type: complex
|
||||
ports:
|
||||
description:
|
||||
- Port numbers available on the related IP addresses.
|
||||
type: list
|
||||
contains:
|
||||
name:
|
||||
description:
|
||||
- The name of this port (corresponds to ServicePort.Name). Must
|
||||
be a DNS_LABEL. Optional only if one port is defined.
|
||||
type: str
|
||||
port:
|
||||
description:
|
||||
- The port number of the endpoint.
|
||||
type: int
|
||||
protocol:
|
||||
description:
|
||||
- The IP protocol for this port. Must be UDP or TCP. Default is
|
||||
TCP.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard list metadata.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('endpoints_list', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,261 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_event
|
||||
short_description: Kubernetes Event
|
||||
description:
|
||||
- Manage the lifecycle of a event object. Supports check mode, and attempts to to
|
||||
be idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
count:
|
||||
description:
|
||||
- The number of times this event has occurred.
|
||||
type: int
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
first_timestamp:
|
||||
description:
|
||||
- The time at which the event was first recorded. (Time of server receipt is in
|
||||
TypeMeta.)
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
involved_object_api_version:
|
||||
description:
|
||||
- API version of the referent.
|
||||
aliases:
|
||||
- api_version
|
||||
involved_object_field_path:
|
||||
description:
|
||||
- 'If referring to a piece of an object instead of an entire object, this string
|
||||
should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2].
|
||||
For example, if the object reference is to a container within a pod, this would
|
||||
take on a value like: "spec.containers{name}" (where "name" refers to the name
|
||||
of the container that triggered the event) or if no container name is specified
|
||||
"spec.containers[2]" (container with index 2 in this pod). This syntax is chosen
|
||||
only to have some well-defined way of referencing a part of an object.'
|
||||
aliases:
|
||||
- field_path
|
||||
involved_object_kind:
|
||||
description:
|
||||
- Kind of the referent.
|
||||
aliases:
|
||||
- kind
|
||||
involved_object_name:
|
||||
description:
|
||||
- Name of the referent.
|
||||
involved_object_namespace:
|
||||
description:
|
||||
- Namespace of the referent.
|
||||
involved_object_resource_version:
|
||||
description:
|
||||
- Specific resourceVersion to which this reference is made, if any.
|
||||
aliases:
|
||||
- resource_version
|
||||
involved_object_uid:
|
||||
description:
|
||||
- UID of the referent.
|
||||
aliases:
|
||||
- uid
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
last_timestamp:
|
||||
description:
|
||||
- The time at which the most recent occurrence of this event was recorded.
|
||||
message:
|
||||
description:
|
||||
- A human-readable description of the status of this operation.
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
reason:
|
||||
description:
|
||||
- This should be a short, machine understandable string that gives the reason
|
||||
for the transition into the object's current status.
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
source_component:
|
||||
description:
|
||||
- Component from which the event is generated.
|
||||
aliases:
|
||||
- component
|
||||
source_host:
|
||||
description:
|
||||
- Node name on which the event is generated.
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
type:
|
||||
description:
|
||||
- Type of this event (Normal, Warning), new types could be added in the future
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
event:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
count:
|
||||
description:
|
||||
- The number of times this event has occurred.
|
||||
type: int
|
||||
first_timestamp:
|
||||
description:
|
||||
- The time at which the event was first recorded. (Time of server receipt is
|
||||
in TypeMeta.)
|
||||
type: complex
|
||||
contains: {}
|
||||
involved_object:
|
||||
description:
|
||||
- The object that this event is about.
|
||||
type: complex
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
last_timestamp:
|
||||
description:
|
||||
- The time at which the most recent occurrence of this event was recorded.
|
||||
type: complex
|
||||
contains: {}
|
||||
message:
|
||||
description:
|
||||
- A human-readable description of the status of this operation.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
reason:
|
||||
description:
|
||||
- This should be a short, machine understandable string that gives the reason
|
||||
for the transition into the object's current status.
|
||||
type: str
|
||||
source:
|
||||
description:
|
||||
- The component reporting this event. Should be a short machine understandable
|
||||
string.
|
||||
type: complex
|
||||
type:
|
||||
description:
|
||||
- Type of this event (Normal, Warning), new types could be added in the future
|
||||
type: str
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('event', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,195 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_event_list
|
||||
short_description: Kubernetes EventList
|
||||
description:
|
||||
- Retrieve a list of events. List operations provide a snapshot read of the underlying
|
||||
objects, returning a resource_version representing a consistent version of the listed
|
||||
objects.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
event_list:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
items:
|
||||
description:
|
||||
- List of events
|
||||
type: list
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value,
|
||||
and may reject unrecognized values.
|
||||
type: str
|
||||
count:
|
||||
description:
|
||||
- The number of times this event has occurred.
|
||||
type: int
|
||||
first_timestamp:
|
||||
description:
|
||||
- The time at which the event was first recorded. (Time of server receipt
|
||||
is in TypeMeta.)
|
||||
type: complex
|
||||
contains: {}
|
||||
involved_object:
|
||||
description:
|
||||
- The object that this event is about.
|
||||
type: complex
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated. In CamelCase.
|
||||
type: str
|
||||
last_timestamp:
|
||||
description:
|
||||
- The time at which the most recent occurrence of this event was recorded.
|
||||
type: complex
|
||||
contains: {}
|
||||
message:
|
||||
description:
|
||||
- A human-readable description of the status of this operation.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
reason:
|
||||
description:
|
||||
- This should be a short, machine understandable string that gives the reason
|
||||
for the transition into the object's current status.
|
||||
type: str
|
||||
source:
|
||||
description:
|
||||
- The component reporting this event. Should be a short machine understandable
|
||||
string.
|
||||
type: complex
|
||||
type:
|
||||
description:
|
||||
- Type of this event (Normal, Warning), new types could be added in the
|
||||
future
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard list metadata.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('event_list', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,211 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_horizontal_pod_autoscaler
|
||||
short_description: Kubernetes HorizontalPodAutoscaler
|
||||
description:
|
||||
- Manage the lifecycle of a horizontal_pod_autoscaler object. Supports check mode,
|
||||
and attempts to to be idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
spec_max_replicas:
|
||||
description:
|
||||
- upper limit for the number of pods that can be set by the autoscaler; cannot
|
||||
be smaller than MinReplicas.
|
||||
aliases:
|
||||
- max_replicas
|
||||
type: int
|
||||
spec_min_replicas:
|
||||
description:
|
||||
- lower limit for the number of pods that can be set by the autoscaler, default
|
||||
1.
|
||||
aliases:
|
||||
- min_replicas
|
||||
type: int
|
||||
spec_scale_target_ref_api_version:
|
||||
description:
|
||||
- API version of the referent
|
||||
aliases:
|
||||
- scale_target_ref_api_version
|
||||
spec_scale_target_ref_kind:
|
||||
description:
|
||||
- Kind of the referent;
|
||||
aliases:
|
||||
- scale_target_ref_kind
|
||||
spec_scale_target_ref_name:
|
||||
description:
|
||||
- Name of the referent;
|
||||
aliases:
|
||||
- scale_target_ref_name
|
||||
spec_target_cpu_utilization_percentage:
|
||||
description:
|
||||
- target average CPU utilization (represented as a percentage of requested CPU)
|
||||
over all the pods; if not specified the default autoscaling policy will be used.
|
||||
aliases:
|
||||
- target_cpu_utilization_percentage
|
||||
type: int
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
- name: Create replica set
|
||||
k8s_v1_horizontal_pod_autoscaler.yml:
|
||||
name: test-scaler
|
||||
namespace: test
|
||||
state: present
|
||||
scale_target_ref_kind: ReplicaSet
|
||||
scale_target_ref_name: test
|
||||
min_replicas: 2
|
||||
max_replicas: 5
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
horizontal_pod_autoscaler:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object metadata.
|
||||
type: complex
|
||||
spec:
|
||||
description:
|
||||
- behaviour of autoscaler.
|
||||
type: complex
|
||||
status:
|
||||
description:
|
||||
- current information about the autoscaler.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('horizontal_pod_autoscaler', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,165 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_horizontal_pod_autoscaler_list
|
||||
short_description: Kubernetes HorizontalPodAutoscalerList
|
||||
description:
|
||||
- Retrieve a list of horizontal_pod_autoscalers. List operations provide a snapshot
|
||||
read of the underlying objects, returning a resource_version representing a consistent
|
||||
version of the listed objects.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
horizontal_pod_autoscaler_list:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
items:
|
||||
description:
|
||||
- list of horizontal pod autoscaler objects.
|
||||
type: list
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value,
|
||||
and may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object metadata.
|
||||
type: complex
|
||||
spec:
|
||||
description:
|
||||
- behaviour of autoscaler.
|
||||
type: complex
|
||||
status:
|
||||
description:
|
||||
- current information about the autoscaler.
|
||||
type: complex
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard list metadata.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('horizontal_pod_autoscaler_list', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,547 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_job
|
||||
short_description: Kubernetes Job
|
||||
description:
|
||||
- Manage the lifecycle of a job object. Supports check mode, and attempts to to be
|
||||
idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
spec_active_deadline_seconds:
|
||||
description:
|
||||
- Specifies the duration in seconds relative to the startTime that the job may
|
||||
be active before the system tries to terminate it; value must be positive integer
|
||||
aliases:
|
||||
- active_deadline_seconds
|
||||
type: int
|
||||
spec_backoff_limit:
|
||||
description:
|
||||
- Specifies the number of retries before marking this job failed. Defaults to
|
||||
6
|
||||
aliases:
|
||||
- backoff_limit
|
||||
type: int
|
||||
spec_completions:
|
||||
description:
|
||||
- Specifies the desired number of successfully finished pods the job should be
|
||||
run with. Setting to nil means that the success of any pod signals the success
|
||||
of all pods, and allows parallelism to have any positive value. Setting to 1
|
||||
means that parallelism is limited to 1 and the success of that pod signals the
|
||||
success of the job.
|
||||
aliases:
|
||||
- completions
|
||||
type: int
|
||||
spec_manual_selector:
|
||||
description:
|
||||
- manualSelector controls generation of pod labels and pod selectors. Leave `manualSelector`
|
||||
unset unless you are certain what you are doing. When false or unset, the system
|
||||
pick labels unique to this job and appends those labels to the pod template.
|
||||
When true, the user is responsible for picking unique labels and specifying
|
||||
the selector. Failure to pick a unique label may cause this and other jobs to
|
||||
not function correctly. However, You may see `manualSelector=true` in jobs that
|
||||
were created with the old `extensions/v1beta1` API.
|
||||
aliases:
|
||||
- manual_selector
|
||||
type: bool
|
||||
spec_parallelism:
|
||||
description:
|
||||
- Specifies the maximum desired number of pods the job should run at any given
|
||||
time. The actual number of pods running in steady state will be less than this
|
||||
number when ((.spec.completions - .status.successful) < .spec.parallelism),
|
||||
i.e. when the work left to do is less than max parallelism.
|
||||
aliases:
|
||||
- parallelism
|
||||
type: int
|
||||
spec_selector_match_expressions:
|
||||
description:
|
||||
- matchExpressions is a list of label selector requirements. The requirements
|
||||
are ANDed.
|
||||
aliases:
|
||||
- selector_match_expressions
|
||||
type: list
|
||||
spec_selector_match_labels:
|
||||
description:
|
||||
- matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
|
||||
map is equivalent to an element of matchExpressions, whose key field is "key",
|
||||
the operator is "In", and the values array contains only "value". The requirements
|
||||
are ANDed.
|
||||
aliases:
|
||||
- selector_match_labels
|
||||
type: dict
|
||||
spec_template_metadata_annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
spec_template_metadata_labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
spec_template_metadata_name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
spec_template_metadata_namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
spec_template_spec_active_deadline_seconds:
|
||||
description:
|
||||
- Optional duration in seconds the pod may be active on the node relative to StartTime
|
||||
before the system will actively try to mark it failed and kill associated containers.
|
||||
Value must be a positive integer.
|
||||
type: int
|
||||
spec_template_spec_affinity_node_affinity_preferred_during_scheduling_ignored_during_execution:
|
||||
description:
|
||||
- The scheduler will prefer to schedule pods to nodes that satisfy the affinity
|
||||
expressions specified by this field, but it may choose a node that violates
|
||||
one or more of the expressions. The node that is most preferred is the one with
|
||||
the greatest sum of weights, i.e. for each node that meets all of the scheduling
|
||||
requirements (resource request, requiredDuringScheduling affinity expressions,
|
||||
etc.), compute a sum by iterating through the elements of this field and adding
|
||||
"weight" to the sum if the node matches the corresponding matchExpressions;
|
||||
the node(s) with the highest sum are the most preferred.
|
||||
aliases:
|
||||
- affinity_node_affinity_preferred_during_scheduling_ignored_during_execution
|
||||
type: list
|
||||
spec_template_spec_affinity_node_affinity_required_during_scheduling_ignored_during_execution_node_selector_terms:
|
||||
description:
|
||||
- Required. A list of node selector terms. The terms are ORed.
|
||||
aliases:
|
||||
- affinity_node_affinity_required_during_scheduling_ignored_during_execution_node_selector_terms
|
||||
type: list
|
||||
spec_template_spec_affinity_pod_affinity_preferred_during_scheduling_ignored_during_execution:
|
||||
description:
|
||||
- The scheduler will prefer to schedule pods to nodes that satisfy the affinity
|
||||
expressions specified by this field, but it may choose a node that violates
|
||||
one or more of the expressions. The node that is most preferred is the one with
|
||||
the greatest sum of weights, i.e. for each node that meets all of the scheduling
|
||||
requirements (resource request, requiredDuringScheduling affinity expressions,
|
||||
etc.), compute a sum by iterating through the elements of this field and adding
|
||||
"weight" to the sum if the node has pods which matches the corresponding podAffinityTerm;
|
||||
the node(s) with the highest sum are the most preferred.
|
||||
aliases:
|
||||
- affinity_pod_affinity_preferred_during_scheduling_ignored_during_execution
|
||||
type: list
|
||||
spec_template_spec_affinity_pod_affinity_required_during_scheduling_ignored_during_execution:
|
||||
description:
|
||||
- If the affinity requirements specified by this field are not met at scheduling
|
||||
time, the pod will not be scheduled onto the node. If the affinity requirements
|
||||
specified by this field cease to be met at some point during pod execution (e.g.
|
||||
due to a pod label update), the system may or may not try to eventually evict
|
||||
the pod from its node. When there are multiple elements, the lists of nodes
|
||||
corresponding to each podAffinityTerm are intersected, i.e. all terms must be
|
||||
satisfied.
|
||||
aliases:
|
||||
- affinity_pod_affinity_required_during_scheduling_ignored_during_execution
|
||||
type: list
|
||||
spec_template_spec_affinity_pod_anti_affinity_preferred_during_scheduling_ignored_during_execution:
|
||||
description:
|
||||
- The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity
|
||||
expressions specified by this field, but it may choose a node that violates
|
||||
one or more of the expressions. The node that is most preferred is the one with
|
||||
the greatest sum of weights, i.e. for each node that meets all of the scheduling
|
||||
requirements (resource request, requiredDuringScheduling anti-affinity expressions,
|
||||
etc.), compute a sum by iterating through the elements of this field and adding
|
||||
"weight" to the sum if the node has pods which matches the corresponding podAffinityTerm;
|
||||
the node(s) with the highest sum are the most preferred.
|
||||
aliases:
|
||||
- affinity_pod_anti_affinity_preferred_during_scheduling_ignored_during_execution
|
||||
type: list
|
||||
spec_template_spec_affinity_pod_anti_affinity_required_during_scheduling_ignored_during_execution:
|
||||
description:
|
||||
- If the anti-affinity requirements specified by this field are not met at scheduling
|
||||
time, the pod will not be scheduled onto the node. If the anti-affinity requirements
|
||||
specified by this field cease to be met at some point during pod execution (e.g.
|
||||
due to a pod label update), the system may or may not try to eventually evict
|
||||
the pod from its node. When there are multiple elements, the lists of nodes
|
||||
corresponding to each podAffinityTerm are intersected, i.e. all terms must be
|
||||
satisfied.
|
||||
aliases:
|
||||
- affinity_pod_anti_affinity_required_during_scheduling_ignored_during_execution
|
||||
type: list
|
||||
spec_template_spec_automount_service_account_token:
|
||||
description:
|
||||
- AutomountServiceAccountToken indicates whether a service account token should
|
||||
be automatically mounted.
|
||||
aliases:
|
||||
- automount_service_account_token
|
||||
type: bool
|
||||
spec_template_spec_containers:
|
||||
description:
|
||||
- List of containers belonging to the pod. Containers cannot currently be added
|
||||
or removed. There must be at least one container in a Pod. Cannot be updated.
|
||||
aliases:
|
||||
- containers
|
||||
type: list
|
||||
spec_template_spec_dns_policy:
|
||||
description:
|
||||
- Set DNS policy for containers within the pod. One of 'ClusterFirstWithHostNet',
|
||||
'ClusterFirst' or 'Default'. Defaults to "ClusterFirst". To have DNS options
|
||||
set along with hostNetwork, you have to specify DNS policy explicitly to 'ClusterFirstWithHostNet'.
|
||||
aliases:
|
||||
- dns_policy
|
||||
spec_template_spec_host_aliases:
|
||||
description:
|
||||
- HostAliases is an optional list of hosts and IPs that will be injected into
|
||||
the pod's hosts file if specified. This is only valid for non-hostNetwork pods.
|
||||
aliases:
|
||||
- host_aliases
|
||||
type: list
|
||||
spec_template_spec_host_ipc:
|
||||
description:
|
||||
- "Use the host's ipc namespace. Optional: Default to false."
|
||||
aliases:
|
||||
- host_ipc
|
||||
type: bool
|
||||
spec_template_spec_host_network:
|
||||
description:
|
||||
- Host networking requested for this pod. Use the host's network namespace. If
|
||||
this option is set, the ports that will be used must be specified. Default to
|
||||
false.
|
||||
aliases:
|
||||
- host_network
|
||||
type: bool
|
||||
spec_template_spec_host_pid:
|
||||
description:
|
||||
- "Use the host's pid namespace. Optional: Default to false."
|
||||
aliases:
|
||||
- host_pid
|
||||
type: bool
|
||||
spec_template_spec_hostname:
|
||||
description:
|
||||
- Specifies the hostname of the Pod If not specified, the pod's hostname will
|
||||
be set to a system-defined value.
|
||||
aliases:
|
||||
- hostname
|
||||
spec_template_spec_image_pull_secrets:
|
||||
description:
|
||||
- ImagePullSecrets is an optional list of references to secrets in the same namespace
|
||||
to use for pulling any of the images used by this PodSpec. If specified, these
|
||||
secrets will be passed to individual puller implementations for them to use.
|
||||
For example, in the case of docker, only DockerConfig type secrets are honored.
|
||||
aliases:
|
||||
- image_pull_secrets
|
||||
type: list
|
||||
spec_template_spec_init_containers:
|
||||
description:
|
||||
- List of initialization containers belonging to the pod. Init containers are
|
||||
executed in order prior to containers being started. If any init container fails,
|
||||
the pod is considered to have failed and is handled according to its restartPolicy.
|
||||
The name for an init container or normal container must be unique among all
|
||||
containers. Init containers may not have Lifecycle actions, Readiness probes,
|
||||
or Liveness probes. The resourceRequirements of an init container are taken
|
||||
into account during scheduling by finding the highest request/limit for each
|
||||
resource type, and then using the max of of that value or the sum of the normal
|
||||
containers. Limits are applied to init containers in a similar fashion. Init
|
||||
containers cannot currently be added or removed. Cannot be updated.
|
||||
aliases:
|
||||
- init_containers
|
||||
type: list
|
||||
spec_template_spec_node_name:
|
||||
description:
|
||||
- NodeName is a request to schedule this pod onto a specific node. If it is non-empty,
|
||||
the scheduler simply schedules this pod onto that node, assuming that it fits
|
||||
resource requirements.
|
||||
aliases:
|
||||
- node_name
|
||||
spec_template_spec_node_selector:
|
||||
description:
|
||||
- NodeSelector is a selector which must be true for the pod to fit on a node.
|
||||
Selector which must match a node's labels for the pod to be scheduled on that
|
||||
node.
|
||||
aliases:
|
||||
- node_selector
|
||||
type: dict
|
||||
spec_template_spec_priority:
|
||||
description:
|
||||
- The priority value. Various system components use this field to find the priority
|
||||
of the pod. When Priority Admission Controller is enabled, it prevents users
|
||||
from setting this field. The admission controller populates this field from
|
||||
PriorityClassName. The higher the value, the higher the priority.
|
||||
aliases:
|
||||
- priority
|
||||
type: int
|
||||
spec_template_spec_priority_class_name:
|
||||
description:
|
||||
- If specified, indicates the pod's priority. "SYSTEM" is a special keyword which
|
||||
indicates the highest priority. Any other name must be defined by creating a
|
||||
PriorityClass object with that name. If not specified, the pod priority will
|
||||
be default or zero if there is no default.
|
||||
aliases:
|
||||
- priority_class_name
|
||||
spec_template_spec_restart_policy:
|
||||
description:
|
||||
- Restart policy for all containers within the pod. One of Always, OnFailure,
|
||||
Never. Default to Always.
|
||||
aliases:
|
||||
- restart_policy
|
||||
spec_template_spec_scheduler_name:
|
||||
description:
|
||||
- If specified, the pod will be dispatched by specified scheduler. If not specified,
|
||||
the pod will be dispatched by default scheduler.
|
||||
aliases:
|
||||
- scheduler_name
|
||||
spec_template_spec_security_context_fs_group:
|
||||
description:
|
||||
- "A special supplemental group that applies to all containers in a pod. Some\
|
||||
\ volume types allow the Kubelet to change the ownership of that volume to be\
|
||||
\ owned by the pod: 1. The owning GID will be the FSGroup 2. The setgid bit\
|
||||
\ is set (new files created in the volume will be owned by FSGroup) 3. The permission\
|
||||
\ bits are OR'd with rw-rw---- If unset, the Kubelet will not modify the ownership\
|
||||
\ and permissions of any volume."
|
||||
aliases:
|
||||
- security_context_fs_group
|
||||
type: int
|
||||
spec_template_spec_security_context_run_as_non_root:
|
||||
description:
|
||||
- Indicates that the container must run as a non-root user. If true, the Kubelet
|
||||
will validate the image at runtime to ensure that it does not run as UID 0 (root)
|
||||
and fail to start the container if it does. If unset or false, no such validation
|
||||
will be performed. May also be set in SecurityContext. If set in both SecurityContext
|
||||
and PodSecurityContext, the value specified in SecurityContext takes precedence.
|
||||
aliases:
|
||||
- security_context_run_as_non_root
|
||||
type: bool
|
||||
spec_template_spec_security_context_run_as_user:
|
||||
description:
|
||||
- The UID to run the entrypoint of the container process. Defaults to user specified
|
||||
in image metadata if unspecified. May also be set in SecurityContext. If set
|
||||
in both SecurityContext and PodSecurityContext, the value specified in SecurityContext
|
||||
takes precedence for that container.
|
||||
aliases:
|
||||
- security_context_run_as_user
|
||||
type: int
|
||||
spec_template_spec_security_context_se_linux_options_level:
|
||||
description:
|
||||
- Level is SELinux level label that applies to the container.
|
||||
aliases:
|
||||
- security_context_se_linux_options_level
|
||||
spec_template_spec_security_context_se_linux_options_role:
|
||||
description:
|
||||
- Role is a SELinux role label that applies to the container.
|
||||
aliases:
|
||||
- security_context_se_linux_options_role
|
||||
spec_template_spec_security_context_se_linux_options_type:
|
||||
description:
|
||||
- Type is a SELinux type label that applies to the container.
|
||||
aliases:
|
||||
- security_context_se_linux_options_type
|
||||
spec_template_spec_security_context_se_linux_options_user:
|
||||
description:
|
||||
- User is a SELinux user label that applies to the container.
|
||||
aliases:
|
||||
- security_context_se_linux_options_user
|
||||
spec_template_spec_security_context_supplemental_groups:
|
||||
description:
|
||||
- A list of groups applied to the first process run in each container, in addition
|
||||
to the container's primary GID. If unspecified, no groups will be added to any
|
||||
container.
|
||||
aliases:
|
||||
- security_context_supplemental_groups
|
||||
type: list
|
||||
spec_template_spec_service_account:
|
||||
description:
|
||||
- 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. Deprecated:
|
||||
Use serviceAccountName instead.'
|
||||
aliases:
|
||||
- service_account
|
||||
spec_template_spec_service_account_name:
|
||||
description:
|
||||
- ServiceAccountName is the name of the ServiceAccount to use to run this pod.
|
||||
aliases:
|
||||
- service_account_name
|
||||
spec_template_spec_subdomain:
|
||||
description:
|
||||
- If specified, the fully qualified Pod hostname will be "<hostname>.<subdomain>.<pod
|
||||
namespace>.svc.<cluster domain>". If not specified, the pod will not have a
|
||||
domainname at all.
|
||||
aliases:
|
||||
- subdomain
|
||||
spec_template_spec_termination_grace_period_seconds:
|
||||
description:
|
||||
- Optional duration in seconds the pod needs to terminate gracefully. May be decreased
|
||||
in delete request. Value must be non-negative integer. The value zero indicates
|
||||
delete immediately. If this value is nil, the default grace period will be used
|
||||
instead. The grace period is the duration in seconds after the processes running
|
||||
in the pod are sent a termination signal and the time when the processes are
|
||||
forcibly halted with a kill signal. Set this value longer than the expected
|
||||
cleanup time for your process. Defaults to 30 seconds.
|
||||
aliases:
|
||||
- termination_grace_period_seconds
|
||||
type: int
|
||||
spec_template_spec_tolerations:
|
||||
description:
|
||||
- If specified, the pod's tolerations.
|
||||
aliases:
|
||||
- tolerations
|
||||
type: list
|
||||
spec_template_spec_volumes:
|
||||
description:
|
||||
- List of volumes that can be mounted by containers belonging to the pod.
|
||||
aliases:
|
||||
- volumes
|
||||
type: list
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
job:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
spec:
|
||||
description:
|
||||
- Specification of the desired behavior of a job.
|
||||
type: complex
|
||||
status:
|
||||
description:
|
||||
- Current status of a job.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('job', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,165 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_job_list
|
||||
short_description: Kubernetes JobList
|
||||
description:
|
||||
- Retrieve a list of jobs. List operations provide a snapshot read of the underlying
|
||||
objects, returning a resource_version representing a consistent version of the listed
|
||||
objects.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
job_list:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
items:
|
||||
description:
|
||||
- items is the list of Jobs.
|
||||
type: list
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value,
|
||||
and may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
spec:
|
||||
description:
|
||||
- Specification of the desired behavior of a job.
|
||||
type: complex
|
||||
status:
|
||||
description:
|
||||
- Current status of a job.
|
||||
type: complex
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard list metadata.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('job_list', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,168 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_limit_range
|
||||
short_description: Kubernetes LimitRange
|
||||
description:
|
||||
- Manage the lifecycle of a limit_range object. Supports check mode, and attempts
|
||||
to to be idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
spec_limits:
|
||||
description:
|
||||
- Limits is the list of LimitRangeItem objects that are enforced.
|
||||
aliases:
|
||||
- limits
|
||||
type: list
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
limit_range:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
spec:
|
||||
description:
|
||||
- Spec defines the limits enforced.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('limit_range', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,161 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_limit_range_list
|
||||
short_description: Kubernetes LimitRangeList
|
||||
description:
|
||||
- Retrieve a list of limit_ranges. List operations provide a snapshot read of the
|
||||
underlying objects, returning a resource_version representing a consistent version
|
||||
of the listed objects.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
limit_range_list:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
items:
|
||||
description:
|
||||
- Items is a list of LimitRange objects.
|
||||
type: list
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value,
|
||||
and may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
spec:
|
||||
description:
|
||||
- Spec defines the limits enforced.
|
||||
type: complex
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard list metadata.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('limit_range_list', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,218 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_local_subject_access_review
|
||||
short_description: Kubernetes LocalSubjectAccessReview
|
||||
description:
|
||||
- Manage the lifecycle of a local_subject_access_review object. Supports check mode,
|
||||
and attempts to to be idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
spec_extra:
|
||||
description:
|
||||
- Extra corresponds to the user.Info.GetExtra() method from the authenticator.
|
||||
Since that is input to the authorizer it needs a reflection here.
|
||||
aliases:
|
||||
- extra
|
||||
type: dict
|
||||
spec_groups:
|
||||
description:
|
||||
- Groups is the groups you're testing for.
|
||||
aliases:
|
||||
- groups
|
||||
type: list
|
||||
spec_non_resource_attributes_path:
|
||||
description:
|
||||
- Path is the URL path of the request
|
||||
aliases:
|
||||
- non_resource_attributes_path
|
||||
spec_non_resource_attributes_verb:
|
||||
description:
|
||||
- Verb is the standard HTTP verb
|
||||
aliases:
|
||||
- non_resource_attributes_verb
|
||||
spec_resource_attributes_group:
|
||||
description:
|
||||
- Group is the API Group of the Resource. "*" means all.
|
||||
aliases:
|
||||
- resource_attributes_group
|
||||
spec_resource_attributes_name:
|
||||
description:
|
||||
- Name is the name of the resource being requested for a "get" or deleted for
|
||||
a "delete". "" (empty) means all.
|
||||
aliases:
|
||||
- resource_attributes_name
|
||||
spec_resource_attributes_namespace:
|
||||
description:
|
||||
- Namespace is the namespace of the action being requested. Currently, there is
|
||||
no distinction between no namespace and all namespaces "" (empty) is defaulted
|
||||
for LocalSubjectAccessReviews "" (empty) is empty for cluster-scoped resources
|
||||
"" (empty) means "all" for namespace scoped resources from a SubjectAccessReview
|
||||
or SelfSubjectAccessReview
|
||||
aliases:
|
||||
- resource_attributes_namespace
|
||||
spec_resource_attributes_resource:
|
||||
description:
|
||||
- Resource is one of the existing resource types. "*" means all.
|
||||
aliases:
|
||||
- resource_attributes_resource
|
||||
spec_resource_attributes_subresource:
|
||||
description:
|
||||
- Subresource is one of the existing resource types. "" means none.
|
||||
aliases:
|
||||
- resource_attributes_subresource
|
||||
spec_resource_attributes_verb:
|
||||
description:
|
||||
- 'Verb is a kubernetes resource API verb, like: get, list, watch, create, update,
|
||||
delete, proxy. "*" means all.'
|
||||
aliases:
|
||||
- resource_attributes_verb
|
||||
spec_resource_attributes_version:
|
||||
description:
|
||||
- Version is the API Version of the Resource. "*" means all.
|
||||
aliases:
|
||||
- resource_attributes_version
|
||||
spec_uid:
|
||||
description:
|
||||
- UID information about the requesting user.
|
||||
aliases:
|
||||
- uid
|
||||
spec_user:
|
||||
description:
|
||||
- User is the user you're testing for. If you specify "User" but not "Groups",
|
||||
then is it interpreted as "What if User were not a member of any groups
|
||||
aliases:
|
||||
- user
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
local_subject_access_review:
|
||||
type: complex
|
||||
returned: on success
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description: []
|
||||
type: complex
|
||||
spec:
|
||||
description:
|
||||
- Spec holds information about the request being evaluated. spec.namespace must
|
||||
be equal to the namespace you made the request against. If empty, it is defaulted.
|
||||
type: complex
|
||||
status:
|
||||
description:
|
||||
- Status is filled in by the server and indicates whether the request is allowed
|
||||
or not
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('local_subject_access_review', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,224 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_namespace
|
||||
short_description: Kubernetes Namespace
|
||||
description:
|
||||
- Manage the lifecycle of a namespace object. Supports check mode, and attempts to
|
||||
to be idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
spec_finalizers:
|
||||
description:
|
||||
- Finalizers is an opaque list of values that must be empty to permanently remove
|
||||
object from storage.
|
||||
aliases:
|
||||
- finalizers
|
||||
type: list
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
- name: Create a namespace
|
||||
k8s_v1_namespace.yml:
|
||||
name: k8s-namespace
|
||||
state: present
|
||||
|
||||
- name: Add labels and annotations
|
||||
k8s_v1_namespace.yml:
|
||||
name: k8s-namespace
|
||||
state: present
|
||||
labels:
|
||||
app_env: production
|
||||
app_class: '3'
|
||||
annotations:
|
||||
domain: namespace.com.acmecorp
|
||||
|
||||
- name: Update labels and annotations
|
||||
k8s_v1_namespace.yml:
|
||||
name: k8s-namespace
|
||||
state: present
|
||||
labels:
|
||||
app_env: production
|
||||
app_class: '4'
|
||||
app_group: '2'
|
||||
annotations:
|
||||
domain: namespace.app.com.acmecorp
|
||||
monitoring_group: '1'
|
||||
|
||||
- name: Create a namespace
|
||||
k8s_v1_namespace.yml:
|
||||
name: search-namespace
|
||||
state: present
|
||||
labels:
|
||||
app: web
|
||||
level: '1'
|
||||
annotations:
|
||||
company: acme.com
|
||||
|
||||
- name: Replace namespace
|
||||
k8s_v1_namespace.yml:
|
||||
name: search-namespace
|
||||
state: replaced
|
||||
labels:
|
||||
app: web_app
|
||||
level: '3'
|
||||
annotations:
|
||||
company: acme.com
|
||||
|
||||
- name: Remove namespace
|
||||
k8s_v1_namespace.yml:
|
||||
name: search-namespace
|
||||
state: absent
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
namespace:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
spec:
|
||||
description:
|
||||
- Spec defines the behavior of the Namespace.
|
||||
type: complex
|
||||
status:
|
||||
description:
|
||||
- Status describes the current status of a Namespace.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('namespace', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,165 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_namespace_list
|
||||
short_description: Kubernetes NamespaceList
|
||||
description:
|
||||
- Retrieve a list of namespaces. List operations provide a snapshot read of the underlying
|
||||
objects, returning a resource_version representing a consistent version of the listed
|
||||
objects.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
namespace_list:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
items:
|
||||
description:
|
||||
- Items is the list of Namespace objects in the list.
|
||||
type: list
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value,
|
||||
and may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
spec:
|
||||
description:
|
||||
- Spec defines the behavior of the Namespace.
|
||||
type: complex
|
||||
status:
|
||||
description:
|
||||
- Status describes the current status of a Namespace.
|
||||
type: complex
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard list metadata.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('namespace_list', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,217 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_network_policy
|
||||
short_description: Kubernetes NetworkPolicy
|
||||
description:
|
||||
- Manage the lifecycle of a network_policy object. Supports check mode, and attempts
|
||||
to to be idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
spec_egress:
|
||||
description:
|
||||
- List of egress rules to be applied to the selected pods. Outgoing traffic is
|
||||
allowed if there are no NetworkPolicies selecting the pod (and cluster policy
|
||||
otherwise allows the traffic), OR if the traffic matches at least one egress
|
||||
rule across all of the NetworkPolicy objects whose podSelector matches the pod.
|
||||
If this field is empty then this NetworkPolicy limits all outgoing traffic (and
|
||||
serves solely to ensure that the pods it selects are isolated by default). This
|
||||
field is beta-level in 1.8
|
||||
aliases:
|
||||
- egress
|
||||
type: list
|
||||
spec_ingress:
|
||||
description:
|
||||
- List of ingress rules to be applied to the selected pods. Traffic is allowed
|
||||
to a pod if there are no NetworkPolicies selecting the pod (and cluster policy
|
||||
otherwise allows the traffic), OR if the traffic source is the pod's local node,
|
||||
OR if the traffic matches at least one ingress rule across all of the NetworkPolicy
|
||||
objects whose podSelector matches the pod. If this field is empty then this
|
||||
NetworkPolicy does not allow any traffic (and serves solely to ensure that the
|
||||
pods it selects are isolated by default)
|
||||
aliases:
|
||||
- ingress
|
||||
type: list
|
||||
spec_pod_selector_match_expressions:
|
||||
description:
|
||||
- matchExpressions is a list of label selector requirements. The requirements
|
||||
are ANDed.
|
||||
aliases:
|
||||
- pod_selector_match_expressions
|
||||
type: list
|
||||
spec_pod_selector_match_labels:
|
||||
description:
|
||||
- matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
|
||||
map is equivalent to an element of matchExpressions, whose key field is "key",
|
||||
the operator is "In", and the values array contains only "value". The requirements
|
||||
are ANDed.
|
||||
aliases:
|
||||
- pod_selector_match_labels
|
||||
type: dict
|
||||
spec_policy_types:
|
||||
description:
|
||||
- List of rule types that the NetworkPolicy relates to. Valid options are Ingress,
|
||||
Egress, or Ingress,Egress. If this field is not specified, it will default based
|
||||
on the existence of Ingress or Egress rules; policies that contain an Egress
|
||||
section are assumed to affect Egress, and all policies (whether or not they
|
||||
contain an Ingress section) are assumed to affect Ingress. If you want to write
|
||||
an egress-only policy, you must explicitly specify policyTypes [ "Egress" ].
|
||||
Likewise, if you want to write a policy that specifies that no egress is allowed,
|
||||
you must specify a policyTypes value that include "Egress" (since such a policy
|
||||
would not include an Egress section and would otherwise default to just [ "Ingress"
|
||||
]). This field is beta-level in 1.8
|
||||
aliases:
|
||||
- policy_types
|
||||
type: list
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
network_policy:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
spec:
|
||||
description:
|
||||
- Specification of the desired behavior for this NetworkPolicy.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('network_policy', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,161 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_network_policy_list
|
||||
short_description: Kubernetes NetworkPolicyList
|
||||
description:
|
||||
- Retrieve a list of network_policys. List operations provide a snapshot read of the
|
||||
underlying objects, returning a resource_version representing a consistent version
|
||||
of the listed objects.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
network_policy_list:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
items:
|
||||
description:
|
||||
- Items is a list of schema objects.
|
||||
type: list
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value,
|
||||
and may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
spec:
|
||||
description:
|
||||
- Specification of the desired behavior for this NetworkPolicy.
|
||||
type: complex
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard list metadata.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('network_policy_list', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,250 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_node
|
||||
short_description: Kubernetes Node
|
||||
description:
|
||||
- Manage the lifecycle of a node object. Supports check mode, and attempts to to be
|
||||
idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
spec_config_source_api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
aliases:
|
||||
- _source_api_version
|
||||
spec_config_source_config_map_ref_api_version:
|
||||
description:
|
||||
- API version of the referent.
|
||||
aliases:
|
||||
- _source__map_ref_api_version
|
||||
spec_config_source_config_map_ref_field_path:
|
||||
description:
|
||||
- 'If referring to a piece of an object instead of an entire object, this string
|
||||
should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2].
|
||||
For example, if the object reference is to a container within a pod, this would
|
||||
take on a value like: "spec.containers{name}" (where "name" refers to the name
|
||||
of the container that triggered the event) or if no container name is specified
|
||||
"spec.containers[2]" (container with index 2 in this pod). This syntax is chosen
|
||||
only to have some well-defined way of referencing a part of an object.'
|
||||
aliases:
|
||||
- _source__map_ref_field_path
|
||||
spec_config_source_config_map_ref_kind:
|
||||
description:
|
||||
- Kind of the referent.
|
||||
aliases:
|
||||
- _source__map_ref_kind
|
||||
spec_config_source_config_map_ref_name:
|
||||
description:
|
||||
- Name of the referent.
|
||||
aliases:
|
||||
- _source__map_ref_name
|
||||
spec_config_source_config_map_ref_namespace:
|
||||
description:
|
||||
- Namespace of the referent.
|
||||
aliases:
|
||||
- _source__map_ref_namespace
|
||||
spec_config_source_config_map_ref_resource_version:
|
||||
description:
|
||||
- Specific resourceVersion to which this reference is made, if any.
|
||||
aliases:
|
||||
- _source__map_ref_resource_version
|
||||
spec_config_source_config_map_ref_uid:
|
||||
description:
|
||||
- UID of the referent.
|
||||
aliases:
|
||||
- _source__map_ref_uid
|
||||
spec_config_source_kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
aliases:
|
||||
- _source_kind
|
||||
spec_external_id:
|
||||
description:
|
||||
- External ID of the node assigned by some machine database (e.g. a cloud provider).
|
||||
Deprecated.
|
||||
aliases:
|
||||
- external_id
|
||||
spec_pod_cidr:
|
||||
description:
|
||||
- PodCIDR represents the pod IP range assigned to the node.
|
||||
aliases:
|
||||
- pod_cidr
|
||||
spec_provider_id:
|
||||
description:
|
||||
- 'ID of the node assigned by the cloud provider in the format: <ProviderName>://<ProviderSpecificNodeID>'
|
||||
aliases:
|
||||
- provider_id
|
||||
spec_taints:
|
||||
description:
|
||||
- If specified, the node's taints.
|
||||
aliases:
|
||||
- taints
|
||||
type: list
|
||||
spec_unschedulable:
|
||||
description:
|
||||
- Unschedulable controls node schedulability of new pods. By default, node is
|
||||
schedulable.
|
||||
aliases:
|
||||
- unschedulable
|
||||
type: bool
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
node:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
spec:
|
||||
description:
|
||||
- Spec defines the behavior of a node.
|
||||
type: complex
|
||||
status:
|
||||
description:
|
||||
- Most recently observed status of the node. Populated by the system. Read-only.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('node', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,165 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_node_list
|
||||
short_description: Kubernetes NodeList
|
||||
description:
|
||||
- Retrieve a list of nodes. List operations provide a snapshot read of the underlying
|
||||
objects, returning a resource_version representing a consistent version of the listed
|
||||
objects.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
node_list:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
items:
|
||||
description:
|
||||
- List of nodes
|
||||
type: list
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value,
|
||||
and may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
spec:
|
||||
description:
|
||||
- Spec defines the behavior of a node.
|
||||
type: complex
|
||||
status:
|
||||
description:
|
||||
- Most recently observed status of the node. Populated by the system. Read-only.
|
||||
type: complex
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard list metadata.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('node_list', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,867 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_persistent_volume
|
||||
short_description: Kubernetes PersistentVolume
|
||||
description:
|
||||
- Manage the lifecycle of a persistent_volume object. Supports check mode, and attempts
|
||||
to to be idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
spec_access_modes:
|
||||
description:
|
||||
- AccessModes contains all ways the volume can be mounted.
|
||||
aliases:
|
||||
- access_modes
|
||||
type: list
|
||||
spec_aws_elastic_block_store_fs_type:
|
||||
description:
|
||||
- 'Filesystem type of the volume that you want to mount. Tip: Ensure that the
|
||||
filesystem type is supported by the host operating system. Examples: "ext4",
|
||||
"xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.'
|
||||
aliases:
|
||||
- aws_elastic_block_store_fs_type
|
||||
spec_aws_elastic_block_store_partition:
|
||||
description:
|
||||
- 'The partition in the volume that you want to mount. If omitted, the default
|
||||
is to mount by volume name. Examples: For volume /dev/sda1, you specify the
|
||||
partition as "1". Similarly, the volume partition for /dev/sda is "0" (or you
|
||||
can leave the property empty).'
|
||||
aliases:
|
||||
- aws_elastic_block_store_partition
|
||||
type: int
|
||||
spec_aws_elastic_block_store_read_only:
|
||||
description:
|
||||
- Specify "true" to force and set the ReadOnly property in VolumeMounts to "true".
|
||||
If omitted, the default is "false".
|
||||
aliases:
|
||||
- aws_elastic_block_store_read_only
|
||||
type: bool
|
||||
spec_aws_elastic_block_store_volume_id:
|
||||
description:
|
||||
- Unique ID of the persistent disk resource in AWS (Amazon EBS volume).
|
||||
aliases:
|
||||
- aws_elastic_block_store_volume_id
|
||||
spec_azure_disk_caching_mode:
|
||||
description:
|
||||
- 'Host Caching mode: None, Read Only, Read Write.'
|
||||
aliases:
|
||||
- azure_disk_caching_mode
|
||||
spec_azure_disk_disk_name:
|
||||
description:
|
||||
- The Name of the data disk in the blob storage
|
||||
aliases:
|
||||
- azure_disk_disk_name
|
||||
spec_azure_disk_disk_uri:
|
||||
description:
|
||||
- The URI the data disk in the blob storage
|
||||
aliases:
|
||||
- azure_disk_disk_uri
|
||||
spec_azure_disk_fs_type:
|
||||
description:
|
||||
- Filesystem type to mount. Must be a filesystem type supported by the host operating
|
||||
system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
|
||||
aliases:
|
||||
- azure_disk_fs_type
|
||||
spec_azure_disk_kind:
|
||||
description:
|
||||
- 'Expected values Shared: mulitple blob disks per storage account Dedicated:
|
||||
single blob disk per storage account Managed: azure managed data disk (only
|
||||
in managed availability set). defaults to shared'
|
||||
aliases:
|
||||
- azure_disk_kind
|
||||
spec_azure_disk_read_only:
|
||||
description:
|
||||
- Defaults to false (read/write). ReadOnly here will force the ReadOnly setting
|
||||
in VolumeMounts.
|
||||
aliases:
|
||||
- azure_disk_read_only
|
||||
type: bool
|
||||
spec_azure_file_read_only:
|
||||
description:
|
||||
- Defaults to false (read/write). ReadOnly here will force the ReadOnly setting
|
||||
in VolumeMounts.
|
||||
aliases:
|
||||
- azure_file_read_only
|
||||
type: bool
|
||||
spec_azure_file_secret_name:
|
||||
description:
|
||||
- the name of secret that contains Azure Storage Account Name and Key
|
||||
aliases:
|
||||
- azure_file_secret_name
|
||||
spec_azure_file_secret_namespace:
|
||||
description:
|
||||
- the namespace of the secret that contains Azure Storage Account Name and Key
|
||||
default is the same as the Pod
|
||||
aliases:
|
||||
- azure_file_secret_namespace
|
||||
spec_azure_file_share_name:
|
||||
description:
|
||||
- Share Name
|
||||
aliases:
|
||||
- azure_file_share_name
|
||||
spec_capacity:
|
||||
description:
|
||||
- A description of the persistent volume's resources and capacity.
|
||||
aliases:
|
||||
- capacity
|
||||
type: dict
|
||||
spec_cephfs_monitors:
|
||||
description:
|
||||
- 'Required: Monitors is a collection of Ceph monitors'
|
||||
aliases:
|
||||
- cephfs_monitors
|
||||
type: list
|
||||
spec_cephfs_path:
|
||||
description:
|
||||
- 'Optional: Used as the mounted root, rather than the full Ceph tree, default
|
||||
is /'
|
||||
aliases:
|
||||
- cephfs_path
|
||||
spec_cephfs_read_only:
|
||||
description:
|
||||
- 'Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly
|
||||
setting in VolumeMounts.'
|
||||
aliases:
|
||||
- cephfs_read_only
|
||||
type: bool
|
||||
spec_cephfs_secret_file:
|
||||
description:
|
||||
- 'Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret'
|
||||
aliases:
|
||||
- cephfs_secret_file
|
||||
spec_cephfs_secret_ref_name:
|
||||
description:
|
||||
- Name is unique within a namespace to reference a secret resource.
|
||||
aliases:
|
||||
- cephfs_secret_ref_name
|
||||
spec_cephfs_secret_ref_namespace:
|
||||
description:
|
||||
- Namespace defines the space within which the secret name must be unique.
|
||||
aliases:
|
||||
- cephfs_secret_ref_namespace
|
||||
spec_cephfs_user:
|
||||
description:
|
||||
- 'Optional: User is the rados user name, default is admin'
|
||||
aliases:
|
||||
- cephfs_user
|
||||
spec_cinder_fs_type:
|
||||
description:
|
||||
- 'Filesystem type to mount. Must be a filesystem type supported by the host operating
|
||||
system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if
|
||||
unspecified.'
|
||||
aliases:
|
||||
- cinder_fs_type
|
||||
spec_cinder_read_only:
|
||||
description:
|
||||
- 'Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly
|
||||
setting in VolumeMounts.'
|
||||
aliases:
|
||||
- cinder_read_only
|
||||
type: bool
|
||||
spec_cinder_volume_id:
|
||||
description:
|
||||
- volume id used to identify the volume in cinder
|
||||
aliases:
|
||||
- cinder_volume_id
|
||||
spec_claim_ref_api_version:
|
||||
description:
|
||||
- API version of the referent.
|
||||
aliases:
|
||||
- claim_ref_api_version
|
||||
spec_claim_ref_field_path:
|
||||
description:
|
||||
- 'If referring to a piece of an object instead of an entire object, this string
|
||||
should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2].
|
||||
For example, if the object reference is to a container within a pod, this would
|
||||
take on a value like: "spec.containers{name}" (where "name" refers to the name
|
||||
of the container that triggered the event) or if no container name is specified
|
||||
"spec.containers[2]" (container with index 2 in this pod). This syntax is chosen
|
||||
only to have some well-defined way of referencing a part of an object.'
|
||||
aliases:
|
||||
- claim_ref_field_path
|
||||
spec_claim_ref_kind:
|
||||
description:
|
||||
- Kind of the referent.
|
||||
aliases:
|
||||
- claim_ref_kind
|
||||
spec_claim_ref_name:
|
||||
description:
|
||||
- Name of the referent.
|
||||
aliases:
|
||||
- claim_ref_name
|
||||
spec_claim_ref_namespace:
|
||||
description:
|
||||
- Namespace of the referent.
|
||||
aliases:
|
||||
- claim_ref_namespace
|
||||
spec_claim_ref_resource_version:
|
||||
description:
|
||||
- Specific resourceVersion to which this reference is made, if any.
|
||||
aliases:
|
||||
- claim_ref_resource_version
|
||||
spec_claim_ref_uid:
|
||||
description:
|
||||
- UID of the referent.
|
||||
aliases:
|
||||
- claim_ref_uid
|
||||
spec_fc_fs_type:
|
||||
description:
|
||||
- Filesystem type to mount. Must be a filesystem type supported by the host operating
|
||||
system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
|
||||
aliases:
|
||||
- fc_fs_type
|
||||
spec_fc_lun:
|
||||
description:
|
||||
- 'Optional: FC target lun number'
|
||||
aliases:
|
||||
- fc_lun
|
||||
type: int
|
||||
spec_fc_read_only:
|
||||
description:
|
||||
- 'Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly
|
||||
setting in VolumeMounts.'
|
||||
aliases:
|
||||
- fc_read_only
|
||||
type: bool
|
||||
spec_fc_target_ww_ns:
|
||||
description:
|
||||
- 'Optional: FC target worldwide names (WWNs)'
|
||||
aliases:
|
||||
- fc_target_ww_ns
|
||||
type: list
|
||||
spec_fc_wwids:
|
||||
description:
|
||||
- 'Optional: FC volume world wide identifiers (wwids) Either wwids or combination
|
||||
of targetWWNs and lun must be set, but not both simultaneously.'
|
||||
aliases:
|
||||
- fc_wwids
|
||||
type: list
|
||||
spec_flex_volume_driver:
|
||||
description:
|
||||
- Driver is the name of the driver to use for this volume.
|
||||
aliases:
|
||||
- flex_volume_driver
|
||||
spec_flex_volume_fs_type:
|
||||
description:
|
||||
- Filesystem type to mount. Must be a filesystem type supported by the host operating
|
||||
system. Ex. "ext4", "xfs", "ntfs". The default filesystem depends on FlexVolume
|
||||
script.
|
||||
aliases:
|
||||
- flex_volume_fs_type
|
||||
spec_flex_volume_options:
|
||||
description:
|
||||
- 'Optional: Extra command options if any.'
|
||||
aliases:
|
||||
- flex_volume_options
|
||||
type: dict
|
||||
spec_flex_volume_read_only:
|
||||
description:
|
||||
- 'Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly
|
||||
setting in VolumeMounts.'
|
||||
aliases:
|
||||
- flex_volume_read_only
|
||||
type: bool
|
||||
spec_flex_volume_secret_ref_name:
|
||||
description:
|
||||
- Name of the referent.
|
||||
aliases:
|
||||
- flex_volume_secret_ref_name
|
||||
spec_flocker_dataset_name:
|
||||
description:
|
||||
- Name of the dataset stored as metadata -> name on the dataset for Flocker should
|
||||
be considered as deprecated
|
||||
aliases:
|
||||
- flocker_dataset_name
|
||||
spec_flocker_dataset_uuid:
|
||||
description:
|
||||
- UUID of the dataset. This is unique identifier of a Flocker dataset
|
||||
aliases:
|
||||
- flocker_dataset_uuid
|
||||
spec_gce_persistent_disk_fs_type:
|
||||
description:
|
||||
- 'Filesystem type of the volume that you want to mount. Tip: Ensure that the
|
||||
filesystem type is supported by the host operating system. Examples: "ext4",
|
||||
"xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.'
|
||||
aliases:
|
||||
- gce_persistent_disk_fs_type
|
||||
spec_gce_persistent_disk_partition:
|
||||
description:
|
||||
- 'The partition in the volume that you want to mount. If omitted, the default
|
||||
is to mount by volume name. Examples: For volume /dev/sda1, you specify the
|
||||
partition as "1". Similarly, the volume partition for /dev/sda is "0" (or you
|
||||
can leave the property empty).'
|
||||
aliases:
|
||||
- gce_persistent_disk_partition
|
||||
type: int
|
||||
spec_gce_persistent_disk_pd_name:
|
||||
description:
|
||||
- Unique name of the PD resource in GCE. Used to identify the disk in GCE.
|
||||
aliases:
|
||||
- gce_persistent_disk_pd_name
|
||||
spec_gce_persistent_disk_read_only:
|
||||
description:
|
||||
- ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false.
|
||||
aliases:
|
||||
- gce_persistent_disk_read_only
|
||||
type: bool
|
||||
spec_glusterfs_endpoints:
|
||||
description:
|
||||
- EndpointsName is the endpoint name that details Glusterfs topology.
|
||||
aliases:
|
||||
- glusterfs_endpoints
|
||||
spec_glusterfs_path:
|
||||
description:
|
||||
- Path is the Glusterfs volume path.
|
||||
aliases:
|
||||
- glusterfs_path
|
||||
spec_glusterfs_read_only:
|
||||
description:
|
||||
- ReadOnly here will force the Glusterfs volume to be mounted with read-only permissions.
|
||||
Defaults to false.
|
||||
aliases:
|
||||
- glusterfs_read_only
|
||||
type: bool
|
||||
spec_host_path_path:
|
||||
description:
|
||||
- Path of the directory on the host. If the path is a symlink, it will follow
|
||||
the link to the real path.
|
||||
aliases:
|
||||
- host_path_path
|
||||
spec_host_path_type:
|
||||
description:
|
||||
- Type for HostPath Volume Defaults to ""
|
||||
aliases:
|
||||
- host_path_type
|
||||
spec_iscsi_chap_auth_discovery:
|
||||
description:
|
||||
- whether support iSCSI Discovery CHAP authentication
|
||||
aliases:
|
||||
- iscsi_chap_auth_discovery
|
||||
type: bool
|
||||
spec_iscsi_chap_auth_session:
|
||||
description:
|
||||
- whether support iSCSI Session CHAP authentication
|
||||
aliases:
|
||||
- iscsi_chap_auth_session
|
||||
type: bool
|
||||
spec_iscsi_fs_type:
|
||||
description:
|
||||
- 'Filesystem type of the volume that you want to mount. Tip: Ensure that the
|
||||
filesystem type is supported by the host operating system. Examples: "ext4",
|
||||
"xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.'
|
||||
aliases:
|
||||
- iscsi_fs_type
|
||||
spec_iscsi_initiator_name:
|
||||
description:
|
||||
- Custom iSCSI initiator name. If initiatorName is specified with iscsiInterface
|
||||
simultaneously, new iSCSI interface <target portal>:<volume name> will be created
|
||||
for the connection.
|
||||
aliases:
|
||||
- iscsi_initiator_name
|
||||
spec_iscsi_iqn:
|
||||
description:
|
||||
- Target iSCSI Qualified Name.
|
||||
aliases:
|
||||
- iscsi_iqn
|
||||
spec_iscsi_iscsi_interface:
|
||||
description:
|
||||
- "Optional: Defaults to 'default' (tcp). iSCSI interface name that uses an iSCSI\
|
||||
\ transport."
|
||||
aliases:
|
||||
- iscsi_iscsi_interface
|
||||
spec_iscsi_lun:
|
||||
description:
|
||||
- iSCSI target lun number.
|
||||
aliases:
|
||||
- iscsi_lun
|
||||
type: int
|
||||
spec_iscsi_portals:
|
||||
description:
|
||||
- iSCSI target portal List. The portal is either an IP or ip_addr:port if the
|
||||
port is other than default (typically TCP ports 860 and 3260).
|
||||
aliases:
|
||||
- iscsi_portals
|
||||
type: list
|
||||
spec_iscsi_read_only:
|
||||
description:
|
||||
- ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false.
|
||||
aliases:
|
||||
- iscsi_read_only
|
||||
type: bool
|
||||
spec_iscsi_secret_ref_name:
|
||||
description:
|
||||
- Name of the referent.
|
||||
aliases:
|
||||
- iscsi_secret_ref_name
|
||||
spec_iscsi_target_portal:
|
||||
description:
|
||||
- iSCSI target portal. The portal is either an IP or ip_addr:port if the port
|
||||
is other than default (typically TCP ports 860 and 3260).
|
||||
aliases:
|
||||
- iscsi_target_portal
|
||||
spec_local_path:
|
||||
description:
|
||||
- The full path to the volume on the node For alpha, this path must be a directory
|
||||
Once block as a source is supported, then this path can point to a block device
|
||||
aliases:
|
||||
- local_path
|
||||
spec_mount_options:
|
||||
description:
|
||||
- A list of mount options, e.g. ["ro", "soft"]. Not validated - mount will simply
|
||||
fail if one is invalid.
|
||||
aliases:
|
||||
- mount_options
|
||||
type: list
|
||||
spec_nfs_path:
|
||||
description:
|
||||
- Path that is exported by the NFS server.
|
||||
aliases:
|
||||
- nfs_path
|
||||
spec_nfs_read_only:
|
||||
description:
|
||||
- ReadOnly here will force the NFS export to be mounted with read-only permissions.
|
||||
Defaults to false.
|
||||
aliases:
|
||||
- nfs_read_only
|
||||
type: bool
|
||||
spec_nfs_server:
|
||||
description:
|
||||
- Server is the hostname or IP address of the NFS server.
|
||||
aliases:
|
||||
- nfs_server
|
||||
spec_persistent_volume_reclaim_policy:
|
||||
description:
|
||||
- What happens to a persistent volume when released from its claim. Valid options
|
||||
are Retain (default) and Recycle. Recycling must be supported by the volume
|
||||
plugin underlying this persistent volume.
|
||||
aliases:
|
||||
- persistent_volume_reclaim_policy
|
||||
spec_photon_persistent_disk_fs_type:
|
||||
description:
|
||||
- Filesystem type to mount. Must be a filesystem type supported by the host operating
|
||||
system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
|
||||
aliases:
|
||||
- photon_persistent_disk_fs_type
|
||||
spec_photon_persistent_disk_pd_id:
|
||||
description:
|
||||
- ID that identifies Photon Controller persistent disk
|
||||
aliases:
|
||||
- photon_persistent_disk_pd_id
|
||||
spec_portworx_volume_fs_type:
|
||||
description:
|
||||
- FSType represents the filesystem type to mount Must be a filesystem type supported
|
||||
by the host operating system. Ex. "ext4", "xfs". Implicitly inferred to be "ext4"
|
||||
if unspecified.
|
||||
aliases:
|
||||
- portworx_volume_fs_type
|
||||
spec_portworx_volume_read_only:
|
||||
description:
|
||||
- Defaults to false (read/write). ReadOnly here will force the ReadOnly setting
|
||||
in VolumeMounts.
|
||||
aliases:
|
||||
- portworx_volume_read_only
|
||||
type: bool
|
||||
spec_portworx_volume_volume_id:
|
||||
description:
|
||||
- VolumeID uniquely identifies a Portworx volume
|
||||
aliases:
|
||||
- portworx_volume_volume_id
|
||||
spec_quobyte_group:
|
||||
description:
|
||||
- Group to map volume access to Default is no group
|
||||
aliases:
|
||||
- quobyte_group
|
||||
spec_quobyte_read_only:
|
||||
description:
|
||||
- ReadOnly here will force the Quobyte volume to be mounted with read-only permissions.
|
||||
Defaults to false.
|
||||
aliases:
|
||||
- quobyte_read_only
|
||||
type: bool
|
||||
spec_quobyte_registry:
|
||||
description:
|
||||
- Registry represents a single or multiple Quobyte Registry services specified
|
||||
as a string as host:port pair (multiple entries are separated with commas) which
|
||||
acts as the central registry for volumes
|
||||
aliases:
|
||||
- quobyte_registry
|
||||
spec_quobyte_user:
|
||||
description:
|
||||
- User to map volume access to Defaults to serivceaccount user
|
||||
aliases:
|
||||
- quobyte_user
|
||||
spec_quobyte_volume:
|
||||
description:
|
||||
- Volume is a string that references an already created Quobyte volume by name.
|
||||
aliases:
|
||||
- quobyte_volume
|
||||
spec_rbd_fs_type:
|
||||
description:
|
||||
- 'Filesystem type of the volume that you want to mount. Tip: Ensure that the
|
||||
filesystem type is supported by the host operating system. Examples: "ext4",
|
||||
"xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.'
|
||||
aliases:
|
||||
- rbd_fs_type
|
||||
spec_rbd_image:
|
||||
description:
|
||||
- The rados image name.
|
||||
aliases:
|
||||
- rbd_image
|
||||
spec_rbd_keyring:
|
||||
description:
|
||||
- Keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring.
|
||||
aliases:
|
||||
- rbd_keyring
|
||||
spec_rbd_monitors:
|
||||
description:
|
||||
- A collection of Ceph monitors.
|
||||
aliases:
|
||||
- rbd_monitors
|
||||
type: list
|
||||
spec_rbd_pool:
|
||||
description:
|
||||
- The rados pool name. Default is rbd.
|
||||
aliases:
|
||||
- rbd_pool
|
||||
spec_rbd_read_only:
|
||||
description:
|
||||
- ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false.
|
||||
aliases:
|
||||
- rbd_read_only
|
||||
type: bool
|
||||
spec_rbd_secret_ref_name:
|
||||
description:
|
||||
- Name of the referent.
|
||||
aliases:
|
||||
- rbd_secret_ref_name
|
||||
spec_rbd_user:
|
||||
description:
|
||||
- The rados user name. Default is admin.
|
||||
aliases:
|
||||
- rbd_user
|
||||
spec_scale_io_fs_type:
|
||||
description:
|
||||
- Filesystem type to mount. Must be a filesystem type supported by the host operating
|
||||
system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
|
||||
aliases:
|
||||
- scale_io_fs_type
|
||||
spec_scale_io_gateway:
|
||||
description:
|
||||
- The host address of the ScaleIO API Gateway.
|
||||
aliases:
|
||||
- scale_io_gateway
|
||||
spec_scale_io_protection_domain:
|
||||
description:
|
||||
- The name of the ScaleIO Protection Domain for the configured storage.
|
||||
aliases:
|
||||
- scale_io_protection_domain
|
||||
spec_scale_io_read_only:
|
||||
description:
|
||||
- Defaults to false (read/write). ReadOnly here will force the ReadOnly setting
|
||||
in VolumeMounts.
|
||||
aliases:
|
||||
- scale_io_read_only
|
||||
type: bool
|
||||
spec_scale_io_secret_ref_name:
|
||||
description:
|
||||
- Name is unique within a namespace to reference a secret resource.
|
||||
aliases:
|
||||
- scale_io_secret_ref_name
|
||||
spec_scale_io_secret_ref_namespace:
|
||||
description:
|
||||
- Namespace defines the space within which the secret name must be unique.
|
||||
aliases:
|
||||
- scale_io_secret_ref_namespace
|
||||
spec_scale_io_ssl_enabled:
|
||||
description:
|
||||
- Flag to enable/disable SSL communication with Gateway, default false
|
||||
aliases:
|
||||
- scale_io_ssl_enabled
|
||||
type: bool
|
||||
spec_scale_io_storage_mode:
|
||||
description:
|
||||
- Indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned.
|
||||
aliases:
|
||||
- scale_io_storage_mode
|
||||
spec_scale_io_storage_pool:
|
||||
description:
|
||||
- The ScaleIO Storage Pool associated with the protection domain.
|
||||
aliases:
|
||||
- scale_io_storage_pool
|
||||
spec_scale_io_system:
|
||||
description:
|
||||
- The name of the storage system as configured in ScaleIO.
|
||||
aliases:
|
||||
- scale_io_system
|
||||
spec_scale_io_volume_name:
|
||||
description:
|
||||
- The name of a volume already created in the ScaleIO system that is associated
|
||||
with this volume source.
|
||||
aliases:
|
||||
- scale_io_volume_name
|
||||
spec_storage_class_name:
|
||||
description:
|
||||
- Name of StorageClass to which this persistent volume belongs. Empty value means
|
||||
that this volume does not belong to any StorageClass.
|
||||
aliases:
|
||||
- storage_class_name
|
||||
spec_storageos_fs_type:
|
||||
description:
|
||||
- Filesystem type to mount. Must be a filesystem type supported by the host operating
|
||||
system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
|
||||
aliases:
|
||||
- storageos_fs_type
|
||||
spec_storageos_read_only:
|
||||
description:
|
||||
- Defaults to false (read/write). ReadOnly here will force the ReadOnly setting
|
||||
in VolumeMounts.
|
||||
aliases:
|
||||
- storageos_read_only
|
||||
type: bool
|
||||
spec_storageos_secret_ref_api_version:
|
||||
description:
|
||||
- API version of the referent.
|
||||
aliases:
|
||||
- storageos_secret_ref_api_version
|
||||
spec_storageos_secret_ref_field_path:
|
||||
description:
|
||||
- 'If referring to a piece of an object instead of an entire object, this string
|
||||
should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2].
|
||||
For example, if the object reference is to a container within a pod, this would
|
||||
take on a value like: "spec.containers{name}" (where "name" refers to the name
|
||||
of the container that triggered the event) or if no container name is specified
|
||||
"spec.containers[2]" (container with index 2 in this pod). This syntax is chosen
|
||||
only to have some well-defined way of referencing a part of an object.'
|
||||
aliases:
|
||||
- storageos_secret_ref_field_path
|
||||
spec_storageos_secret_ref_kind:
|
||||
description:
|
||||
- Kind of the referent.
|
||||
aliases:
|
||||
- storageos_secret_ref_kind
|
||||
spec_storageos_secret_ref_name:
|
||||
description:
|
||||
- Name of the referent.
|
||||
aliases:
|
||||
- storageos_secret_ref_name
|
||||
spec_storageos_secret_ref_namespace:
|
||||
description:
|
||||
- Namespace of the referent.
|
||||
aliases:
|
||||
- storageos_secret_ref_namespace
|
||||
spec_storageos_secret_ref_resource_version:
|
||||
description:
|
||||
- Specific resourceVersion to which this reference is made, if any.
|
||||
aliases:
|
||||
- storageos_secret_ref_resource_version
|
||||
spec_storageos_secret_ref_uid:
|
||||
description:
|
||||
- UID of the referent.
|
||||
aliases:
|
||||
- storageos_secret_ref_uid
|
||||
spec_storageos_volume_name:
|
||||
description:
|
||||
- VolumeName is the human-readable name of the StorageOS volume. Volume names
|
||||
are only unique within a namespace.
|
||||
aliases:
|
||||
- storageos_volume_name
|
||||
spec_storageos_volume_namespace:
|
||||
description:
|
||||
- VolumeNamespace specifies the scope of the volume within StorageOS. If no namespace
|
||||
is specified then the Pod's namespace will be used. This allows the Kubernetes
|
||||
name scoping to be mirrored within StorageOS for tighter integration. Set VolumeName
|
||||
to any name to override the default behaviour. Set to "default" if you are not
|
||||
using namespaces within StorageOS. Namespaces that do not pre-exist within StorageOS
|
||||
will be created.
|
||||
aliases:
|
||||
- storageos_volume_namespace
|
||||
spec_vsphere_volume_fs_type:
|
||||
description:
|
||||
- Filesystem type to mount. Must be a filesystem type supported by the host operating
|
||||
system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
|
||||
aliases:
|
||||
- vsphere_volume_fs_type
|
||||
spec_vsphere_volume_storage_policy_id:
|
||||
description:
|
||||
- Storage Policy Based Management (SPBM) profile ID associated with the StoragePolicyName.
|
||||
aliases:
|
||||
- vsphere_volume_storage_policy_id
|
||||
spec_vsphere_volume_storage_policy_name:
|
||||
description:
|
||||
- Storage Policy Based Management (SPBM) profile name.
|
||||
aliases:
|
||||
- vsphere_volume_storage_policy_name
|
||||
spec_vsphere_volume_volume_path:
|
||||
description:
|
||||
- Path that identifies vSphere volume vmdk
|
||||
aliases:
|
||||
- vsphere_volume_volume_path
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
- name: Create persitent volume
|
||||
k8s_v1_persistent_volume.yml:
|
||||
name: mypv
|
||||
state: present
|
||||
capacity:
|
||||
storage: 1Gi
|
||||
access_modes:
|
||||
- ReadWriteOnce
|
||||
persistent_volume_reclaim_policy: Recycle
|
||||
host_path_path: /tmp/test_volume
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
persistent_volume:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
spec:
|
||||
description:
|
||||
- Spec defines a specification of a persistent volume owned by the cluster.
|
||||
Provisioned by an administrator.
|
||||
type: complex
|
||||
status:
|
||||
description:
|
||||
- Status represents the current information/status for the persistent volume.
|
||||
Populated by the system. Read-only.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('persistent_volume', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,222 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_persistent_volume_claim
|
||||
short_description: Kubernetes PersistentVolumeClaim
|
||||
description:
|
||||
- Manage the lifecycle of a persistent_volume_claim object. Supports check mode, and
|
||||
attempts to to be idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
spec_access_modes:
|
||||
description:
|
||||
- AccessModes contains the desired access modes the volume should have.
|
||||
aliases:
|
||||
- access_modes
|
||||
type: list
|
||||
spec_resources_limits:
|
||||
description:
|
||||
- Limits describes the maximum amount of compute resources allowed.
|
||||
aliases:
|
||||
- resources_limits
|
||||
type: dict
|
||||
spec_resources_requests:
|
||||
description:
|
||||
- Requests describes the minimum amount of compute resources required. If Requests
|
||||
is omitted for a container, it defaults to Limits if that is explicitly specified,
|
||||
otherwise to an implementation-defined value.
|
||||
aliases:
|
||||
- resources_requests
|
||||
type: dict
|
||||
spec_selector_match_expressions:
|
||||
description:
|
||||
- matchExpressions is a list of label selector requirements. The requirements
|
||||
are ANDed.
|
||||
aliases:
|
||||
- selector_match_expressions
|
||||
type: list
|
||||
spec_selector_match_labels:
|
||||
description:
|
||||
- matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
|
||||
map is equivalent to an element of matchExpressions, whose key field is "key",
|
||||
the operator is "In", and the values array contains only "value". The requirements
|
||||
are ANDed.
|
||||
aliases:
|
||||
- selector_match_labels
|
||||
type: dict
|
||||
spec_storage_class_name:
|
||||
description:
|
||||
- Name of the StorageClass required by the claim.
|
||||
aliases:
|
||||
- storage_class_name
|
||||
spec_volume_name:
|
||||
description:
|
||||
- VolumeName is the binding reference to the PersistentVolume backing this claim.
|
||||
aliases:
|
||||
- volume_name
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
- name: Create persitent volume claim
|
||||
k8s_v1_persistent_volume_claim.yml:
|
||||
name: mypvc
|
||||
namespace: demo_project
|
||||
state: present
|
||||
access_modes:
|
||||
- ReadWriteOnce
|
||||
resources_requests:
|
||||
storage: 1Gi
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
persistent_volume_claim:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
spec:
|
||||
description:
|
||||
- Spec defines the desired characteristics of a volume requested by a pod author.
|
||||
type: complex
|
||||
status:
|
||||
description:
|
||||
- Status represents the current information/status of a persistent volume claim.
|
||||
Read-only.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('persistent_volume_claim', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,167 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_persistent_volume_claim_list
|
||||
short_description: Kubernetes PersistentVolumeClaimList
|
||||
description:
|
||||
- Retrieve a list of persistent_volume_claims. List operations provide a snapshot
|
||||
read of the underlying objects, returning a resource_version representing a consistent
|
||||
version of the listed objects.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
persistent_volume_claim_list:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
items:
|
||||
description:
|
||||
- A list of persistent volume claims.
|
||||
type: list
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value,
|
||||
and may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
spec:
|
||||
description:
|
||||
- Spec defines the desired characteristics of a volume requested by a pod
|
||||
author.
|
||||
type: complex
|
||||
status:
|
||||
description:
|
||||
- Status represents the current information/status of a persistent volume
|
||||
claim. Read-only.
|
||||
type: complex
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard list metadata.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('persistent_volume_claim_list', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,167 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_persistent_volume_list
|
||||
short_description: Kubernetes PersistentVolumeList
|
||||
description:
|
||||
- Retrieve a list of persistent_volumes. List operations provide a snapshot read of
|
||||
the underlying objects, returning a resource_version representing a consistent version
|
||||
of the listed objects.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
persistent_volume_list:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
items:
|
||||
description:
|
||||
- List of persistent volumes.
|
||||
type: list
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value,
|
||||
and may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
spec:
|
||||
description:
|
||||
- Spec defines a specification of a persistent volume owned by the cluster.
|
||||
Provisioned by an administrator.
|
||||
type: complex
|
||||
status:
|
||||
description:
|
||||
- Status represents the current information/status for the persistent volume.
|
||||
Populated by the system. Read-only.
|
||||
type: complex
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard list metadata.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('persistent_volume_list', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,466 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_pod
|
||||
short_description: Kubernetes Pod
|
||||
description:
|
||||
- Manage the lifecycle of a pod object. Supports check mode, and attempts to to be
|
||||
idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
spec_active_deadline_seconds:
|
||||
description:
|
||||
- Optional duration in seconds the pod may be active on the node relative to StartTime
|
||||
before the system will actively try to mark it failed and kill associated containers.
|
||||
Value must be a positive integer.
|
||||
aliases:
|
||||
- active_deadline_seconds
|
||||
type: int
|
||||
spec_affinity_node_affinity_preferred_during_scheduling_ignored_during_execution:
|
||||
description:
|
||||
- The scheduler will prefer to schedule pods to nodes that satisfy the affinity
|
||||
expressions specified by this field, but it may choose a node that violates
|
||||
one or more of the expressions. The node that is most preferred is the one with
|
||||
the greatest sum of weights, i.e. for each node that meets all of the scheduling
|
||||
requirements (resource request, requiredDuringScheduling affinity expressions,
|
||||
etc.), compute a sum by iterating through the elements of this field and adding
|
||||
"weight" to the sum if the node matches the corresponding matchExpressions;
|
||||
the node(s) with the highest sum are the most preferred.
|
||||
aliases:
|
||||
- affinity_node_affinity_preferred_during_scheduling_ignored_during_execution
|
||||
type: list
|
||||
spec_affinity_node_affinity_required_during_scheduling_ignored_during_execution_node_selector_terms:
|
||||
description:
|
||||
- Required. A list of node selector terms. The terms are ORed.
|
||||
aliases:
|
||||
- affinity_node_affinity_required_during_scheduling_ignored_during_execution_node_selector_terms
|
||||
type: list
|
||||
spec_affinity_pod_affinity_preferred_during_scheduling_ignored_during_execution:
|
||||
description:
|
||||
- The scheduler will prefer to schedule pods to nodes that satisfy the affinity
|
||||
expressions specified by this field, but it may choose a node that violates
|
||||
one or more of the expressions. The node that is most preferred is the one with
|
||||
the greatest sum of weights, i.e. for each node that meets all of the scheduling
|
||||
requirements (resource request, requiredDuringScheduling affinity expressions,
|
||||
etc.), compute a sum by iterating through the elements of this field and adding
|
||||
"weight" to the sum if the node has pods which matches the corresponding podAffinityTerm;
|
||||
the node(s) with the highest sum are the most preferred.
|
||||
aliases:
|
||||
- affinity_pod_affinity_preferred_during_scheduling_ignored_during_execution
|
||||
type: list
|
||||
spec_affinity_pod_affinity_required_during_scheduling_ignored_during_execution:
|
||||
description:
|
||||
- If the affinity requirements specified by this field are not met at scheduling
|
||||
time, the pod will not be scheduled onto the node. If the affinity requirements
|
||||
specified by this field cease to be met at some point during pod execution (e.g.
|
||||
due to a pod label update), the system may or may not try to eventually evict
|
||||
the pod from its node. When there are multiple elements, the lists of nodes
|
||||
corresponding to each podAffinityTerm are intersected, i.e. all terms must be
|
||||
satisfied.
|
||||
aliases:
|
||||
- affinity_pod_affinity_required_during_scheduling_ignored_during_execution
|
||||
type: list
|
||||
spec_affinity_pod_anti_affinity_preferred_during_scheduling_ignored_during_execution:
|
||||
description:
|
||||
- The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity
|
||||
expressions specified by this field, but it may choose a node that violates
|
||||
one or more of the expressions. The node that is most preferred is the one with
|
||||
the greatest sum of weights, i.e. for each node that meets all of the scheduling
|
||||
requirements (resource request, requiredDuringScheduling anti-affinity expressions,
|
||||
etc.), compute a sum by iterating through the elements of this field and adding
|
||||
"weight" to the sum if the node has pods which matches the corresponding podAffinityTerm;
|
||||
the node(s) with the highest sum are the most preferred.
|
||||
aliases:
|
||||
- affinity_pod_anti_affinity_preferred_during_scheduling_ignored_during_execution
|
||||
type: list
|
||||
spec_affinity_pod_anti_affinity_required_during_scheduling_ignored_during_execution:
|
||||
description:
|
||||
- If the anti-affinity requirements specified by this field are not met at scheduling
|
||||
time, the pod will not be scheduled onto the node. If the anti-affinity requirements
|
||||
specified by this field cease to be met at some point during pod execution (e.g.
|
||||
due to a pod label update), the system may or may not try to eventually evict
|
||||
the pod from its node. When there are multiple elements, the lists of nodes
|
||||
corresponding to each podAffinityTerm are intersected, i.e. all terms must be
|
||||
satisfied.
|
||||
aliases:
|
||||
- affinity_pod_anti_affinity_required_during_scheduling_ignored_during_execution
|
||||
type: list
|
||||
spec_automount_service_account_token:
|
||||
description:
|
||||
- AutomountServiceAccountToken indicates whether a service account token should
|
||||
be automatically mounted.
|
||||
aliases:
|
||||
- automount_service_account_token
|
||||
type: bool
|
||||
spec_containers:
|
||||
description:
|
||||
- List of containers belonging to the pod. Containers cannot currently be added
|
||||
or removed. There must be at least one container in a Pod. Cannot be updated.
|
||||
aliases:
|
||||
- containers
|
||||
type: list
|
||||
spec_dns_policy:
|
||||
description:
|
||||
- Set DNS policy for containers within the pod. One of 'ClusterFirstWithHostNet',
|
||||
'ClusterFirst' or 'Default'. Defaults to "ClusterFirst". To have DNS options
|
||||
set along with hostNetwork, you have to specify DNS policy explicitly to 'ClusterFirstWithHostNet'.
|
||||
aliases:
|
||||
- dns_policy
|
||||
spec_host_aliases:
|
||||
description:
|
||||
- HostAliases is an optional list of hosts and IPs that will be injected into
|
||||
the pod's hosts file if specified. This is only valid for non-hostNetwork pods.
|
||||
aliases:
|
||||
- host_aliases
|
||||
type: list
|
||||
spec_host_ipc:
|
||||
description:
|
||||
- "Use the host's ipc namespace. Optional: Default to false."
|
||||
aliases:
|
||||
- host_ipc
|
||||
type: bool
|
||||
spec_host_network:
|
||||
description:
|
||||
- Host networking requested for this pod. Use the host's network namespace. If
|
||||
this option is set, the ports that will be used must be specified. Default to
|
||||
false.
|
||||
aliases:
|
||||
- host_network
|
||||
type: bool
|
||||
spec_host_pid:
|
||||
description:
|
||||
- "Use the host's pid namespace. Optional: Default to false."
|
||||
aliases:
|
||||
- host_pid
|
||||
type: bool
|
||||
spec_hostname:
|
||||
description:
|
||||
- Specifies the hostname of the Pod If not specified, the pod's hostname will
|
||||
be set to a system-defined value.
|
||||
aliases:
|
||||
- hostname
|
||||
spec_image_pull_secrets:
|
||||
description:
|
||||
- ImagePullSecrets is an optional list of references to secrets in the same namespace
|
||||
to use for pulling any of the images used by this PodSpec. If specified, these
|
||||
secrets will be passed to individual puller implementations for them to use.
|
||||
For example, in the case of docker, only DockerConfig type secrets are honored.
|
||||
aliases:
|
||||
- image_pull_secrets
|
||||
type: list
|
||||
spec_init_containers:
|
||||
description:
|
||||
- List of initialization containers belonging to the pod. Init containers are
|
||||
executed in order prior to containers being started. If any init container fails,
|
||||
the pod is considered to have failed and is handled according to its restartPolicy.
|
||||
The name for an init container or normal container must be unique among all
|
||||
containers. Init containers may not have Lifecycle actions, Readiness probes,
|
||||
or Liveness probes. The resourceRequirements of an init container are taken
|
||||
into account during scheduling by finding the highest request/limit for each
|
||||
resource type, and then using the max of of that value or the sum of the normal
|
||||
containers. Limits are applied to init containers in a similar fashion. Init
|
||||
containers cannot currently be added or removed. Cannot be updated.
|
||||
aliases:
|
||||
- init_containers
|
||||
type: list
|
||||
spec_node_name:
|
||||
description:
|
||||
- NodeName is a request to schedule this pod onto a specific node. If it is non-empty,
|
||||
the scheduler simply schedules this pod onto that node, assuming that it fits
|
||||
resource requirements.
|
||||
aliases:
|
||||
- node_name
|
||||
spec_node_selector:
|
||||
description:
|
||||
- NodeSelector is a selector which must be true for the pod to fit on a node.
|
||||
Selector which must match a node's labels for the pod to be scheduled on that
|
||||
node.
|
||||
aliases:
|
||||
- node_selector
|
||||
type: dict
|
||||
spec_priority:
|
||||
description:
|
||||
- The priority value. Various system components use this field to find the priority
|
||||
of the pod. When Priority Admission Controller is enabled, it prevents users
|
||||
from setting this field. The admission controller populates this field from
|
||||
PriorityClassName. The higher the value, the higher the priority.
|
||||
aliases:
|
||||
- priority
|
||||
type: int
|
||||
spec_priority_class_name:
|
||||
description:
|
||||
- If specified, indicates the pod's priority. "SYSTEM" is a special keyword which
|
||||
indicates the highest priority. Any other name must be defined by creating a
|
||||
PriorityClass object with that name. If not specified, the pod priority will
|
||||
be default or zero if there is no default.
|
||||
aliases:
|
||||
- priority_class_name
|
||||
spec_restart_policy:
|
||||
description:
|
||||
- Restart policy for all containers within the pod. One of Always, OnFailure,
|
||||
Never. Default to Always.
|
||||
aliases:
|
||||
- restart_policy
|
||||
spec_scheduler_name:
|
||||
description:
|
||||
- If specified, the pod will be dispatched by specified scheduler. If not specified,
|
||||
the pod will be dispatched by default scheduler.
|
||||
aliases:
|
||||
- scheduler_name
|
||||
spec_security_context_fs_group:
|
||||
description:
|
||||
- "A special supplemental group that applies to all containers in a pod. Some\
|
||||
\ volume types allow the Kubelet to change the ownership of that volume to be\
|
||||
\ owned by the pod: 1. The owning GID will be the FSGroup 2. The setgid bit\
|
||||
\ is set (new files created in the volume will be owned by FSGroup) 3. The permission\
|
||||
\ bits are OR'd with rw-rw---- If unset, the Kubelet will not modify the ownership\
|
||||
\ and permissions of any volume."
|
||||
aliases:
|
||||
- security_context_fs_group
|
||||
type: int
|
||||
spec_security_context_run_as_non_root:
|
||||
description:
|
||||
- Indicates that the container must run as a non-root user. If true, the Kubelet
|
||||
will validate the image at runtime to ensure that it does not run as UID 0 (root)
|
||||
and fail to start the container if it does. If unset or false, no such validation
|
||||
will be performed. May also be set in SecurityContext. If set in both SecurityContext
|
||||
and PodSecurityContext, the value specified in SecurityContext takes precedence.
|
||||
aliases:
|
||||
- security_context_run_as_non_root
|
||||
type: bool
|
||||
spec_security_context_run_as_user:
|
||||
description:
|
||||
- The UID to run the entrypoint of the container process. Defaults to user specified
|
||||
in image metadata if unspecified. May also be set in SecurityContext. If set
|
||||
in both SecurityContext and PodSecurityContext, the value specified in SecurityContext
|
||||
takes precedence for that container.
|
||||
aliases:
|
||||
- security_context_run_as_user
|
||||
type: int
|
||||
spec_security_context_se_linux_options_level:
|
||||
description:
|
||||
- Level is SELinux level label that applies to the container.
|
||||
aliases:
|
||||
- security_context_se_linux_options_level
|
||||
spec_security_context_se_linux_options_role:
|
||||
description:
|
||||
- Role is a SELinux role label that applies to the container.
|
||||
aliases:
|
||||
- security_context_se_linux_options_role
|
||||
spec_security_context_se_linux_options_type:
|
||||
description:
|
||||
- Type is a SELinux type label that applies to the container.
|
||||
aliases:
|
||||
- security_context_se_linux_options_type
|
||||
spec_security_context_se_linux_options_user:
|
||||
description:
|
||||
- User is a SELinux user label that applies to the container.
|
||||
aliases:
|
||||
- security_context_se_linux_options_user
|
||||
spec_security_context_supplemental_groups:
|
||||
description:
|
||||
- A list of groups applied to the first process run in each container, in addition
|
||||
to the container's primary GID. If unspecified, no groups will be added to any
|
||||
container.
|
||||
aliases:
|
||||
- security_context_supplemental_groups
|
||||
type: list
|
||||
spec_service_account:
|
||||
description:
|
||||
- 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. Deprecated:
|
||||
Use serviceAccountName instead.'
|
||||
aliases:
|
||||
- service_account
|
||||
spec_service_account_name:
|
||||
description:
|
||||
- ServiceAccountName is the name of the ServiceAccount to use to run this pod.
|
||||
aliases:
|
||||
- service_account_name
|
||||
spec_subdomain:
|
||||
description:
|
||||
- If specified, the fully qualified Pod hostname will be "<hostname>.<subdomain>.<pod
|
||||
namespace>.svc.<cluster domain>". If not specified, the pod will not have a
|
||||
domainname at all.
|
||||
aliases:
|
||||
- subdomain
|
||||
spec_termination_grace_period_seconds:
|
||||
description:
|
||||
- Optional duration in seconds the pod needs to terminate gracefully. May be decreased
|
||||
in delete request. Value must be non-negative integer. The value zero indicates
|
||||
delete immediately. If this value is nil, the default grace period will be used
|
||||
instead. The grace period is the duration in seconds after the processes running
|
||||
in the pod are sent a termination signal and the time when the processes are
|
||||
forcibly halted with a kill signal. Set this value longer than the expected
|
||||
cleanup time for your process. Defaults to 30 seconds.
|
||||
aliases:
|
||||
- termination_grace_period_seconds
|
||||
type: int
|
||||
spec_tolerations:
|
||||
description:
|
||||
- If specified, the pod's tolerations.
|
||||
aliases:
|
||||
- tolerations
|
||||
type: list
|
||||
spec_volumes:
|
||||
description:
|
||||
- List of volumes that can be mounted by containers belonging to the pod.
|
||||
aliases:
|
||||
- volumes
|
||||
type: list
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
pod:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
spec:
|
||||
description:
|
||||
- Specification of the desired behavior of the pod.
|
||||
type: complex
|
||||
status:
|
||||
description:
|
||||
- Most recently observed status of the pod. This data may not be up to date.
|
||||
Populated by the system. Read-only.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('pod', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,166 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_pod_list
|
||||
short_description: Kubernetes PodList
|
||||
description:
|
||||
- Retrieve a list of pods. List operations provide a snapshot read of the underlying
|
||||
objects, returning a resource_version representing a consistent version of the listed
|
||||
objects.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
pod_list:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
items:
|
||||
description:
|
||||
- List of pods.
|
||||
type: list
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value,
|
||||
and may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
spec:
|
||||
description:
|
||||
- Specification of the desired behavior of the pod.
|
||||
type: complex
|
||||
status:
|
||||
description:
|
||||
- Most recently observed status of the pod. This data may not be up to date.
|
||||
Populated by the system. Read-only.
|
||||
type: complex
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard list metadata.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('pod_list', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,484 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_pod_template
|
||||
short_description: Kubernetes PodTemplate
|
||||
description:
|
||||
- Manage the lifecycle of a pod_template object. Supports check mode, and attempts
|
||||
to to be idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
template_metadata_annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
template_metadata_labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
template_metadata_name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
template_metadata_namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
template_spec_active_deadline_seconds:
|
||||
description:
|
||||
- Optional duration in seconds the pod may be active on the node relative to StartTime
|
||||
before the system will actively try to mark it failed and kill associated containers.
|
||||
Value must be a positive integer.
|
||||
aliases:
|
||||
- active_deadline_seconds
|
||||
type: int
|
||||
template_spec_affinity_node_affinity_preferred_during_scheduling_ignored_during_execution:
|
||||
description:
|
||||
- The scheduler will prefer to schedule pods to nodes that satisfy the affinity
|
||||
expressions specified by this field, but it may choose a node that violates
|
||||
one or more of the expressions. The node that is most preferred is the one with
|
||||
the greatest sum of weights, i.e. for each node that meets all of the scheduling
|
||||
requirements (resource request, requiredDuringScheduling affinity expressions,
|
||||
etc.), compute a sum by iterating through the elements of this field and adding
|
||||
"weight" to the sum if the node matches the corresponding matchExpressions;
|
||||
the node(s) with the highest sum are the most preferred.
|
||||
aliases:
|
||||
- affinity_node_affinity_preferred_during_scheduling_ignored_during_execution
|
||||
type: list
|
||||
template_spec_affinity_node_affinity_required_during_scheduling_ignored_during_execution_node_selector_terms:
|
||||
description:
|
||||
- Required. A list of node selector terms. The terms are ORed.
|
||||
aliases:
|
||||
- affinity_node_affinity_required_during_scheduling_ignored_during_execution_node_selector_terms
|
||||
type: list
|
||||
template_spec_affinity_pod_affinity_preferred_during_scheduling_ignored_during_execution:
|
||||
description:
|
||||
- The scheduler will prefer to schedule pods to nodes that satisfy the affinity
|
||||
expressions specified by this field, but it may choose a node that violates
|
||||
one or more of the expressions. The node that is most preferred is the one with
|
||||
the greatest sum of weights, i.e. for each node that meets all of the scheduling
|
||||
requirements (resource request, requiredDuringScheduling affinity expressions,
|
||||
etc.), compute a sum by iterating through the elements of this field and adding
|
||||
"weight" to the sum if the node has pods which matches the corresponding podAffinityTerm;
|
||||
the node(s) with the highest sum are the most preferred.
|
||||
aliases:
|
||||
- affinity_pod_affinity_preferred_during_scheduling_ignored_during_execution
|
||||
type: list
|
||||
template_spec_affinity_pod_affinity_required_during_scheduling_ignored_during_execution:
|
||||
description:
|
||||
- If the affinity requirements specified by this field are not met at scheduling
|
||||
time, the pod will not be scheduled onto the node. If the affinity requirements
|
||||
specified by this field cease to be met at some point during pod execution (e.g.
|
||||
due to a pod label update), the system may or may not try to eventually evict
|
||||
the pod from its node. When there are multiple elements, the lists of nodes
|
||||
corresponding to each podAffinityTerm are intersected, i.e. all terms must be
|
||||
satisfied.
|
||||
aliases:
|
||||
- affinity_pod_affinity_required_during_scheduling_ignored_during_execution
|
||||
type: list
|
||||
template_spec_affinity_pod_anti_affinity_preferred_during_scheduling_ignored_during_execution:
|
||||
description:
|
||||
- The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity
|
||||
expressions specified by this field, but it may choose a node that violates
|
||||
one or more of the expressions. The node that is most preferred is the one with
|
||||
the greatest sum of weights, i.e. for each node that meets all of the scheduling
|
||||
requirements (resource request, requiredDuringScheduling anti-affinity expressions,
|
||||
etc.), compute a sum by iterating through the elements of this field and adding
|
||||
"weight" to the sum if the node has pods which matches the corresponding podAffinityTerm;
|
||||
the node(s) with the highest sum are the most preferred.
|
||||
aliases:
|
||||
- affinity_pod_anti_affinity_preferred_during_scheduling_ignored_during_execution
|
||||
type: list
|
||||
template_spec_affinity_pod_anti_affinity_required_during_scheduling_ignored_during_execution:
|
||||
description:
|
||||
- If the anti-affinity requirements specified by this field are not met at scheduling
|
||||
time, the pod will not be scheduled onto the node. If the anti-affinity requirements
|
||||
specified by this field cease to be met at some point during pod execution (e.g.
|
||||
due to a pod label update), the system may or may not try to eventually evict
|
||||
the pod from its node. When there are multiple elements, the lists of nodes
|
||||
corresponding to each podAffinityTerm are intersected, i.e. all terms must be
|
||||
satisfied.
|
||||
aliases:
|
||||
- affinity_pod_anti_affinity_required_during_scheduling_ignored_during_execution
|
||||
type: list
|
||||
template_spec_automount_service_account_token:
|
||||
description:
|
||||
- AutomountServiceAccountToken indicates whether a service account token should
|
||||
be automatically mounted.
|
||||
aliases:
|
||||
- automount_service_account_token
|
||||
type: bool
|
||||
template_spec_containers:
|
||||
description:
|
||||
- List of containers belonging to the pod. Containers cannot currently be added
|
||||
or removed. There must be at least one container in a Pod. Cannot be updated.
|
||||
aliases:
|
||||
- containers
|
||||
type: list
|
||||
template_spec_dns_policy:
|
||||
description:
|
||||
- Set DNS policy for containers within the pod. One of 'ClusterFirstWithHostNet',
|
||||
'ClusterFirst' or 'Default'. Defaults to "ClusterFirst". To have DNS options
|
||||
set along with hostNetwork, you have to specify DNS policy explicitly to 'ClusterFirstWithHostNet'.
|
||||
aliases:
|
||||
- dns_policy
|
||||
template_spec_host_aliases:
|
||||
description:
|
||||
- HostAliases is an optional list of hosts and IPs that will be injected into
|
||||
the pod's hosts file if specified. This is only valid for non-hostNetwork pods.
|
||||
aliases:
|
||||
- host_aliases
|
||||
type: list
|
||||
template_spec_host_ipc:
|
||||
description:
|
||||
- "Use the host's ipc namespace. Optional: Default to false."
|
||||
aliases:
|
||||
- host_ipc
|
||||
type: bool
|
||||
template_spec_host_network:
|
||||
description:
|
||||
- Host networking requested for this pod. Use the host's network namespace. If
|
||||
this option is set, the ports that will be used must be specified. Default to
|
||||
false.
|
||||
aliases:
|
||||
- host_network
|
||||
type: bool
|
||||
template_spec_host_pid:
|
||||
description:
|
||||
- "Use the host's pid namespace. Optional: Default to false."
|
||||
aliases:
|
||||
- host_pid
|
||||
type: bool
|
||||
template_spec_hostname:
|
||||
description:
|
||||
- Specifies the hostname of the Pod If not specified, the pod's hostname will
|
||||
be set to a system-defined value.
|
||||
aliases:
|
||||
- hostname
|
||||
template_spec_image_pull_secrets:
|
||||
description:
|
||||
- ImagePullSecrets is an optional list of references to secrets in the same namespace
|
||||
to use for pulling any of the images used by this PodSpec. If specified, these
|
||||
secrets will be passed to individual puller implementations for them to use.
|
||||
For example, in the case of docker, only DockerConfig type secrets are honored.
|
||||
aliases:
|
||||
- image_pull_secrets
|
||||
type: list
|
||||
template_spec_init_containers:
|
||||
description:
|
||||
- List of initialization containers belonging to the pod. Init containers are
|
||||
executed in order prior to containers being started. If any init container fails,
|
||||
the pod is considered to have failed and is handled according to its restartPolicy.
|
||||
The name for an init container or normal container must be unique among all
|
||||
containers. Init containers may not have Lifecycle actions, Readiness probes,
|
||||
or Liveness probes. The resourceRequirements of an init container are taken
|
||||
into account during scheduling by finding the highest request/limit for each
|
||||
resource type, and then using the max of of that value or the sum of the normal
|
||||
containers. Limits are applied to init containers in a similar fashion. Init
|
||||
containers cannot currently be added or removed. Cannot be updated.
|
||||
aliases:
|
||||
- init_containers
|
||||
type: list
|
||||
template_spec_node_name:
|
||||
description:
|
||||
- NodeName is a request to schedule this pod onto a specific node. If it is non-empty,
|
||||
the scheduler simply schedules this pod onto that node, assuming that it fits
|
||||
resource requirements.
|
||||
aliases:
|
||||
- node_name
|
||||
template_spec_node_selector:
|
||||
description:
|
||||
- NodeSelector is a selector which must be true for the pod to fit on a node.
|
||||
Selector which must match a node's labels for the pod to be scheduled on that
|
||||
node.
|
||||
aliases:
|
||||
- node_selector
|
||||
type: dict
|
||||
template_spec_priority:
|
||||
description:
|
||||
- The priority value. Various system components use this field to find the priority
|
||||
of the pod. When Priority Admission Controller is enabled, it prevents users
|
||||
from setting this field. The admission controller populates this field from
|
||||
PriorityClassName. The higher the value, the higher the priority.
|
||||
aliases:
|
||||
- priority
|
||||
type: int
|
||||
template_spec_priority_class_name:
|
||||
description:
|
||||
- If specified, indicates the pod's priority. "SYSTEM" is a special keyword which
|
||||
indicates the highest priority. Any other name must be defined by creating a
|
||||
PriorityClass object with that name. If not specified, the pod priority will
|
||||
be default or zero if there is no default.
|
||||
aliases:
|
||||
- priority_class_name
|
||||
template_spec_restart_policy:
|
||||
description:
|
||||
- Restart policy for all containers within the pod. One of Always, OnFailure,
|
||||
Never. Default to Always.
|
||||
aliases:
|
||||
- restart_policy
|
||||
template_spec_scheduler_name:
|
||||
description:
|
||||
- If specified, the pod will be dispatched by specified scheduler. If not specified,
|
||||
the pod will be dispatched by default scheduler.
|
||||
aliases:
|
||||
- scheduler_name
|
||||
template_spec_security_context_fs_group:
|
||||
description:
|
||||
- "A special supplemental group that applies to all containers in a pod. Some\
|
||||
\ volume types allow the Kubelet to change the ownership of that volume to be\
|
||||
\ owned by the pod: 1. The owning GID will be the FSGroup 2. The setgid bit\
|
||||
\ is set (new files created in the volume will be owned by FSGroup) 3. The permission\
|
||||
\ bits are OR'd with rw-rw---- If unset, the Kubelet will not modify the ownership\
|
||||
\ and permissions of any volume."
|
||||
aliases:
|
||||
- security_context_fs_group
|
||||
type: int
|
||||
template_spec_security_context_run_as_non_root:
|
||||
description:
|
||||
- Indicates that the container must run as a non-root user. If true, the Kubelet
|
||||
will validate the image at runtime to ensure that it does not run as UID 0 (root)
|
||||
and fail to start the container if it does. If unset or false, no such validation
|
||||
will be performed. May also be set in SecurityContext. If set in both SecurityContext
|
||||
and PodSecurityContext, the value specified in SecurityContext takes precedence.
|
||||
aliases:
|
||||
- security_context_run_as_non_root
|
||||
type: bool
|
||||
template_spec_security_context_run_as_user:
|
||||
description:
|
||||
- The UID to run the entrypoint of the container process. Defaults to user specified
|
||||
in image metadata if unspecified. May also be set in SecurityContext. If set
|
||||
in both SecurityContext and PodSecurityContext, the value specified in SecurityContext
|
||||
takes precedence for that container.
|
||||
aliases:
|
||||
- security_context_run_as_user
|
||||
type: int
|
||||
template_spec_security_context_se_linux_options_level:
|
||||
description:
|
||||
- Level is SELinux level label that applies to the container.
|
||||
aliases:
|
||||
- security_context_se_linux_options_level
|
||||
template_spec_security_context_se_linux_options_role:
|
||||
description:
|
||||
- Role is a SELinux role label that applies to the container.
|
||||
aliases:
|
||||
- security_context_se_linux_options_role
|
||||
template_spec_security_context_se_linux_options_type:
|
||||
description:
|
||||
- Type is a SELinux type label that applies to the container.
|
||||
aliases:
|
||||
- security_context_se_linux_options_type
|
||||
template_spec_security_context_se_linux_options_user:
|
||||
description:
|
||||
- User is a SELinux user label that applies to the container.
|
||||
aliases:
|
||||
- security_context_se_linux_options_user
|
||||
template_spec_security_context_supplemental_groups:
|
||||
description:
|
||||
- A list of groups applied to the first process run in each container, in addition
|
||||
to the container's primary GID. If unspecified, no groups will be added to any
|
||||
container.
|
||||
aliases:
|
||||
- security_context_supplemental_groups
|
||||
type: list
|
||||
template_spec_service_account:
|
||||
description:
|
||||
- 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. Deprecated:
|
||||
Use serviceAccountName instead.'
|
||||
aliases:
|
||||
- service_account
|
||||
template_spec_service_account_name:
|
||||
description:
|
||||
- ServiceAccountName is the name of the ServiceAccount to use to run this pod.
|
||||
aliases:
|
||||
- service_account_name
|
||||
template_spec_subdomain:
|
||||
description:
|
||||
- If specified, the fully qualified Pod hostname will be "<hostname>.<subdomain>.<pod
|
||||
namespace>.svc.<cluster domain>". If not specified, the pod will not have a
|
||||
domainname at all.
|
||||
aliases:
|
||||
- subdomain
|
||||
template_spec_termination_grace_period_seconds:
|
||||
description:
|
||||
- Optional duration in seconds the pod needs to terminate gracefully. May be decreased
|
||||
in delete request. Value must be non-negative integer. The value zero indicates
|
||||
delete immediately. If this value is nil, the default grace period will be used
|
||||
instead. The grace period is the duration in seconds after the processes running
|
||||
in the pod are sent a termination signal and the time when the processes are
|
||||
forcibly halted with a kill signal. Set this value longer than the expected
|
||||
cleanup time for your process. Defaults to 30 seconds.
|
||||
aliases:
|
||||
- termination_grace_period_seconds
|
||||
type: int
|
||||
template_spec_tolerations:
|
||||
description:
|
||||
- If specified, the pod's tolerations.
|
||||
aliases:
|
||||
- tolerations
|
||||
type: list
|
||||
template_spec_volumes:
|
||||
description:
|
||||
- List of volumes that can be mounted by containers belonging to the pod.
|
||||
aliases:
|
||||
- volumes
|
||||
type: list
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
pod_template:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
template:
|
||||
description:
|
||||
- Template defines the pods that will be created from this pod template.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('pod_template', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,161 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_pod_template_list
|
||||
short_description: Kubernetes PodTemplateList
|
||||
description:
|
||||
- Retrieve a list of pod_templates. List operations provide a snapshot read of the
|
||||
underlying objects, returning a resource_version representing a consistent version
|
||||
of the listed objects.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
pod_template_list:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
items:
|
||||
description:
|
||||
- List of pod templates
|
||||
type: list
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value,
|
||||
and may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
template:
|
||||
description:
|
||||
- Template defines the pods that will be created from this pod template.
|
||||
type: complex
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard list metadata.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('pod_template_list', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,517 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_replication_controller
|
||||
short_description: Kubernetes ReplicationController
|
||||
description:
|
||||
- Manage the lifecycle of a replication_controller object. Supports check mode, and
|
||||
attempts to to be idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
spec_min_ready_seconds:
|
||||
description:
|
||||
- Minimum number of seconds for which a newly created pod should be ready without
|
||||
any of its container crashing, for it to be considered available. Defaults to
|
||||
0 (pod will be considered available as soon as it is ready)
|
||||
aliases:
|
||||
- min_ready_seconds
|
||||
type: int
|
||||
spec_replicas:
|
||||
description:
|
||||
- Replicas is the number of desired replicas. This is a pointer to distinguish
|
||||
between explicit zero and unspecified. Defaults to 1.
|
||||
aliases:
|
||||
- replicas
|
||||
type: int
|
||||
spec_selector:
|
||||
description:
|
||||
- Selector is a label query over pods that should match the Replicas count. If
|
||||
Selector is empty, it is defaulted to the labels present on the Pod template.
|
||||
Label keys and values that must match in order to be controlled by this replication
|
||||
controller, if empty defaulted to labels on Pod template.
|
||||
aliases:
|
||||
- selector
|
||||
type: dict
|
||||
spec_template_metadata_annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
spec_template_metadata_labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
spec_template_metadata_name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
spec_template_metadata_namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
spec_template_spec_active_deadline_seconds:
|
||||
description:
|
||||
- Optional duration in seconds the pod may be active on the node relative to StartTime
|
||||
before the system will actively try to mark it failed and kill associated containers.
|
||||
Value must be a positive integer.
|
||||
aliases:
|
||||
- active_deadline_seconds
|
||||
type: int
|
||||
spec_template_spec_affinity_node_affinity_preferred_during_scheduling_ignored_during_execution:
|
||||
description:
|
||||
- The scheduler will prefer to schedule pods to nodes that satisfy the affinity
|
||||
expressions specified by this field, but it may choose a node that violates
|
||||
one or more of the expressions. The node that is most preferred is the one with
|
||||
the greatest sum of weights, i.e. for each node that meets all of the scheduling
|
||||
requirements (resource request, requiredDuringScheduling affinity expressions,
|
||||
etc.), compute a sum by iterating through the elements of this field and adding
|
||||
"weight" to the sum if the node matches the corresponding matchExpressions;
|
||||
the node(s) with the highest sum are the most preferred.
|
||||
aliases:
|
||||
- affinity_node_affinity_preferred_during_scheduling_ignored_during_execution
|
||||
type: list
|
||||
spec_template_spec_affinity_node_affinity_required_during_scheduling_ignored_during_execution_node_selector_terms:
|
||||
description:
|
||||
- Required. A list of node selector terms. The terms are ORed.
|
||||
aliases:
|
||||
- affinity_node_affinity_required_during_scheduling_ignored_during_execution_node_selector_terms
|
||||
type: list
|
||||
spec_template_spec_affinity_pod_affinity_preferred_during_scheduling_ignored_during_execution:
|
||||
description:
|
||||
- The scheduler will prefer to schedule pods to nodes that satisfy the affinity
|
||||
expressions specified by this field, but it may choose a node that violates
|
||||
one or more of the expressions. The node that is most preferred is the one with
|
||||
the greatest sum of weights, i.e. for each node that meets all of the scheduling
|
||||
requirements (resource request, requiredDuringScheduling affinity expressions,
|
||||
etc.), compute a sum by iterating through the elements of this field and adding
|
||||
"weight" to the sum if the node has pods which matches the corresponding podAffinityTerm;
|
||||
the node(s) with the highest sum are the most preferred.
|
||||
aliases:
|
||||
- affinity_pod_affinity_preferred_during_scheduling_ignored_during_execution
|
||||
type: list
|
||||
spec_template_spec_affinity_pod_affinity_required_during_scheduling_ignored_during_execution:
|
||||
description:
|
||||
- If the affinity requirements specified by this field are not met at scheduling
|
||||
time, the pod will not be scheduled onto the node. If the affinity requirements
|
||||
specified by this field cease to be met at some point during pod execution (e.g.
|
||||
due to a pod label update), the system may or may not try to eventually evict
|
||||
the pod from its node. When there are multiple elements, the lists of nodes
|
||||
corresponding to each podAffinityTerm are intersected, i.e. all terms must be
|
||||
satisfied.
|
||||
aliases:
|
||||
- affinity_pod_affinity_required_during_scheduling_ignored_during_execution
|
||||
type: list
|
||||
spec_template_spec_affinity_pod_anti_affinity_preferred_during_scheduling_ignored_during_execution:
|
||||
description:
|
||||
- The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity
|
||||
expressions specified by this field, but it may choose a node that violates
|
||||
one or more of the expressions. The node that is most preferred is the one with
|
||||
the greatest sum of weights, i.e. for each node that meets all of the scheduling
|
||||
requirements (resource request, requiredDuringScheduling anti-affinity expressions,
|
||||
etc.), compute a sum by iterating through the elements of this field and adding
|
||||
"weight" to the sum if the node has pods which matches the corresponding podAffinityTerm;
|
||||
the node(s) with the highest sum are the most preferred.
|
||||
aliases:
|
||||
- affinity_pod_anti_affinity_preferred_during_scheduling_ignored_during_execution
|
||||
type: list
|
||||
spec_template_spec_affinity_pod_anti_affinity_required_during_scheduling_ignored_during_execution:
|
||||
description:
|
||||
- If the anti-affinity requirements specified by this field are not met at scheduling
|
||||
time, the pod will not be scheduled onto the node. If the anti-affinity requirements
|
||||
specified by this field cease to be met at some point during pod execution (e.g.
|
||||
due to a pod label update), the system may or may not try to eventually evict
|
||||
the pod from its node. When there are multiple elements, the lists of nodes
|
||||
corresponding to each podAffinityTerm are intersected, i.e. all terms must be
|
||||
satisfied.
|
||||
aliases:
|
||||
- affinity_pod_anti_affinity_required_during_scheduling_ignored_during_execution
|
||||
type: list
|
||||
spec_template_spec_automount_service_account_token:
|
||||
description:
|
||||
- AutomountServiceAccountToken indicates whether a service account token should
|
||||
be automatically mounted.
|
||||
aliases:
|
||||
- automount_service_account_token
|
||||
type: bool
|
||||
spec_template_spec_containers:
|
||||
description:
|
||||
- List of containers belonging to the pod. Containers cannot currently be added
|
||||
or removed. There must be at least one container in a Pod. Cannot be updated.
|
||||
aliases:
|
||||
- containers
|
||||
type: list
|
||||
spec_template_spec_dns_policy:
|
||||
description:
|
||||
- Set DNS policy for containers within the pod. One of 'ClusterFirstWithHostNet',
|
||||
'ClusterFirst' or 'Default'. Defaults to "ClusterFirst". To have DNS options
|
||||
set along with hostNetwork, you have to specify DNS policy explicitly to 'ClusterFirstWithHostNet'.
|
||||
aliases:
|
||||
- dns_policy
|
||||
spec_template_spec_host_aliases:
|
||||
description:
|
||||
- HostAliases is an optional list of hosts and IPs that will be injected into
|
||||
the pod's hosts file if specified. This is only valid for non-hostNetwork pods.
|
||||
aliases:
|
||||
- host_aliases
|
||||
type: list
|
||||
spec_template_spec_host_ipc:
|
||||
description:
|
||||
- "Use the host's ipc namespace. Optional: Default to false."
|
||||
aliases:
|
||||
- host_ipc
|
||||
type: bool
|
||||
spec_template_spec_host_network:
|
||||
description:
|
||||
- Host networking requested for this pod. Use the host's network namespace. If
|
||||
this option is set, the ports that will be used must be specified. Default to
|
||||
false.
|
||||
aliases:
|
||||
- host_network
|
||||
type: bool
|
||||
spec_template_spec_host_pid:
|
||||
description:
|
||||
- "Use the host's pid namespace. Optional: Default to false."
|
||||
aliases:
|
||||
- host_pid
|
||||
type: bool
|
||||
spec_template_spec_hostname:
|
||||
description:
|
||||
- Specifies the hostname of the Pod If not specified, the pod's hostname will
|
||||
be set to a system-defined value.
|
||||
aliases:
|
||||
- hostname
|
||||
spec_template_spec_image_pull_secrets:
|
||||
description:
|
||||
- ImagePullSecrets is an optional list of references to secrets in the same namespace
|
||||
to use for pulling any of the images used by this PodSpec. If specified, these
|
||||
secrets will be passed to individual puller implementations for them to use.
|
||||
For example, in the case of docker, only DockerConfig type secrets are honored.
|
||||
aliases:
|
||||
- image_pull_secrets
|
||||
type: list
|
||||
spec_template_spec_init_containers:
|
||||
description:
|
||||
- List of initialization containers belonging to the pod. Init containers are
|
||||
executed in order prior to containers being started. If any init container fails,
|
||||
the pod is considered to have failed and is handled according to its restartPolicy.
|
||||
The name for an init container or normal container must be unique among all
|
||||
containers. Init containers may not have Lifecycle actions, Readiness probes,
|
||||
or Liveness probes. The resourceRequirements of an init container are taken
|
||||
into account during scheduling by finding the highest request/limit for each
|
||||
resource type, and then using the max of of that value or the sum of the normal
|
||||
containers. Limits are applied to init containers in a similar fashion. Init
|
||||
containers cannot currently be added or removed. Cannot be updated.
|
||||
aliases:
|
||||
- init_containers
|
||||
type: list
|
||||
spec_template_spec_node_name:
|
||||
description:
|
||||
- NodeName is a request to schedule this pod onto a specific node. If it is non-empty,
|
||||
the scheduler simply schedules this pod onto that node, assuming that it fits
|
||||
resource requirements.
|
||||
aliases:
|
||||
- node_name
|
||||
spec_template_spec_node_selector:
|
||||
description:
|
||||
- NodeSelector is a selector which must be true for the pod to fit on a node.
|
||||
Selector which must match a node's labels for the pod to be scheduled on that
|
||||
node.
|
||||
aliases:
|
||||
- node_selector
|
||||
type: dict
|
||||
spec_template_spec_priority:
|
||||
description:
|
||||
- The priority value. Various system components use this field to find the priority
|
||||
of the pod. When Priority Admission Controller is enabled, it prevents users
|
||||
from setting this field. The admission controller populates this field from
|
||||
PriorityClassName. The higher the value, the higher the priority.
|
||||
aliases:
|
||||
- priority
|
||||
type: int
|
||||
spec_template_spec_priority_class_name:
|
||||
description:
|
||||
- If specified, indicates the pod's priority. "SYSTEM" is a special keyword which
|
||||
indicates the highest priority. Any other name must be defined by creating a
|
||||
PriorityClass object with that name. If not specified, the pod priority will
|
||||
be default or zero if there is no default.
|
||||
aliases:
|
||||
- priority_class_name
|
||||
spec_template_spec_restart_policy:
|
||||
description:
|
||||
- Restart policy for all containers within the pod. One of Always, OnFailure,
|
||||
Never. Default to Always.
|
||||
aliases:
|
||||
- restart_policy
|
||||
spec_template_spec_scheduler_name:
|
||||
description:
|
||||
- If specified, the pod will be dispatched by specified scheduler. If not specified,
|
||||
the pod will be dispatched by default scheduler.
|
||||
aliases:
|
||||
- scheduler_name
|
||||
spec_template_spec_security_context_fs_group:
|
||||
description:
|
||||
- "A special supplemental group that applies to all containers in a pod. Some\
|
||||
\ volume types allow the Kubelet to change the ownership of that volume to be\
|
||||
\ owned by the pod: 1. The owning GID will be the FSGroup 2. The setgid bit\
|
||||
\ is set (new files created in the volume will be owned by FSGroup) 3. The permission\
|
||||
\ bits are OR'd with rw-rw---- If unset, the Kubelet will not modify the ownership\
|
||||
\ and permissions of any volume."
|
||||
aliases:
|
||||
- security_context_fs_group
|
||||
type: int
|
||||
spec_template_spec_security_context_run_as_non_root:
|
||||
description:
|
||||
- Indicates that the container must run as a non-root user. If true, the Kubelet
|
||||
will validate the image at runtime to ensure that it does not run as UID 0 (root)
|
||||
and fail to start the container if it does. If unset or false, no such validation
|
||||
will be performed. May also be set in SecurityContext. If set in both SecurityContext
|
||||
and PodSecurityContext, the value specified in SecurityContext takes precedence.
|
||||
aliases:
|
||||
- security_context_run_as_non_root
|
||||
type: bool
|
||||
spec_template_spec_security_context_run_as_user:
|
||||
description:
|
||||
- The UID to run the entrypoint of the container process. Defaults to user specified
|
||||
in image metadata if unspecified. May also be set in SecurityContext. If set
|
||||
in both SecurityContext and PodSecurityContext, the value specified in SecurityContext
|
||||
takes precedence for that container.
|
||||
aliases:
|
||||
- security_context_run_as_user
|
||||
type: int
|
||||
spec_template_spec_security_context_se_linux_options_level:
|
||||
description:
|
||||
- Level is SELinux level label that applies to the container.
|
||||
aliases:
|
||||
- security_context_se_linux_options_level
|
||||
spec_template_spec_security_context_se_linux_options_role:
|
||||
description:
|
||||
- Role is a SELinux role label that applies to the container.
|
||||
aliases:
|
||||
- security_context_se_linux_options_role
|
||||
spec_template_spec_security_context_se_linux_options_type:
|
||||
description:
|
||||
- Type is a SELinux type label that applies to the container.
|
||||
aliases:
|
||||
- security_context_se_linux_options_type
|
||||
spec_template_spec_security_context_se_linux_options_user:
|
||||
description:
|
||||
- User is a SELinux user label that applies to the container.
|
||||
aliases:
|
||||
- security_context_se_linux_options_user
|
||||
spec_template_spec_security_context_supplemental_groups:
|
||||
description:
|
||||
- A list of groups applied to the first process run in each container, in addition
|
||||
to the container's primary GID. If unspecified, no groups will be added to any
|
||||
container.
|
||||
aliases:
|
||||
- security_context_supplemental_groups
|
||||
type: list
|
||||
spec_template_spec_service_account:
|
||||
description:
|
||||
- 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. Deprecated:
|
||||
Use serviceAccountName instead.'
|
||||
aliases:
|
||||
- service_account
|
||||
spec_template_spec_service_account_name:
|
||||
description:
|
||||
- ServiceAccountName is the name of the ServiceAccount to use to run this pod.
|
||||
aliases:
|
||||
- service_account_name
|
||||
spec_template_spec_subdomain:
|
||||
description:
|
||||
- If specified, the fully qualified Pod hostname will be "<hostname>.<subdomain>.<pod
|
||||
namespace>.svc.<cluster domain>". If not specified, the pod will not have a
|
||||
domainname at all.
|
||||
aliases:
|
||||
- subdomain
|
||||
spec_template_spec_termination_grace_period_seconds:
|
||||
description:
|
||||
- Optional duration in seconds the pod needs to terminate gracefully. May be decreased
|
||||
in delete request. Value must be non-negative integer. The value zero indicates
|
||||
delete immediately. If this value is nil, the default grace period will be used
|
||||
instead. The grace period is the duration in seconds after the processes running
|
||||
in the pod are sent a termination signal and the time when the processes are
|
||||
forcibly halted with a kill signal. Set this value longer than the expected
|
||||
cleanup time for your process. Defaults to 30 seconds.
|
||||
aliases:
|
||||
- termination_grace_period_seconds
|
||||
type: int
|
||||
spec_template_spec_tolerations:
|
||||
description:
|
||||
- If specified, the pod's tolerations.
|
||||
aliases:
|
||||
- tolerations
|
||||
type: list
|
||||
spec_template_spec_volumes:
|
||||
description:
|
||||
- List of volumes that can be mounted by containers belonging to the pod.
|
||||
aliases:
|
||||
- volumes
|
||||
type: list
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
replication_controller:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- If the Labels of a ReplicationController are empty, they are defaulted to
|
||||
be the same as the Pod(s) that the replication controller manages. Standard
|
||||
object's metadata.
|
||||
type: complex
|
||||
spec:
|
||||
description:
|
||||
- Spec defines the specification of the desired behavior of the replication
|
||||
controller.
|
||||
type: complex
|
||||
status:
|
||||
description:
|
||||
- Status is the most recently observed status of the replication controller.
|
||||
This data may be out of date by some window of time. Populated by the system.
|
||||
Read-only.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('replication_controller', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,170 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_replication_controller_list
|
||||
short_description: Kubernetes ReplicationControllerList
|
||||
description:
|
||||
- Retrieve a list of replication_controllers. List operations provide a snapshot read
|
||||
of the underlying objects, returning a resource_version representing a consistent
|
||||
version of the listed objects.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
replication_controller_list:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
items:
|
||||
description:
|
||||
- List of replication controllers.
|
||||
type: list
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value,
|
||||
and may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- If the Labels of a ReplicationController are empty, they are defaulted
|
||||
to be the same as the Pod(s) that the replication controller manages.
|
||||
Standard object's metadata.
|
||||
type: complex
|
||||
spec:
|
||||
description:
|
||||
- Spec defines the specification of the desired behavior of the replication
|
||||
controller.
|
||||
type: complex
|
||||
status:
|
||||
description:
|
||||
- Status is the most recently observed status of the replication controller.
|
||||
This data may be out of date by some window of time. Populated by the
|
||||
system. Read-only.
|
||||
type: complex
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard list metadata.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('replication_controller_list', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,179 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_resource_quota
|
||||
short_description: Kubernetes ResourceQuota
|
||||
description:
|
||||
- Manage the lifecycle of a resource_quota object. Supports check mode, and attempts
|
||||
to to be idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
spec_hard:
|
||||
description:
|
||||
- Hard is the set of desired hard limits for each named resource.
|
||||
aliases:
|
||||
- hard
|
||||
type: dict
|
||||
spec_scopes:
|
||||
description:
|
||||
- A collection of filters that must match each object tracked by a quota. If not
|
||||
specified, the quota matches all objects.
|
||||
aliases:
|
||||
- scopes
|
||||
type: list
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
resource_quota:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
spec:
|
||||
description:
|
||||
- Spec defines the desired quota.
|
||||
type: complex
|
||||
status:
|
||||
description:
|
||||
- Status defines the actual enforced quota and its current usage.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('resource_quota', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,165 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_resource_quota_list
|
||||
short_description: Kubernetes ResourceQuotaList
|
||||
description:
|
||||
- Retrieve a list of resource_quotas. List operations provide a snapshot read of the
|
||||
underlying objects, returning a resource_version representing a consistent version
|
||||
of the listed objects.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
resource_quota_list:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
items:
|
||||
description:
|
||||
- Items is a list of ResourceQuota objects.
|
||||
type: list
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value,
|
||||
and may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
spec:
|
||||
description:
|
||||
- Spec defines the desired quota.
|
||||
type: complex
|
||||
status:
|
||||
description:
|
||||
- Status defines the actual enforced quota and its current usage.
|
||||
type: complex
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard list metadata.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('resource_quota_list', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,202 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_role
|
||||
short_description: Kubernetes Role
|
||||
description:
|
||||
- Manage the lifecycle of a role object. Supports check mode, and attempts to to be
|
||||
idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
rules:
|
||||
description:
|
||||
- Rules holds all the PolicyRules for this Role
|
||||
type: list
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
role:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
rules:
|
||||
description:
|
||||
- Rules holds all the PolicyRules for this Role
|
||||
type: list
|
||||
contains:
|
||||
api_groups:
|
||||
description:
|
||||
- APIGroups is the name of the APIGroup that contains the resources. If
|
||||
multiple API groups are specified, any action requested against one of
|
||||
the enumerated resources in any API group will be allowed.
|
||||
type: list
|
||||
contains: str
|
||||
non_resource_ur_ls:
|
||||
description:
|
||||
- NonResourceURLs is a set of partial urls that a user should have access
|
||||
to. *s are allowed, but only as the full, final step in the path Since
|
||||
non-resource URLs are not namespaced, this field is only applicable for
|
||||
ClusterRoles referenced from a ClusterRoleBinding. Rules can either apply
|
||||
to API resources (such as "pods" or "secrets") or non-resource URL paths
|
||||
(such as "/api"), but not both.
|
||||
type: list
|
||||
contains: str
|
||||
resource_names:
|
||||
description:
|
||||
- ResourceNames is an optional white list of names that the rule applies
|
||||
to. An empty set means that everything is allowed.
|
||||
type: list
|
||||
contains: str
|
||||
resources:
|
||||
description:
|
||||
- Resources is a list of resources this rule applies to. ResourceAll represents
|
||||
all resources.
|
||||
type: list
|
||||
contains: str
|
||||
verbs:
|
||||
description:
|
||||
- Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions
|
||||
contained in this rule. VerbAll represents all kinds.
|
||||
type: list
|
||||
contains: str
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('role', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,208 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_role_binding
|
||||
short_description: Kubernetes RoleBinding
|
||||
description:
|
||||
- Manage the lifecycle of a role_binding object. Supports check mode, and attempts
|
||||
to to be idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
role_ref_api_group:
|
||||
description:
|
||||
- APIGroup is the group for the resource being referenced
|
||||
aliases:
|
||||
- api_group
|
||||
role_ref_kind:
|
||||
description:
|
||||
- Kind is the type of resource being referenced
|
||||
aliases:
|
||||
- kind
|
||||
role_ref_name:
|
||||
description:
|
||||
- Name is the name of resource being referenced
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
subjects:
|
||||
description:
|
||||
- Subjects holds references to the objects the role applies to.
|
||||
type: list
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
role_binding:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
role_ref:
|
||||
description:
|
||||
- RoleRef can reference a Role in the current namespace or a ClusterRole in
|
||||
the global namespace. If the RoleRef cannot be resolved, the Authorizer must
|
||||
return an error.
|
||||
type: complex
|
||||
subjects:
|
||||
description:
|
||||
- Subjects holds references to the objects the role applies to.
|
||||
type: list
|
||||
contains:
|
||||
api_group:
|
||||
description:
|
||||
- APIGroup holds the API group of the referenced subject. Defaults to ""
|
||||
for ServiceAccount subjects. Defaults to "rbac.authorization.k8s.io" for
|
||||
User and Group subjects.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind of object being referenced. Values defined by this API group are
|
||||
"User", "Group", and "ServiceAccount". If the Authorizer does not recognized
|
||||
the kind value, the Authorizer should report an error.
|
||||
type: str
|
||||
name:
|
||||
description:
|
||||
- Name of the object being referenced.
|
||||
type: str
|
||||
namespace:
|
||||
description:
|
||||
- Namespace of the referenced object. If the object kind is non-namespace,
|
||||
such as "User" or "Group", and this value is not empty the Authorizer
|
||||
should report an error.
|
||||
type: str
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('role_binding', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,190 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_role_binding_list
|
||||
short_description: Kubernetes RoleBindingList
|
||||
description:
|
||||
- Retrieve a list of role_bindings. List operations provide a snapshot read of the
|
||||
underlying objects, returning a resource_version representing a consistent version
|
||||
of the listed objects.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
role_binding_list:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
items:
|
||||
description:
|
||||
- Items is a list of RoleBindings
|
||||
type: list
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value,
|
||||
and may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
role_ref:
|
||||
description:
|
||||
- RoleRef can reference a Role in the current namespace or a ClusterRole
|
||||
in the global namespace. If the RoleRef cannot be resolved, the Authorizer
|
||||
must return an error.
|
||||
type: complex
|
||||
subjects:
|
||||
description:
|
||||
- Subjects holds references to the objects the role applies to.
|
||||
type: list
|
||||
contains:
|
||||
api_group:
|
||||
description:
|
||||
- APIGroup holds the API group of the referenced subject. Defaults to
|
||||
"" for ServiceAccount subjects. Defaults to "rbac.authorization.k8s.io"
|
||||
for User and Group subjects.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind of object being referenced. Values defined by this API group
|
||||
are "User", "Group", and "ServiceAccount". If the Authorizer does
|
||||
not recognized the kind value, the Authorizer should report an error.
|
||||
type: str
|
||||
name:
|
||||
description:
|
||||
- Name of the object being referenced.
|
||||
type: str
|
||||
namespace:
|
||||
description:
|
||||
- Namespace of the referenced object. If the object kind is non-namespace,
|
||||
such as "User" or "Group", and this value is not empty the Authorizer
|
||||
should report an error.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('role_binding_list', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,197 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_role_list
|
||||
short_description: Kubernetes RoleList
|
||||
description:
|
||||
- Retrieve a list of roles. List operations provide a snapshot read of the underlying
|
||||
objects, returning a resource_version representing a consistent version of the listed
|
||||
objects.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
role_list:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
items:
|
||||
description:
|
||||
- Items is a list of Roles
|
||||
type: list
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value,
|
||||
and may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
rules:
|
||||
description:
|
||||
- Rules holds all the PolicyRules for this Role
|
||||
type: list
|
||||
contains:
|
||||
api_groups:
|
||||
description:
|
||||
- APIGroups is the name of the APIGroup that contains the resources.
|
||||
If multiple API groups are specified, any action requested against
|
||||
one of the enumerated resources in any API group will be allowed.
|
||||
type: list
|
||||
contains: str
|
||||
non_resource_ur_ls:
|
||||
description:
|
||||
- NonResourceURLs is a set of partial urls that a user should have access
|
||||
to. *s are allowed, but only as the full, final step in the path Since
|
||||
non-resource URLs are not namespaced, this field is only applicable
|
||||
for ClusterRoles referenced from a ClusterRoleBinding. Rules can either
|
||||
apply to API resources (such as "pods" or "secrets") or non-resource
|
||||
URL paths (such as "/api"), but not both.
|
||||
type: list
|
||||
contains: str
|
||||
resource_names:
|
||||
description:
|
||||
- ResourceNames is an optional white list of names that the rule applies
|
||||
to. An empty set means that everything is allowed.
|
||||
type: list
|
||||
contains: str
|
||||
resources:
|
||||
description:
|
||||
- Resources is a list of resources this rule applies to. ResourceAll
|
||||
represents all resources.
|
||||
type: list
|
||||
contains: str
|
||||
verbs:
|
||||
description:
|
||||
- Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions
|
||||
contained in this rule. VerbAll represents all kinds.
|
||||
type: list
|
||||
contains: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('role_list', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,148 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_scale
|
||||
short_description: Kubernetes Scale
|
||||
description:
|
||||
- Manage the lifecycle of a scale object. Supports check mode, and attempts to to
|
||||
be idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
spec_replicas:
|
||||
description:
|
||||
- desired number of instances for the scaled object.
|
||||
aliases:
|
||||
- replicas
|
||||
type: int
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
scale:
|
||||
type: complex
|
||||
returned: on success
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object metadata;
|
||||
type: complex
|
||||
spec:
|
||||
description:
|
||||
- defines the behavior of the scale.
|
||||
type: complex
|
||||
status:
|
||||
description:
|
||||
- current status of the scale.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('scale', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,195 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_secret
|
||||
short_description: Kubernetes Secret
|
||||
description:
|
||||
- Manage the lifecycle of a secret object. Supports check mode, and attempts to to
|
||||
be idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
data:
|
||||
description:
|
||||
- Data contains the secret data. Each key must consist of alphanumeric characters,
|
||||
'-', '_' or '.'. The serialized form of the secret data is a base64 encoded
|
||||
string, representing the arbitrary (possibly non-string) data value here. Described
|
||||
in
|
||||
type: dict
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
string_data:
|
||||
description:
|
||||
- stringData allows specifying non-binary secret data in string form. It is provided
|
||||
as a write-only convenience method. All keys and values are merged into the
|
||||
data field on write, overwriting any existing values. It is never output when
|
||||
reading from the API.
|
||||
type: dict
|
||||
type:
|
||||
description:
|
||||
- Used to facilitate programmatic handling of secret data.
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
secret:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
data:
|
||||
description:
|
||||
- Data contains the secret data. Each key must consist of alphanumeric characters,
|
||||
'-', '_' or '.'. The serialized form of the secret data is a base64 encoded
|
||||
string, representing the arbitrary (possibly non-string) data value here.
|
||||
Described in
|
||||
type: complex
|
||||
contains: str, str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
string_data:
|
||||
description:
|
||||
- stringData allows specifying non-binary secret data in string form. It is
|
||||
provided as a write-only convenience method. All keys and values are merged
|
||||
into the data field on write, overwriting any existing values. It is never
|
||||
output when reading from the API.
|
||||
type: complex
|
||||
contains: str, str
|
||||
type:
|
||||
description:
|
||||
- Used to facilitate programmatic handling of secret data.
|
||||
type: str
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('secret', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,177 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_secret_list
|
||||
short_description: Kubernetes SecretList
|
||||
description:
|
||||
- Retrieve a list of secrets. List operations provide a snapshot read of the underlying
|
||||
objects, returning a resource_version representing a consistent version of the listed
|
||||
objects.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
secret_list:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
items:
|
||||
description:
|
||||
- Items is a list of secret objects.
|
||||
type: list
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value,
|
||||
and may reject unrecognized values.
|
||||
type: str
|
||||
data:
|
||||
description:
|
||||
- Data contains the secret data. Each key must consist of alphanumeric characters,
|
||||
'-', '_' or '.'. The serialized form of the secret data is a base64 encoded
|
||||
string, representing the arbitrary (possibly non-string) data value here.
|
||||
Described in
|
||||
type: complex
|
||||
contains: str, str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
string_data:
|
||||
description:
|
||||
- stringData allows specifying non-binary secret data in string form. It
|
||||
is provided as a write-only convenience method. All keys and values are
|
||||
merged into the data field on write, overwriting any existing values.
|
||||
It is never output when reading from the API.
|
||||
type: complex
|
||||
contains: str, str
|
||||
type:
|
||||
description:
|
||||
- Used to facilitate programmatic handling of secret data.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard list metadata.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('secret_list', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,194 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_self_subject_access_review
|
||||
short_description: Kubernetes SelfSubjectAccessReview
|
||||
description:
|
||||
- Manage the lifecycle of a self_subject_access_review object. Supports check mode,
|
||||
and attempts to to be idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
spec_non_resource_attributes_path:
|
||||
description:
|
||||
- Path is the URL path of the request
|
||||
aliases:
|
||||
- non_resource_attributes_path
|
||||
spec_non_resource_attributes_verb:
|
||||
description:
|
||||
- Verb is the standard HTTP verb
|
||||
aliases:
|
||||
- non_resource_attributes_verb
|
||||
spec_resource_attributes_group:
|
||||
description:
|
||||
- Group is the API Group of the Resource. "*" means all.
|
||||
aliases:
|
||||
- resource_attributes_group
|
||||
spec_resource_attributes_name:
|
||||
description:
|
||||
- Name is the name of the resource being requested for a "get" or deleted for
|
||||
a "delete". "" (empty) means all.
|
||||
aliases:
|
||||
- resource_attributes_name
|
||||
spec_resource_attributes_namespace:
|
||||
description:
|
||||
- Namespace is the namespace of the action being requested. Currently, there is
|
||||
no distinction between no namespace and all namespaces "" (empty) is defaulted
|
||||
for LocalSubjectAccessReviews "" (empty) is empty for cluster-scoped resources
|
||||
"" (empty) means "all" for namespace scoped resources from a SubjectAccessReview
|
||||
or SelfSubjectAccessReview
|
||||
aliases:
|
||||
- resource_attributes_namespace
|
||||
spec_resource_attributes_resource:
|
||||
description:
|
||||
- Resource is one of the existing resource types. "*" means all.
|
||||
aliases:
|
||||
- resource_attributes_resource
|
||||
spec_resource_attributes_subresource:
|
||||
description:
|
||||
- Subresource is one of the existing resource types. "" means none.
|
||||
aliases:
|
||||
- resource_attributes_subresource
|
||||
spec_resource_attributes_verb:
|
||||
description:
|
||||
- 'Verb is a kubernetes resource API verb, like: get, list, watch, create, update,
|
||||
delete, proxy. "*" means all.'
|
||||
aliases:
|
||||
- resource_attributes_verb
|
||||
spec_resource_attributes_version:
|
||||
description:
|
||||
- Version is the API Version of the Resource. "*" means all.
|
||||
aliases:
|
||||
- resource_attributes_version
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
self_subject_access_review:
|
||||
type: complex
|
||||
returned: on success
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description: []
|
||||
type: complex
|
||||
spec:
|
||||
description:
|
||||
- Spec holds information about the request being evaluated. user and groups
|
||||
must be empty
|
||||
type: complex
|
||||
status:
|
||||
description:
|
||||
- Status is filled in by the server and indicates whether the request is allowed
|
||||
or not
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('self_subject_access_review', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,145 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_self_subject_rules_review
|
||||
short_description: Kubernetes SelfSubjectRulesReview
|
||||
description:
|
||||
- Manage the lifecycle of a self_subject_rules_review object. Supports check mode,
|
||||
and attempts to to be idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
spec_namespace:
|
||||
description:
|
||||
- Namespace to evaluate rules for. Required.
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
self_subject_rules_review:
|
||||
type: complex
|
||||
returned: on success
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description: []
|
||||
type: complex
|
||||
spec:
|
||||
description:
|
||||
- Spec holds information about the request being evaluated.
|
||||
type: complex
|
||||
status:
|
||||
description:
|
||||
- Status is filled in by the server and indicates the set of actions a user
|
||||
can perform.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('self_subject_rules_review', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,360 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_service
|
||||
short_description: Kubernetes Service
|
||||
description:
|
||||
- Manage the lifecycle of a service object. Supports check mode, and attempts to to
|
||||
be idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
spec_cluster_ip:
|
||||
description:
|
||||
- clusterIP is the IP address of the service and is usually assigned randomly
|
||||
by the master. If an address is specified manually and is not in use by others,
|
||||
it will be allocated to the service; otherwise, creation of the service will
|
||||
fail. This field can not be changed through updates. Valid values are "None",
|
||||
empty string (""), or a valid IP address. "None" can be specified for headless
|
||||
services when proxying is not required. Only applies to types ClusterIP, NodePort,
|
||||
and LoadBalancer. Ignored if type is ExternalName.
|
||||
aliases:
|
||||
- cluster_ip
|
||||
spec_external_i_ps:
|
||||
description:
|
||||
- externalIPs is a list of IP addresses for which nodes in the cluster will also
|
||||
accept traffic for this service. These IPs are not managed by Kubernetes. The
|
||||
user is responsible for ensuring that traffic arrives at a node with this IP.
|
||||
A common example is external load-balancers that are not part of the Kubernetes
|
||||
system.
|
||||
aliases:
|
||||
- external_i_ps
|
||||
type: list
|
||||
spec_external_name:
|
||||
description:
|
||||
- externalName is the external reference that kubedns or equivalent will return
|
||||
as a CNAME record for this service. No proxying will be involved. Must be a
|
||||
valid DNS name and requires Type to be ExternalName.
|
||||
aliases:
|
||||
- external_name
|
||||
spec_external_traffic_policy:
|
||||
description:
|
||||
- externalTrafficPolicy denotes if this Service desires to route external traffic
|
||||
to node-local or cluster-wide endpoints. "Local" preserves the client source
|
||||
IP and avoids a second hop for LoadBalancer and Nodeport type services, but
|
||||
risks potentially imbalanced traffic spreading. "Cluster" obscures the client
|
||||
source IP and may cause a second hop to another node, but should have good overall
|
||||
load-spreading.
|
||||
aliases:
|
||||
- external_traffic_policy
|
||||
spec_health_check_node_port:
|
||||
description:
|
||||
- healthCheckNodePort specifies the healthcheck nodePort for the service. If not
|
||||
specified, HealthCheckNodePort is created by the service api backend with the
|
||||
allocated nodePort. Will use user-specified nodePort value if specified by the
|
||||
client. Only effects when Type is set to LoadBalancer and ExternalTrafficPolicy
|
||||
is set to Local.
|
||||
aliases:
|
||||
- health_check_node_port
|
||||
type: int
|
||||
spec_load_balancer_ip:
|
||||
description:
|
||||
- 'Only applies to Service Type: LoadBalancer LoadBalancer will get created with
|
||||
the IP specified in this field. This feature depends on whether the underlying
|
||||
cloud-provider supports specifying the loadBalancerIP when a load balancer is
|
||||
created. This field will be ignored if the cloud-provider does not support the
|
||||
feature.'
|
||||
aliases:
|
||||
- load_balancer_ip
|
||||
spec_load_balancer_source_ranges:
|
||||
description:
|
||||
- If specified and supported by the platform, this will restrict traffic through
|
||||
the cloud-provider load-balancer will be restricted to the specified client
|
||||
IPs. This field will be ignored if the cloud-provider does not support the feature."
|
||||
aliases:
|
||||
- load_balancer_source_ranges
|
||||
type: list
|
||||
spec_ports:
|
||||
description:
|
||||
- The list of ports that are exposed by this service.
|
||||
aliases:
|
||||
- ports
|
||||
type: list
|
||||
spec_publish_not_ready_addresses:
|
||||
description:
|
||||
- publishNotReadyAddresses, when set to true, indicates that DNS implementations
|
||||
must publish the notReadyAddresses of subsets for the Endpoints associated with
|
||||
the Service. The default value is false. The primary use case for setting this
|
||||
field is to use a StatefulSet's Headless Service to propagate SRV records for
|
||||
its Pods without respect to their readiness for purpose of peer discovery. This
|
||||
field will replace the service.alpha.kubernetes.io/tolerate-unready-endpoints
|
||||
when that annotation is deprecated and all clients have been converted to use
|
||||
this field.
|
||||
aliases:
|
||||
- publish_not_ready_addresses
|
||||
type: bool
|
||||
spec_selector:
|
||||
description:
|
||||
- Route service traffic to pods with label keys and values matching this selector.
|
||||
If empty or not present, the service is assumed to have an external process
|
||||
managing its endpoints, which Kubernetes will not modify. Only applies to types
|
||||
ClusterIP, NodePort, and LoadBalancer. Ignored if type is ExternalName.
|
||||
aliases:
|
||||
- selector
|
||||
type: dict
|
||||
spec_session_affinity:
|
||||
description:
|
||||
- Supports "ClientIP" and "None". Used to maintain session affinity. Enable client
|
||||
IP based session affinity. Must be ClientIP or None. Defaults to None.
|
||||
aliases:
|
||||
- session_affinity
|
||||
spec_session_affinity_config_client_ip_timeout_seconds:
|
||||
description:
|
||||
- timeoutSeconds specifies the seconds of ClientIP type session sticky time. The
|
||||
value must be >0 && <=86400(for 1 day) if ServiceAffinity == "ClientIP". Default
|
||||
value is 10800(for 3 hours).
|
||||
aliases:
|
||||
- session_affinity__clientip_timeout_seconds
|
||||
type: int
|
||||
spec_type:
|
||||
description:
|
||||
- type determines how the Service is exposed. Defaults to ClusterIP. Valid options
|
||||
are ExternalName, ClusterIP, NodePort, and LoadBalancer. "ExternalName" maps
|
||||
to the specified externalName. "ClusterIP" allocates a cluster-internal IP address
|
||||
for load-balancing to endpoints. Endpoints are determined by the selector or
|
||||
if that is not specified, by manual construction of an Endpoints object. If
|
||||
clusterIP is "None", no virtual IP is allocated and the endpoints are published
|
||||
as a set of endpoints rather than a stable IP. "NodePort" builds on ClusterIP
|
||||
and allocates a port on every node which routes to the clusterIP. "LoadBalancer"
|
||||
builds on NodePort and creates an external load-balancer (if supported in the
|
||||
current cloud) which routes to the clusterIP.
|
||||
aliases:
|
||||
- type
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
- name: Create service
|
||||
k8s_v1_service.yml:
|
||||
name: myservice
|
||||
namespace: k8s-project
|
||||
state: present
|
||||
selector:
|
||||
app: django
|
||||
ports:
|
||||
- port: 8765
|
||||
target_port: 8000
|
||||
name: http-port
|
||||
type: ClusterIP
|
||||
|
||||
- name: Patch service
|
||||
k8s_v1_service.yml:
|
||||
name: myservice
|
||||
namespace: k8s-project
|
||||
state: present
|
||||
selector:
|
||||
app: django
|
||||
env: production
|
||||
ports:
|
||||
- port: 8765
|
||||
target_port: 8010
|
||||
name: http-port
|
||||
- port: 8788
|
||||
target_port: 8080
|
||||
name: socket-port
|
||||
type: ClusterIP
|
||||
|
||||
- name: Create service
|
||||
k8s_v1_service.yml:
|
||||
name: myservice01
|
||||
namespace: k8s-project
|
||||
state: present
|
||||
selector:
|
||||
app_name: service_testing
|
||||
app_env: production
|
||||
ports:
|
||||
- port: 8888
|
||||
target_port: 8010
|
||||
name: http
|
||||
type: ClusterIP
|
||||
|
||||
- name: Patch service
|
||||
k8s_v1_service.yml:
|
||||
name: myservice01
|
||||
namespace: k8s-project
|
||||
state: present
|
||||
ports:
|
||||
- port: 9443
|
||||
target_port: 9443
|
||||
name: https
|
||||
- port: 8888
|
||||
target_port: 8015
|
||||
name: http
|
||||
|
||||
- name: Repace service
|
||||
k8s_v1_service.yml:
|
||||
name: myservice01
|
||||
namespace: k8s-project
|
||||
state: replaced
|
||||
selector:
|
||||
app_name: web_site
|
||||
app_env: testing
|
||||
ports:
|
||||
- port: 9999
|
||||
target_port: 9999
|
||||
name: https
|
||||
- port: 8080
|
||||
target_port: 8080
|
||||
name: http
|
||||
type: NodePort
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
service:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
spec:
|
||||
description:
|
||||
- Spec defines the behavior of a service.
|
||||
type: complex
|
||||
status:
|
||||
description:
|
||||
- Most recently observed status of the service. Populated by the system. Read-only.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('service', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,235 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_service_account
|
||||
short_description: Kubernetes ServiceAccount
|
||||
description:
|
||||
- Manage the lifecycle of a service_account object. Supports check mode, and attempts
|
||||
to to be idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
automount_service_account_token:
|
||||
description:
|
||||
- AutomountServiceAccountToken indicates whether pods running as this service
|
||||
account should have an API token automatically mounted. Can be overridden at
|
||||
the pod level.
|
||||
type: bool
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
image_pull_secrets:
|
||||
description:
|
||||
- ImagePullSecrets is a list of references to secrets in the same namespace to
|
||||
use for pulling any images in pods that reference this ServiceAccount. ImagePullSecrets
|
||||
are distinct from Secrets because Secrets can be mounted in the pod, but ImagePullSecrets
|
||||
are only accessed by the kubelet.
|
||||
type: list
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
secrets:
|
||||
description:
|
||||
- Secrets is the list of secrets allowed to be used by pods running using this
|
||||
ServiceAccount.
|
||||
type: list
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
service_account:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
automount_service_account_token:
|
||||
description:
|
||||
- AutomountServiceAccountToken indicates whether pods running as this service
|
||||
account should have an API token automatically mounted. Can be overridden
|
||||
at the pod level.
|
||||
type: bool
|
||||
image_pull_secrets:
|
||||
description:
|
||||
- ImagePullSecrets is a list of references to secrets in the same namespace
|
||||
to use for pulling any images in pods that reference this ServiceAccount.
|
||||
ImagePullSecrets are distinct from Secrets because Secrets can be mounted
|
||||
in the pod, but ImagePullSecrets are only accessed by the kubelet.
|
||||
type: list
|
||||
contains:
|
||||
name:
|
||||
description:
|
||||
- Name of the referent.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
secrets:
|
||||
description:
|
||||
- Secrets is the list of secrets allowed to be used by pods running using this
|
||||
ServiceAccount.
|
||||
type: list
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- API version of the referent.
|
||||
type: str
|
||||
field_path:
|
||||
description:
|
||||
- 'If referring to a piece of an object instead of an entire object, this
|
||||
string should contain a valid JSON/Go field access statement, such as
|
||||
desiredState.manifest.containers[2]. For example, if the object reference
|
||||
is to a container within a pod, this would take on a value like: "spec.containers{name}"
|
||||
(where "name" refers to the name of the container that triggered the event)
|
||||
or if no container name is specified "spec.containers[2]" (container with
|
||||
index 2 in this pod). This syntax is chosen only to have some well-defined
|
||||
way of referencing a part of an object.'
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind of the referent.
|
||||
type: str
|
||||
name:
|
||||
description:
|
||||
- Name of the referent.
|
||||
type: str
|
||||
namespace:
|
||||
description:
|
||||
- Namespace of the referent.
|
||||
type: str
|
||||
resource_version:
|
||||
description:
|
||||
- Specific resourceVersion to which this reference is made, if any.
|
||||
type: str
|
||||
uid:
|
||||
description:
|
||||
- UID of the referent.
|
||||
type: str
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('service_account', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,217 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_service_account_list
|
||||
short_description: Kubernetes ServiceAccountList
|
||||
description:
|
||||
- Retrieve a list of service_accounts. List operations provide a snapshot read of
|
||||
the underlying objects, returning a resource_version representing a consistent version
|
||||
of the listed objects.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
service_account_list:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
items:
|
||||
description:
|
||||
- List of ServiceAccounts.
|
||||
type: list
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value,
|
||||
and may reject unrecognized values.
|
||||
type: str
|
||||
automount_service_account_token:
|
||||
description:
|
||||
- AutomountServiceAccountToken indicates whether pods running as this service
|
||||
account should have an API token automatically mounted. Can be overridden
|
||||
at the pod level.
|
||||
type: bool
|
||||
image_pull_secrets:
|
||||
description:
|
||||
- ImagePullSecrets is a list of references to secrets in the same namespace
|
||||
to use for pulling any images in pods that reference this ServiceAccount.
|
||||
ImagePullSecrets are distinct from Secrets because Secrets can be mounted
|
||||
in the pod, but ImagePullSecrets are only accessed by the kubelet.
|
||||
type: list
|
||||
contains:
|
||||
name:
|
||||
description:
|
||||
- Name of the referent.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
secrets:
|
||||
description:
|
||||
- Secrets is the list of secrets allowed to be used by pods running using
|
||||
this ServiceAccount.
|
||||
type: list
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- API version of the referent.
|
||||
type: str
|
||||
field_path:
|
||||
description:
|
||||
- 'If referring to a piece of an object instead of an entire object,
|
||||
this string should contain a valid JSON/Go field access statement,
|
||||
such as desiredState.manifest.containers[2]. For example, if the object
|
||||
reference is to a container within a pod, this would take on a value
|
||||
like: "spec.containers{name}" (where "name" refers to the name of
|
||||
the container that triggered the event) or if no container name is
|
||||
specified "spec.containers[2]" (container with index 2 in this pod).
|
||||
This syntax is chosen only to have some well-defined way of referencing
|
||||
a part of an object.'
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind of the referent.
|
||||
type: str
|
||||
name:
|
||||
description:
|
||||
- Name of the referent.
|
||||
type: str
|
||||
namespace:
|
||||
description:
|
||||
- Namespace of the referent.
|
||||
type: str
|
||||
resource_version:
|
||||
description:
|
||||
- Specific resourceVersion to which this reference is made, if any.
|
||||
type: str
|
||||
uid:
|
||||
description:
|
||||
- UID of the referent.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard list metadata.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('service_account_list', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,166 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_service_list
|
||||
short_description: Kubernetes ServiceList
|
||||
description:
|
||||
- Retrieve a list of services. List operations provide a snapshot read of the underlying
|
||||
objects, returning a resource_version representing a consistent version of the listed
|
||||
objects.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
service_list:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
items:
|
||||
description:
|
||||
- List of services
|
||||
type: list
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value,
|
||||
and may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
spec:
|
||||
description:
|
||||
- Spec defines the behavior of a service.
|
||||
type: complex
|
||||
status:
|
||||
description:
|
||||
- Most recently observed status of the service. Populated by the system.
|
||||
Read-only.
|
||||
type: complex
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard list metadata.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('service_list', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,184 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_status
|
||||
short_description: Kubernetes Status
|
||||
description:
|
||||
- Manage the lifecycle of a status object. Supports check mode, and attempts to to
|
||||
be idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
code:
|
||||
description:
|
||||
- Suggested HTTP return code for this status, 0 if not set.
|
||||
type: int
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
details_causes:
|
||||
description:
|
||||
- The Causes array includes more details associated with the StatusReason failure.
|
||||
Not all StatusReasons may provide detailed causes.
|
||||
aliases:
|
||||
- causes
|
||||
type: list
|
||||
details_group:
|
||||
description:
|
||||
- The group attribute of the resource associated with the status StatusReason.
|
||||
aliases:
|
||||
- group
|
||||
details_kind:
|
||||
description:
|
||||
- The kind attribute of the resource associated with the status StatusReason.
|
||||
On some operations may differ from the requested resource Kind.
|
||||
aliases:
|
||||
- kind
|
||||
details_name:
|
||||
description:
|
||||
- The name attribute of the resource associated with the status StatusReason (when
|
||||
there is a single name which can be described).
|
||||
aliases:
|
||||
- name
|
||||
details_retry_after_seconds:
|
||||
description:
|
||||
- If specified, the time in seconds before the operation should be retried. Some
|
||||
errors may indicate the client must take an alternate action - for those errors
|
||||
this field may indicate how long to wait before taking the alternate action.
|
||||
aliases:
|
||||
- retry_after_seconds
|
||||
type: int
|
||||
details_uid:
|
||||
description:
|
||||
- UID of the resource. (when there is a single resource which can be described).
|
||||
aliases:
|
||||
- uid
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
message:
|
||||
description:
|
||||
- A human-readable description of the status of this operation.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
reason:
|
||||
description:
|
||||
- A machine-readable description of why this operation is in the "Failure" status.
|
||||
If this value is empty there is no information available. A Reason clarifies
|
||||
an HTTP status code but does not override it.
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
status:
|
||||
type: complex
|
||||
returned: on success
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
code:
|
||||
description:
|
||||
- Suggested HTTP return code for this status, 0 if not set.
|
||||
type: int
|
||||
details:
|
||||
description:
|
||||
- Extended data associated with the reason. Each reason may define its own extended
|
||||
details. This field is optional and the data returned is not guaranteed to
|
||||
conform to any schema except that defined by the reason type.
|
||||
type: complex
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
message:
|
||||
description:
|
||||
- A human-readable description of the status of this operation.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard list metadata.
|
||||
type: complex
|
||||
reason:
|
||||
description:
|
||||
- A machine-readable description of why this operation is in the "Failure" status.
|
||||
If this value is empty there is no information available. A Reason clarifies
|
||||
an HTTP status code but does not override it.
|
||||
type: str
|
||||
status:
|
||||
description:
|
||||
- 'Status of the operation. One of: "Success" or "Failure".'
|
||||
type: str
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('status', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,206 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_storage_class
|
||||
short_description: Kubernetes StorageClass
|
||||
description:
|
||||
- Manage the lifecycle of a storage_class object. Supports check mode, and attempts
|
||||
to to be idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
allow_volume_expansion:
|
||||
description:
|
||||
- AllowVolumeExpansion shows whether the storage class allow volume expand
|
||||
type: bool
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
mount_options:
|
||||
description:
|
||||
- Dynamically provisioned PersistentVolumes of this storage class are created
|
||||
with these mountOptions, e.g. ["ro", "soft"]. Not validated - mount of the PVs
|
||||
will simply fail if one is invalid.
|
||||
type: list
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
parameters:
|
||||
description:
|
||||
- Parameters holds the parameters for the provisioner that should create volumes
|
||||
of this storage class.
|
||||
type: dict
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
provisioner:
|
||||
description:
|
||||
- Provisioner indicates the type of the provisioner.
|
||||
reclaim_policy:
|
||||
description:
|
||||
- Dynamically provisioned PersistentVolumes of this storage class are created
|
||||
with this reclaimPolicy. Defaults to Delete.
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
storage_class:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
allow_volume_expansion:
|
||||
description:
|
||||
- AllowVolumeExpansion shows whether the storage class allow volume expand
|
||||
type: bool
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
mount_options:
|
||||
description:
|
||||
- Dynamically provisioned PersistentVolumes of this storage class are created
|
||||
with these mountOptions, e.g. ["ro", "soft"]. Not validated - mount of the
|
||||
PVs will simply fail if one is invalid.
|
||||
type: list
|
||||
contains: str
|
||||
parameters:
|
||||
description:
|
||||
- Parameters holds the parameters for the provisioner that should create volumes
|
||||
of this storage class.
|
||||
type: complex
|
||||
contains: str, str
|
||||
provisioner:
|
||||
description:
|
||||
- Provisioner indicates the type of the provisioner.
|
||||
type: str
|
||||
reclaim_policy:
|
||||
description:
|
||||
- Dynamically provisioned PersistentVolumes of this storage class are created
|
||||
with this reclaimPolicy. Defaults to Delete.
|
||||
type: str
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('storage_class', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,183 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_storage_class_list
|
||||
short_description: Kubernetes StorageClassList
|
||||
description:
|
||||
- Retrieve a list of storage_class. List operations provide a snapshot read of the
|
||||
underlying objects, returning a resource_version representing a consistent version
|
||||
of the listed objects.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
storage_class_list:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
items:
|
||||
description:
|
||||
- Items is the list of StorageClasses
|
||||
type: list
|
||||
contains:
|
||||
allow_volume_expansion:
|
||||
description:
|
||||
- AllowVolumeExpansion shows whether the storage class allow volume expand
|
||||
type: bool
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value,
|
||||
and may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
mount_options:
|
||||
description:
|
||||
- Dynamically provisioned PersistentVolumes of this storage class are created
|
||||
with these mountOptions, e.g. ["ro", "soft"]. Not validated - mount of
|
||||
the PVs will simply fail if one is invalid.
|
||||
type: list
|
||||
contains: str
|
||||
parameters:
|
||||
description:
|
||||
- Parameters holds the parameters for the provisioner that should create
|
||||
volumes of this storage class.
|
||||
type: complex
|
||||
contains: str, str
|
||||
provisioner:
|
||||
description:
|
||||
- Provisioner indicates the type of the provisioner.
|
||||
type: str
|
||||
reclaim_policy:
|
||||
description:
|
||||
- Dynamically provisioned PersistentVolumes of this storage class are created
|
||||
with this reclaimPolicy. Defaults to Delete.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard list metadata
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('storage_class_list', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,217 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_subject_access_review
|
||||
short_description: Kubernetes SubjectAccessReview
|
||||
description:
|
||||
- Manage the lifecycle of a subject_access_review object. Supports check mode, and
|
||||
attempts to to be idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
spec_extra:
|
||||
description:
|
||||
- Extra corresponds to the user.Info.GetExtra() method from the authenticator.
|
||||
Since that is input to the authorizer it needs a reflection here.
|
||||
aliases:
|
||||
- extra
|
||||
type: dict
|
||||
spec_groups:
|
||||
description:
|
||||
- Groups is the groups you're testing for.
|
||||
aliases:
|
||||
- groups
|
||||
type: list
|
||||
spec_non_resource_attributes_path:
|
||||
description:
|
||||
- Path is the URL path of the request
|
||||
aliases:
|
||||
- non_resource_attributes_path
|
||||
spec_non_resource_attributes_verb:
|
||||
description:
|
||||
- Verb is the standard HTTP verb
|
||||
aliases:
|
||||
- non_resource_attributes_verb
|
||||
spec_resource_attributes_group:
|
||||
description:
|
||||
- Group is the API Group of the Resource. "*" means all.
|
||||
aliases:
|
||||
- resource_attributes_group
|
||||
spec_resource_attributes_name:
|
||||
description:
|
||||
- Name is the name of the resource being requested for a "get" or deleted for
|
||||
a "delete". "" (empty) means all.
|
||||
aliases:
|
||||
- resource_attributes_name
|
||||
spec_resource_attributes_namespace:
|
||||
description:
|
||||
- Namespace is the namespace of the action being requested. Currently, there is
|
||||
no distinction between no namespace and all namespaces "" (empty) is defaulted
|
||||
for LocalSubjectAccessReviews "" (empty) is empty for cluster-scoped resources
|
||||
"" (empty) means "all" for namespace scoped resources from a SubjectAccessReview
|
||||
or SelfSubjectAccessReview
|
||||
aliases:
|
||||
- resource_attributes_namespace
|
||||
spec_resource_attributes_resource:
|
||||
description:
|
||||
- Resource is one of the existing resource types. "*" means all.
|
||||
aliases:
|
||||
- resource_attributes_resource
|
||||
spec_resource_attributes_subresource:
|
||||
description:
|
||||
- Subresource is one of the existing resource types. "" means none.
|
||||
aliases:
|
||||
- resource_attributes_subresource
|
||||
spec_resource_attributes_verb:
|
||||
description:
|
||||
- 'Verb is a kubernetes resource API verb, like: get, list, watch, create, update,
|
||||
delete, proxy. "*" means all.'
|
||||
aliases:
|
||||
- resource_attributes_verb
|
||||
spec_resource_attributes_version:
|
||||
description:
|
||||
- Version is the API Version of the Resource. "*" means all.
|
||||
aliases:
|
||||
- resource_attributes_version
|
||||
spec_uid:
|
||||
description:
|
||||
- UID information about the requesting user.
|
||||
aliases:
|
||||
- uid
|
||||
spec_user:
|
||||
description:
|
||||
- User is the user you're testing for. If you specify "User" but not "Groups",
|
||||
then is it interpreted as "What if User were not a member of any groups
|
||||
aliases:
|
||||
- user
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
subject_access_review:
|
||||
type: complex
|
||||
returned: on success
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description: []
|
||||
type: complex
|
||||
spec:
|
||||
description:
|
||||
- Spec holds information about the request being evaluated
|
||||
type: complex
|
||||
status:
|
||||
description:
|
||||
- Status is filled in by the server and indicates whether the request is allowed
|
||||
or not
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('subject_access_review', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,147 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1_token_review
|
||||
short_description: Kubernetes TokenReview
|
||||
description:
|
||||
- Manage the lifecycle of a token_review object. Supports check mode, and attempts
|
||||
to to be idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
spec_token:
|
||||
description:
|
||||
- Token is the opaque bearer token.
|
||||
aliases:
|
||||
- token
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
token_review:
|
||||
type: complex
|
||||
returned: on success
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description: []
|
||||
type: complex
|
||||
spec:
|
||||
description:
|
||||
- Spec holds information about the request being evaluated
|
||||
type: complex
|
||||
status:
|
||||
description:
|
||||
- Status is filled in by the server and indicates whether the request can be
|
||||
authenticated.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('token_review', 'v1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,204 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1alpha1_cluster_role
|
||||
short_description: Kubernetes ClusterRole
|
||||
description:
|
||||
- Manage the lifecycle of a cluster_role object. Supports check mode, and attempts
|
||||
to to be idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
rules:
|
||||
description:
|
||||
- Rules holds all the PolicyRules for this ClusterRole
|
||||
type: list
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
cluster_role:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
rules:
|
||||
description:
|
||||
- Rules holds all the PolicyRules for this ClusterRole
|
||||
type: list
|
||||
contains:
|
||||
api_groups:
|
||||
description:
|
||||
- APIGroups is the name of the APIGroup that contains the resources. If
|
||||
multiple API groups are specified, any action requested against one of
|
||||
the enumerated resources in any API group will be allowed.
|
||||
type: list
|
||||
contains: str
|
||||
non_resource_ur_ls:
|
||||
description:
|
||||
- NonResourceURLs is a set of partial urls that a user should have access
|
||||
to. *s are allowed, but only as the full, final step in the path This
|
||||
name is intentionally different than the internal type so that the DefaultConvert
|
||||
works nicely and because the ordering may be different. Since non-resource
|
||||
URLs are not namespaced, this field is only applicable for ClusterRoles
|
||||
referenced from a ClusterRoleBinding. Rules can either apply to API resources
|
||||
(such as "pods" or "secrets") or non-resource URL paths (such as "/api"),
|
||||
but not both.
|
||||
type: list
|
||||
contains: str
|
||||
resource_names:
|
||||
description:
|
||||
- ResourceNames is an optional white list of names that the rule applies
|
||||
to. An empty set means that everything is allowed.
|
||||
type: list
|
||||
contains: str
|
||||
resources:
|
||||
description:
|
||||
- Resources is a list of resources this rule applies to. ResourceAll represents
|
||||
all resources.
|
||||
type: list
|
||||
contains: str
|
||||
verbs:
|
||||
description:
|
||||
- Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions
|
||||
contained in this rule. VerbAll represents all kinds.
|
||||
type: list
|
||||
contains: str
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('cluster_role', 'v1alpha1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,207 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1alpha1_cluster_role_binding
|
||||
short_description: Kubernetes ClusterRoleBinding
|
||||
description:
|
||||
- Manage the lifecycle of a cluster_role_binding object. Supports check mode, and
|
||||
attempts to to be idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
role_ref_api_group:
|
||||
description:
|
||||
- APIGroup is the group for the resource being referenced
|
||||
aliases:
|
||||
- api_group
|
||||
role_ref_kind:
|
||||
description:
|
||||
- Kind is the type of resource being referenced
|
||||
aliases:
|
||||
- kind
|
||||
role_ref_name:
|
||||
description:
|
||||
- Name is the name of resource being referenced
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
subjects:
|
||||
description:
|
||||
- Subjects holds references to the objects the role applies to.
|
||||
type: list
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
cluster_role_binding:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
role_ref:
|
||||
description:
|
||||
- RoleRef can only reference a ClusterRole in the global namespace. If the RoleRef
|
||||
cannot be resolved, the Authorizer must return an error.
|
||||
type: complex
|
||||
subjects:
|
||||
description:
|
||||
- Subjects holds references to the objects the role applies to.
|
||||
type: list
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion holds the API group and version of the referenced subject.
|
||||
Defaults to "v1" for ServiceAccount subjects. Defaults to "rbac.authorization.k8s.io/v1alpha1"
|
||||
for User and Group subjects.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind of object being referenced. Values defined by this API group are
|
||||
"User", "Group", and "ServiceAccount". If the Authorizer does not recognized
|
||||
the kind value, the Authorizer should report an error.
|
||||
type: str
|
||||
name:
|
||||
description:
|
||||
- Name of the object being referenced.
|
||||
type: str
|
||||
namespace:
|
||||
description:
|
||||
- Namespace of the referenced object. If the object kind is non-namespace,
|
||||
such as "User" or "Group", and this value is not empty the Authorizer
|
||||
should report an error.
|
||||
type: str
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('cluster_role_binding', 'v1alpha1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,189 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1alpha1_cluster_role_binding_list
|
||||
short_description: Kubernetes ClusterRoleBindingList
|
||||
description:
|
||||
- Retrieve a list of cluster_role_bindings. List operations provide a snapshot read
|
||||
of the underlying objects, returning a resource_version representing a consistent
|
||||
version of the listed objects.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
cluster_role_binding_list:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
items:
|
||||
description:
|
||||
- Items is a list of ClusterRoleBindings
|
||||
type: list
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value,
|
||||
and may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
role_ref:
|
||||
description:
|
||||
- RoleRef can only reference a ClusterRole in the global namespace. If the
|
||||
RoleRef cannot be resolved, the Authorizer must return an error.
|
||||
type: complex
|
||||
subjects:
|
||||
description:
|
||||
- Subjects holds references to the objects the role applies to.
|
||||
type: list
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion holds the API group and version of the referenced subject.
|
||||
Defaults to "v1" for ServiceAccount subjects. Defaults to "rbac.authorization.k8s.io/v1alpha1"
|
||||
for User and Group subjects.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind of object being referenced. Values defined by this API group
|
||||
are "User", "Group", and "ServiceAccount". If the Authorizer does
|
||||
not recognized the kind value, the Authorizer should report an error.
|
||||
type: str
|
||||
name:
|
||||
description:
|
||||
- Name of the object being referenced.
|
||||
type: str
|
||||
namespace:
|
||||
description:
|
||||
- Namespace of the referenced object. If the object kind is non-namespace,
|
||||
such as "User" or "Group", and this value is not empty the Authorizer
|
||||
should report an error.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('cluster_role_binding_list', 'v1alpha1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,199 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1alpha1_cluster_role_list
|
||||
short_description: Kubernetes ClusterRoleList
|
||||
description:
|
||||
- Retrieve a list of cluster_roles. List operations provide a snapshot read of the
|
||||
underlying objects, returning a resource_version representing a consistent version
|
||||
of the listed objects.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
cluster_role_list:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
items:
|
||||
description:
|
||||
- Items is a list of ClusterRoles
|
||||
type: list
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value,
|
||||
and may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
rules:
|
||||
description:
|
||||
- Rules holds all the PolicyRules for this ClusterRole
|
||||
type: list
|
||||
contains:
|
||||
api_groups:
|
||||
description:
|
||||
- APIGroups is the name of the APIGroup that contains the resources.
|
||||
If multiple API groups are specified, any action requested against
|
||||
one of the enumerated resources in any API group will be allowed.
|
||||
type: list
|
||||
contains: str
|
||||
non_resource_ur_ls:
|
||||
description:
|
||||
- NonResourceURLs is a set of partial urls that a user should have access
|
||||
to. *s are allowed, but only as the full, final step in the path This
|
||||
name is intentionally different than the internal type so that the
|
||||
DefaultConvert works nicely and because the ordering may be different.
|
||||
Since non-resource URLs are not namespaced, this field is only applicable
|
||||
for ClusterRoles referenced from a ClusterRoleBinding. Rules can either
|
||||
apply to API resources (such as "pods" or "secrets") or non-resource
|
||||
URL paths (such as "/api"), but not both.
|
||||
type: list
|
||||
contains: str
|
||||
resource_names:
|
||||
description:
|
||||
- ResourceNames is an optional white list of names that the rule applies
|
||||
to. An empty set means that everything is allowed.
|
||||
type: list
|
||||
contains: str
|
||||
resources:
|
||||
description:
|
||||
- Resources is a list of resources this rule applies to. ResourceAll
|
||||
represents all resources.
|
||||
type: list
|
||||
contains: str
|
||||
verbs:
|
||||
description:
|
||||
- Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions
|
||||
contained in this rule. VerbAll represents all kinds.
|
||||
type: list
|
||||
contains: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('cluster_role_list', 'v1alpha1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,223 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1alpha1_external_admission_hook_configuration
|
||||
short_description: Kubernetes ExternalAdmissionHookConfiguration
|
||||
description:
|
||||
- Manage the lifecycle of a external_admission_hook_configuration object. Supports
|
||||
check mode, and attempts to to be idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
external_admission_hooks:
|
||||
description:
|
||||
- ExternalAdmissionHooks is a list of external admission webhooks and the affected
|
||||
resources and operations.
|
||||
type: list
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
external_admission_hook_configuration:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
external_admission_hooks:
|
||||
description:
|
||||
- ExternalAdmissionHooks is a list of external admission webhooks and the affected
|
||||
resources and operations.
|
||||
type: list
|
||||
contains:
|
||||
client_config:
|
||||
description:
|
||||
- ClientConfig defines how to communicate with the hook. Required
|
||||
type: complex
|
||||
failure_policy:
|
||||
description:
|
||||
- FailurePolicy defines how unrecognized errors from the admission endpoint
|
||||
are handled - allowed values are Ignore or Fail. Defaults to Ignore.
|
||||
type: str
|
||||
name:
|
||||
description:
|
||||
- The name of the external admission webhook. Name should be fully qualified,
|
||||
e.g., imagepolicy.kubernetes.io, where "imagepolicy" is the name of the
|
||||
webhook, and kubernetes.io is the name of the organization. Required.
|
||||
type: str
|
||||
rules:
|
||||
description:
|
||||
- Rules describes what operations on what resources/subresources the webhook
|
||||
cares about. The webhook cares about an operation if it matches _any_
|
||||
Rule.
|
||||
type: list
|
||||
contains:
|
||||
api_groups:
|
||||
description:
|
||||
- APIGroups is the API groups the resources belong to. '*' is all groups.
|
||||
If '*' is present, the length of the slice must be one. Required.
|
||||
type: list
|
||||
contains: str
|
||||
api_versions:
|
||||
description:
|
||||
- APIVersions is the API versions the resources belong to. '*' is all
|
||||
versions. If '*' is present, the length of the slice must be one.
|
||||
Required.
|
||||
type: list
|
||||
contains: str
|
||||
operations:
|
||||
description:
|
||||
- Operations is the operations the admission hook cares about - CREATE,
|
||||
UPDATE, or * for all operations. If '*' is present, the length of
|
||||
the slice must be one. Required.
|
||||
type: list
|
||||
contains: str
|
||||
resources:
|
||||
description:
|
||||
- "Resources is a list of resources this rule applies to. For example:\
|
||||
\ 'pods' means pods. 'pods/log' means the log subresource of pods.\
|
||||
\ '*' means all resources, but not subresources. 'pods/*' means all\
|
||||
\ subresources of pods. '*/scale' means all scale subresources. '*/*'\
|
||||
\ means all resources and their subresources. If wildcard is present,\
|
||||
\ the validation rule will ensure resources do not overlap with each\
|
||||
\ other. Depending on the enclosing object, subresources might not\
|
||||
\ be allowed. Required."
|
||||
type: list
|
||||
contains: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object metadata;
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('external_admission_hook_configuration', 'v1alpha1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,218 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1alpha1_external_admission_hook_configuration_list
|
||||
short_description: Kubernetes ExternalAdmissionHookConfigurationList
|
||||
description:
|
||||
- Retrieve a list of external_admission_hook_configurations. List operations provide
|
||||
a snapshot read of the underlying objects, returning a resource_version representing
|
||||
a consistent version of the listed objects.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
external_admission_hook_configuration_list:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
items:
|
||||
description:
|
||||
- List of ExternalAdmissionHookConfiguration.
|
||||
type: list
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value,
|
||||
and may reject unrecognized values.
|
||||
type: str
|
||||
external_admission_hooks:
|
||||
description:
|
||||
- ExternalAdmissionHooks is a list of external admission webhooks and the
|
||||
affected resources and operations.
|
||||
type: list
|
||||
contains:
|
||||
client_config:
|
||||
description:
|
||||
- ClientConfig defines how to communicate with the hook. Required
|
||||
type: complex
|
||||
failure_policy:
|
||||
description:
|
||||
- FailurePolicy defines how unrecognized errors from the admission endpoint
|
||||
are handled - allowed values are Ignore or Fail. Defaults to Ignore.
|
||||
type: str
|
||||
name:
|
||||
description:
|
||||
- The name of the external admission webhook. Name should be fully qualified,
|
||||
e.g., imagepolicy.kubernetes.io, where "imagepolicy" is the name of
|
||||
the webhook, and kubernetes.io is the name of the organization. Required.
|
||||
type: str
|
||||
rules:
|
||||
description:
|
||||
- Rules describes what operations on what resources/subresources the
|
||||
webhook cares about. The webhook cares about an operation if it matches
|
||||
_any_ Rule.
|
||||
type: list
|
||||
contains:
|
||||
api_groups:
|
||||
description:
|
||||
- APIGroups is the API groups the resources belong to. '*' is all
|
||||
groups. If '*' is present, the length of the slice must be one.
|
||||
Required.
|
||||
type: list
|
||||
contains: str
|
||||
api_versions:
|
||||
description:
|
||||
- APIVersions is the API versions the resources belong to. '*' is
|
||||
all versions. If '*' is present, the length of the slice must
|
||||
be one. Required.
|
||||
type: list
|
||||
contains: str
|
||||
operations:
|
||||
description:
|
||||
- Operations is the operations the admission hook cares about -
|
||||
CREATE, UPDATE, or * for all operations. If '*' is present, the
|
||||
length of the slice must be one. Required.
|
||||
type: list
|
||||
contains: str
|
||||
resources:
|
||||
description:
|
||||
- "Resources is a list of resources this rule applies to. For example:\
|
||||
\ 'pods' means pods. 'pods/log' means the log subresource of pods.\
|
||||
\ '*' means all resources, but not subresources. 'pods/*' means\
|
||||
\ all subresources of pods. '*/scale' means all scale subresources.\
|
||||
\ '*/*' means all resources and their subresources. If wildcard\
|
||||
\ is present, the validation rule will ensure resources do not\
|
||||
\ overlap with each other. Depending on the enclosing object,\
|
||||
\ subresources might not be allowed. Required."
|
||||
type: list
|
||||
contains: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object metadata;
|
||||
type: complex
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard list metadata.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('external_admission_hook_configuration_list', 'v1alpha1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,212 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1alpha1_initializer_configuration
|
||||
short_description: Kubernetes InitializerConfiguration
|
||||
description:
|
||||
- Manage the lifecycle of a initializer_configuration object. Supports check mode,
|
||||
and attempts to to be idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
initializers:
|
||||
description:
|
||||
- Initializers is a list of resources and their default initializers Order-sensitive.
|
||||
When merging multiple InitializerConfigurations, we sort the initializers from
|
||||
different InitializerConfigurations by the name of the InitializerConfigurations;
|
||||
the order of the initializers from the same InitializerConfiguration is preserved.
|
||||
type: list
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
initializer_configuration:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
initializers:
|
||||
description:
|
||||
- Initializers is a list of resources and their default initializers Order-sensitive.
|
||||
When merging multiple InitializerConfigurations, we sort the initializers
|
||||
from different InitializerConfigurations by the name of the InitializerConfigurations;
|
||||
the order of the initializers from the same InitializerConfiguration is preserved.
|
||||
type: list
|
||||
contains:
|
||||
name:
|
||||
description:
|
||||
- Name is the identifier of the initializer. It will be added to the object
|
||||
that needs to be initialized. Name should be fully qualified, e.g., alwayspullimages.kubernetes.io,
|
||||
where "alwayspullimages" is the name of the webhook, and kubernetes.io
|
||||
is the name of the organization. Required
|
||||
type: str
|
||||
rules:
|
||||
description:
|
||||
- Rules describes what resources/subresources the initializer cares about.
|
||||
The initializer cares about an operation if it matches _any_ Rule. Rule.Resources
|
||||
must not include subresources.
|
||||
type: list
|
||||
contains:
|
||||
api_groups:
|
||||
description:
|
||||
- APIGroups is the API groups the resources belong to. '*' is all groups.
|
||||
If '*' is present, the length of the slice must be one. Required.
|
||||
type: list
|
||||
contains: str
|
||||
api_versions:
|
||||
description:
|
||||
- APIVersions is the API versions the resources belong to. '*' is all
|
||||
versions. If '*' is present, the length of the slice must be one.
|
||||
Required.
|
||||
type: list
|
||||
contains: str
|
||||
resources:
|
||||
description:
|
||||
- "Resources is a list of resources this rule applies to. For example:\
|
||||
\ 'pods' means pods. 'pods/log' means the log subresource of pods.\
|
||||
\ '*' means all resources, but not subresources. 'pods/*' means all\
|
||||
\ subresources of pods. '*/scale' means all scale subresources. '*/*'\
|
||||
\ means all resources and their subresources. If wildcard is present,\
|
||||
\ the validation rule will ensure resources do not overlap with each\
|
||||
\ other. Depending on the enclosing object, subresources might not\
|
||||
\ be allowed. Required."
|
||||
type: list
|
||||
contains: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object metadata;
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('initializer_configuration', 'v1alpha1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,207 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1alpha1_initializer_configuration_list
|
||||
short_description: Kubernetes InitializerConfigurationList
|
||||
description:
|
||||
- Retrieve a list of initializer_configurations. List operations provide a snapshot
|
||||
read of the underlying objects, returning a resource_version representing a consistent
|
||||
version of the listed objects.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
initializer_configuration_list:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
items:
|
||||
description:
|
||||
- List of InitializerConfiguration.
|
||||
type: list
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value,
|
||||
and may reject unrecognized values.
|
||||
type: str
|
||||
initializers:
|
||||
description:
|
||||
- Initializers is a list of resources and their default initializers Order-sensitive.
|
||||
When merging multiple InitializerConfigurations, we sort the initializers
|
||||
from different InitializerConfigurations by the name of the InitializerConfigurations;
|
||||
the order of the initializers from the same InitializerConfiguration is
|
||||
preserved.
|
||||
type: list
|
||||
contains:
|
||||
name:
|
||||
description:
|
||||
- Name is the identifier of the initializer. It will be added to the
|
||||
object that needs to be initialized. Name should be fully qualified,
|
||||
e.g., alwayspullimages.kubernetes.io, where "alwayspullimages" is
|
||||
the name of the webhook, and kubernetes.io is the name of the organization.
|
||||
Required
|
||||
type: str
|
||||
rules:
|
||||
description:
|
||||
- Rules describes what resources/subresources the initializer cares
|
||||
about. The initializer cares about an operation if it matches _any_
|
||||
Rule. Rule.Resources must not include subresources.
|
||||
type: list
|
||||
contains:
|
||||
api_groups:
|
||||
description:
|
||||
- APIGroups is the API groups the resources belong to. '*' is all
|
||||
groups. If '*' is present, the length of the slice must be one.
|
||||
Required.
|
||||
type: list
|
||||
contains: str
|
||||
api_versions:
|
||||
description:
|
||||
- APIVersions is the API versions the resources belong to. '*' is
|
||||
all versions. If '*' is present, the length of the slice must
|
||||
be one. Required.
|
||||
type: list
|
||||
contains: str
|
||||
resources:
|
||||
description:
|
||||
- "Resources is a list of resources this rule applies to. For example:\
|
||||
\ 'pods' means pods. 'pods/log' means the log subresource of pods.\
|
||||
\ '*' means all resources, but not subresources. 'pods/*' means\
|
||||
\ all subresources of pods. '*/scale' means all scale subresources.\
|
||||
\ '*/*' means all resources and their subresources. If wildcard\
|
||||
\ is present, the validation rule will ensure resources do not\
|
||||
\ overlap with each other. Depending on the enclosing object,\
|
||||
\ subresources might not be allowed. Required."
|
||||
type: list
|
||||
contains: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object metadata;
|
||||
type: complex
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard list metadata.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('initializer_configuration_list', 'v1alpha1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,200 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1alpha1_pod_preset
|
||||
short_description: Kubernetes PodPreset
|
||||
description:
|
||||
- Manage the lifecycle of a pod_preset object. Supports check mode, and attempts to
|
||||
to be idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
spec_env:
|
||||
description:
|
||||
- Env defines the collection of EnvVar to inject into containers.
|
||||
aliases:
|
||||
- env
|
||||
type: list
|
||||
spec_env_from:
|
||||
description:
|
||||
- EnvFrom defines the collection of EnvFromSource to inject into containers.
|
||||
aliases:
|
||||
- env_from
|
||||
type: list
|
||||
spec_selector_match_expressions:
|
||||
description:
|
||||
- matchExpressions is a list of label selector requirements. The requirements
|
||||
are ANDed.
|
||||
aliases:
|
||||
- selector_match_expressions
|
||||
type: list
|
||||
spec_selector_match_labels:
|
||||
description:
|
||||
- matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
|
||||
map is equivalent to an element of matchExpressions, whose key field is "key",
|
||||
the operator is "In", and the values array contains only "value". The requirements
|
||||
are ANDed.
|
||||
aliases:
|
||||
- selector_match_labels
|
||||
type: dict
|
||||
spec_volume_mounts:
|
||||
description:
|
||||
- VolumeMounts defines the collection of VolumeMount to inject into containers.
|
||||
aliases:
|
||||
- volume_mounts
|
||||
type: list
|
||||
spec_volumes:
|
||||
description:
|
||||
- Volumes defines the collection of Volume to inject into the pod.
|
||||
aliases:
|
||||
- volumes
|
||||
type: list
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
pod_preset:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description: []
|
||||
type: complex
|
||||
spec:
|
||||
description: []
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('pod_preset', 'v1alpha1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,159 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1alpha1_pod_preset_list
|
||||
short_description: Kubernetes PodPresetList
|
||||
description:
|
||||
- Retrieve a list of pod_presets. List operations provide a snapshot read of the underlying
|
||||
objects, returning a resource_version representing a consistent version of the listed
|
||||
objects.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
pod_preset_list:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
items:
|
||||
description:
|
||||
- Items is a list of schema objects.
|
||||
type: list
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value,
|
||||
and may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description: []
|
||||
type: complex
|
||||
spec:
|
||||
description: []
|
||||
type: complex
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard list metadata.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('pod_preset_list', 'v1alpha1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,187 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1alpha1_priority_class
|
||||
short_description: Kubernetes PriorityClass
|
||||
description:
|
||||
- Manage the lifecycle of a priority_class object. Supports check mode, and attempts
|
||||
to to be idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
description:
|
||||
description:
|
||||
- description is an arbitrary string that usually provides guidelines on when
|
||||
this priority class should be used.
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
global_default:
|
||||
description:
|
||||
- globalDefault specifies whether this PriorityClass should be considered as the
|
||||
default priority for pods that do not have any priority class.
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
value:
|
||||
description:
|
||||
- The value of this priority class. This is the actual priority that pods receive
|
||||
when they have the name of this class in their pod spec.
|
||||
type: int
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
priority_class:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
description:
|
||||
description:
|
||||
- description is an arbitrary string that usually provides guidelines on when
|
||||
this priority class should be used.
|
||||
type: str
|
||||
global_default:
|
||||
description:
|
||||
- globalDefault specifies whether this PriorityClass should be considered as
|
||||
the default priority for pods that do not have any priority class.
|
||||
type: bool
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
value:
|
||||
description:
|
||||
- The value of this priority class. This is the actual priority that pods receive
|
||||
when they have the name of this class in their pod spec.
|
||||
type: int
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('priority_class', 'v1alpha1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,172 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1alpha1_priority_class_list
|
||||
short_description: Kubernetes PriorityClassList
|
||||
description:
|
||||
- Retrieve a list of priority_class. List operations provide a snapshot read of the
|
||||
underlying objects, returning a resource_version representing a consistent version
|
||||
of the listed objects.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
priority_class_list:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
items:
|
||||
description:
|
||||
- items is the list of PriorityClasses
|
||||
type: list
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value,
|
||||
and may reject unrecognized values.
|
||||
type: str
|
||||
description:
|
||||
description:
|
||||
- description is an arbitrary string that usually provides guidelines on
|
||||
when this priority class should be used.
|
||||
type: str
|
||||
global_default:
|
||||
description:
|
||||
- globalDefault specifies whether this PriorityClass should be considered
|
||||
as the default priority for pods that do not have any priority class.
|
||||
type: bool
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
value:
|
||||
description:
|
||||
- The value of this priority class. This is the actual priority that pods
|
||||
receive when they have the name of this class in their pod spec.
|
||||
type: int
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard list metadata
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('priority_class_list', 'v1alpha1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,204 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1alpha1_role
|
||||
short_description: Kubernetes Role
|
||||
description:
|
||||
- Manage the lifecycle of a role object. Supports check mode, and attempts to to be
|
||||
idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
rules:
|
||||
description:
|
||||
- Rules holds all the PolicyRules for this Role
|
||||
type: list
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
role:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
rules:
|
||||
description:
|
||||
- Rules holds all the PolicyRules for this Role
|
||||
type: list
|
||||
contains:
|
||||
api_groups:
|
||||
description:
|
||||
- APIGroups is the name of the APIGroup that contains the resources. If
|
||||
multiple API groups are specified, any action requested against one of
|
||||
the enumerated resources in any API group will be allowed.
|
||||
type: list
|
||||
contains: str
|
||||
non_resource_ur_ls:
|
||||
description:
|
||||
- NonResourceURLs is a set of partial urls that a user should have access
|
||||
to. *s are allowed, but only as the full, final step in the path This
|
||||
name is intentionally different than the internal type so that the DefaultConvert
|
||||
works nicely and because the ordering may be different. Since non-resource
|
||||
URLs are not namespaced, this field is only applicable for ClusterRoles
|
||||
referenced from a ClusterRoleBinding. Rules can either apply to API resources
|
||||
(such as "pods" or "secrets") or non-resource URL paths (such as "/api"),
|
||||
but not both.
|
||||
type: list
|
||||
contains: str
|
||||
resource_names:
|
||||
description:
|
||||
- ResourceNames is an optional white list of names that the rule applies
|
||||
to. An empty set means that everything is allowed.
|
||||
type: list
|
||||
contains: str
|
||||
resources:
|
||||
description:
|
||||
- Resources is a list of resources this rule applies to. ResourceAll represents
|
||||
all resources.
|
||||
type: list
|
||||
contains: str
|
||||
verbs:
|
||||
description:
|
||||
- Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions
|
||||
contained in this rule. VerbAll represents all kinds.
|
||||
type: list
|
||||
contains: str
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('role', 'v1alpha1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,208 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1alpha1_role_binding
|
||||
short_description: Kubernetes RoleBinding
|
||||
description:
|
||||
- Manage the lifecycle of a role_binding object. Supports check mode, and attempts
|
||||
to to be idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
role_ref_api_group:
|
||||
description:
|
||||
- APIGroup is the group for the resource being referenced
|
||||
aliases:
|
||||
- api_group
|
||||
role_ref_kind:
|
||||
description:
|
||||
- Kind is the type of resource being referenced
|
||||
aliases:
|
||||
- kind
|
||||
role_ref_name:
|
||||
description:
|
||||
- Name is the name of resource being referenced
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
subjects:
|
||||
description:
|
||||
- Subjects holds references to the objects the role applies to.
|
||||
type: list
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
role_binding:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
role_ref:
|
||||
description:
|
||||
- RoleRef can reference a Role in the current namespace or a ClusterRole in
|
||||
the global namespace. If the RoleRef cannot be resolved, the Authorizer must
|
||||
return an error.
|
||||
type: complex
|
||||
subjects:
|
||||
description:
|
||||
- Subjects holds references to the objects the role applies to.
|
||||
type: list
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion holds the API group and version of the referenced subject.
|
||||
Defaults to "v1" for ServiceAccount subjects. Defaults to "rbac.authorization.k8s.io/v1alpha1"
|
||||
for User and Group subjects.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind of object being referenced. Values defined by this API group are
|
||||
"User", "Group", and "ServiceAccount". If the Authorizer does not recognized
|
||||
the kind value, the Authorizer should report an error.
|
||||
type: str
|
||||
name:
|
||||
description:
|
||||
- Name of the object being referenced.
|
||||
type: str
|
||||
namespace:
|
||||
description:
|
||||
- Namespace of the referenced object. If the object kind is non-namespace,
|
||||
such as "User" or "Group", and this value is not empty the Authorizer
|
||||
should report an error.
|
||||
type: str
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('role_binding', 'v1alpha1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,190 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1alpha1_role_binding_list
|
||||
short_description: Kubernetes RoleBindingList
|
||||
description:
|
||||
- Retrieve a list of role_bindings. List operations provide a snapshot read of the
|
||||
underlying objects, returning a resource_version representing a consistent version
|
||||
of the listed objects.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
role_binding_list:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
items:
|
||||
description:
|
||||
- Items is a list of RoleBindings
|
||||
type: list
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value,
|
||||
and may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
role_ref:
|
||||
description:
|
||||
- RoleRef can reference a Role in the current namespace or a ClusterRole
|
||||
in the global namespace. If the RoleRef cannot be resolved, the Authorizer
|
||||
must return an error.
|
||||
type: complex
|
||||
subjects:
|
||||
description:
|
||||
- Subjects holds references to the objects the role applies to.
|
||||
type: list
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion holds the API group and version of the referenced subject.
|
||||
Defaults to "v1" for ServiceAccount subjects. Defaults to "rbac.authorization.k8s.io/v1alpha1"
|
||||
for User and Group subjects.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind of object being referenced. Values defined by this API group
|
||||
are "User", "Group", and "ServiceAccount". If the Authorizer does
|
||||
not recognized the kind value, the Authorizer should report an error.
|
||||
type: str
|
||||
name:
|
||||
description:
|
||||
- Name of the object being referenced.
|
||||
type: str
|
||||
namespace:
|
||||
description:
|
||||
- Namespace of the referenced object. If the object kind is non-namespace,
|
||||
such as "User" or "Group", and this value is not empty the Authorizer
|
||||
should report an error.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('role_binding_list', 'v1alpha1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,199 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1alpha1_role_list
|
||||
short_description: Kubernetes RoleList
|
||||
description:
|
||||
- Retrieve a list of roles. List operations provide a snapshot read of the underlying
|
||||
objects, returning a resource_version representing a consistent version of the listed
|
||||
objects.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
role_list:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
items:
|
||||
description:
|
||||
- Items is a list of Roles
|
||||
type: list
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value,
|
||||
and may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
rules:
|
||||
description:
|
||||
- Rules holds all the PolicyRules for this Role
|
||||
type: list
|
||||
contains:
|
||||
api_groups:
|
||||
description:
|
||||
- APIGroups is the name of the APIGroup that contains the resources.
|
||||
If multiple API groups are specified, any action requested against
|
||||
one of the enumerated resources in any API group will be allowed.
|
||||
type: list
|
||||
contains: str
|
||||
non_resource_ur_ls:
|
||||
description:
|
||||
- NonResourceURLs is a set of partial urls that a user should have access
|
||||
to. *s are allowed, but only as the full, final step in the path This
|
||||
name is intentionally different than the internal type so that the
|
||||
DefaultConvert works nicely and because the ordering may be different.
|
||||
Since non-resource URLs are not namespaced, this field is only applicable
|
||||
for ClusterRoles referenced from a ClusterRoleBinding. Rules can either
|
||||
apply to API resources (such as "pods" or "secrets") or non-resource
|
||||
URL paths (such as "/api"), but not both.
|
||||
type: list
|
||||
contains: str
|
||||
resource_names:
|
||||
description:
|
||||
- ResourceNames is an optional white list of names that the rule applies
|
||||
to. An empty set means that everything is allowed.
|
||||
type: list
|
||||
contains: str
|
||||
resources:
|
||||
description:
|
||||
- Resources is a list of resources this rule applies to. ResourceAll
|
||||
represents all resources.
|
||||
type: list
|
||||
contains: str
|
||||
verbs:
|
||||
description:
|
||||
- Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions
|
||||
contained in this rule. VerbAll represents all kinds.
|
||||
type: list
|
||||
contains: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('role_list', 'v1alpha1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,223 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1beta1_api_service
|
||||
short_description: Kubernetes APIService
|
||||
description:
|
||||
- Manage the lifecycle of a api_service object. Supports check mode, and attempts
|
||||
to to be idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
spec_ca_bundle:
|
||||
description:
|
||||
- CABundle is a PEM encoded CA bundle which will be used to validate an API server's
|
||||
serving certificate.
|
||||
aliases:
|
||||
- ca_bundle
|
||||
spec_group:
|
||||
description:
|
||||
- Group is the API group name this server hosts
|
||||
aliases:
|
||||
- group
|
||||
spec_group_priority_minimum:
|
||||
description:
|
||||
- "GroupPriorityMininum is the priority this group should have at least. Higher\
|
||||
\ priority means that the group is prefered by clients over lower priority ones.\
|
||||
\ Note that other versions of this group might specify even higher GroupPriorityMininum\
|
||||
\ values such that the whole group gets a higher priority. The primary sort\
|
||||
\ is based on GroupPriorityMinimum, ordered highest number to lowest (20 before\
|
||||
\ 10). The secondary sort is based on the alphabetical comparison of the name\
|
||||
\ of the object. (v1.bar before v1.foo) We'd recommend something like: *.k8s.io\
|
||||
\ (except extensions) at 18000 and PaaSes (OpenShift, Deis) are recommended\
|
||||
\ to be in the 2000s"
|
||||
aliases:
|
||||
- group_priority_minimum
|
||||
type: int
|
||||
spec_insecure_skip_tls_verify:
|
||||
description:
|
||||
- InsecureSkipTLSVerify disables TLS certificate verification when communicating
|
||||
with this server. This is strongly discouraged. You should use the CABundle
|
||||
instead.
|
||||
aliases:
|
||||
- insecure_skip_tls_verify
|
||||
type: bool
|
||||
spec_service_name:
|
||||
description:
|
||||
- Name is the name of the service
|
||||
aliases:
|
||||
- service_name
|
||||
spec_service_namespace:
|
||||
description:
|
||||
- Namespace is the namespace of the service
|
||||
aliases:
|
||||
- service_namespace
|
||||
spec_version:
|
||||
description:
|
||||
- Version is the API version this server hosts. For example, "v1"
|
||||
aliases:
|
||||
- version
|
||||
spec_version_priority:
|
||||
description:
|
||||
- VersionPriority controls the ordering of this API version inside of its group.
|
||||
Must be greater than zero. The primary sort is based on VersionPriority, ordered
|
||||
highest to lowest (20 before 10). The secondary sort is based on the alphabetical
|
||||
comparison of the name of the object. (v1.bar before v1.foo) Since it's inside
|
||||
of a group, the number can be small, probably in the 10s.
|
||||
aliases:
|
||||
- version_priority
|
||||
type: int
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
api_service:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description: []
|
||||
type: complex
|
||||
spec:
|
||||
description:
|
||||
- Spec contains information for locating and communicating with a server
|
||||
type: complex
|
||||
status:
|
||||
description:
|
||||
- Status contains derived information about an API server
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('api_service', 'v1beta1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,162 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1beta1_api_service_list
|
||||
short_description: Kubernetes APIServiceList
|
||||
description:
|
||||
- Retrieve a list of api_services. List operations provide a snapshot read of the
|
||||
underlying objects, returning a resource_version representing a consistent version
|
||||
of the listed objects.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
api_service_list:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
items:
|
||||
description: []
|
||||
type: list
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value,
|
||||
and may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description: []
|
||||
type: complex
|
||||
spec:
|
||||
description:
|
||||
- Spec contains information for locating and communicating with a server
|
||||
type: complex
|
||||
status:
|
||||
description:
|
||||
- Status contains derived information about an API server
|
||||
type: complex
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description: []
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('api_service_list', 'v1beta1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,197 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1beta1_certificate_signing_request
|
||||
short_description: Kubernetes CertificateSigningRequest
|
||||
description:
|
||||
- Manage the lifecycle of a certificate_signing_request object. Supports check mode,
|
||||
and attempts to to be idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
spec_extra:
|
||||
description:
|
||||
- Extra information about the requesting user. See user.Info interface for details.
|
||||
aliases:
|
||||
- extra
|
||||
type: dict
|
||||
spec_groups:
|
||||
description:
|
||||
- Group information about the requesting user. See user.Info interface for details.
|
||||
aliases:
|
||||
- groups
|
||||
type: list
|
||||
spec_request:
|
||||
description:
|
||||
- Base64-encoded PKCS
|
||||
aliases:
|
||||
- request
|
||||
spec_uid:
|
||||
description:
|
||||
- UID information about the requesting user. See user.Info interface for details.
|
||||
aliases:
|
||||
- uid
|
||||
spec_usages:
|
||||
description:
|
||||
- 'allowedUsages specifies a set of usage contexts the key will be valid for.
|
||||
See:'
|
||||
aliases:
|
||||
- usages
|
||||
type: list
|
||||
spec_username:
|
||||
description:
|
||||
- Information about the requesting user. See user.Info interface for details.
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
certificate_signing_request:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description: []
|
||||
type: complex
|
||||
spec:
|
||||
description:
|
||||
- The certificate request itself and any additional information.
|
||||
type: complex
|
||||
status:
|
||||
description:
|
||||
- Derived information about the request.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('certificate_signing_request', 'v1beta1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,162 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1beta1_certificate_signing_request_list
|
||||
short_description: Kubernetes CertificateSigningRequestList
|
||||
description:
|
||||
- Retrieve a list of certificate_signing_requests. List operations provide a snapshot
|
||||
read of the underlying objects, returning a resource_version representing a consistent
|
||||
version of the listed objects.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
certificate_signing_request_list:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
items:
|
||||
description: []
|
||||
type: list
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value,
|
||||
and may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description: []
|
||||
type: complex
|
||||
spec:
|
||||
description:
|
||||
- The certificate request itself and any additional information.
|
||||
type: complex
|
||||
status:
|
||||
description:
|
||||
- Derived information about the request.
|
||||
type: complex
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description: []
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('certificate_signing_request_list', 'v1beta1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,202 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1beta1_cluster_role
|
||||
short_description: Kubernetes ClusterRole
|
||||
description:
|
||||
- Manage the lifecycle of a cluster_role object. Supports check mode, and attempts
|
||||
to to be idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
rules:
|
||||
description:
|
||||
- Rules holds all the PolicyRules for this ClusterRole
|
||||
type: list
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
cluster_role:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
rules:
|
||||
description:
|
||||
- Rules holds all the PolicyRules for this ClusterRole
|
||||
type: list
|
||||
contains:
|
||||
api_groups:
|
||||
description:
|
||||
- APIGroups is the name of the APIGroup that contains the resources. If
|
||||
multiple API groups are specified, any action requested against one of
|
||||
the enumerated resources in any API group will be allowed.
|
||||
type: list
|
||||
contains: str
|
||||
non_resource_ur_ls:
|
||||
description:
|
||||
- NonResourceURLs is a set of partial urls that a user should have access
|
||||
to. *s are allowed, but only as the full, final step in the path Since
|
||||
non-resource URLs are not namespaced, this field is only applicable for
|
||||
ClusterRoles referenced from a ClusterRoleBinding. Rules can either apply
|
||||
to API resources (such as "pods" or "secrets") or non-resource URL paths
|
||||
(such as "/api"), but not both.
|
||||
type: list
|
||||
contains: str
|
||||
resource_names:
|
||||
description:
|
||||
- ResourceNames is an optional white list of names that the rule applies
|
||||
to. An empty set means that everything is allowed.
|
||||
type: list
|
||||
contains: str
|
||||
resources:
|
||||
description:
|
||||
- Resources is a list of resources this rule applies to. ResourceAll represents
|
||||
all resources.
|
||||
type: list
|
||||
contains: str
|
||||
verbs:
|
||||
description:
|
||||
- Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions
|
||||
contained in this rule. VerbAll represents all kinds.
|
||||
type: list
|
||||
contains: str
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('cluster_role', 'v1beta1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,207 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1beta1_cluster_role_binding
|
||||
short_description: Kubernetes ClusterRoleBinding
|
||||
description:
|
||||
- Manage the lifecycle of a cluster_role_binding object. Supports check mode, and
|
||||
attempts to to be idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
role_ref_api_group:
|
||||
description:
|
||||
- APIGroup is the group for the resource being referenced
|
||||
aliases:
|
||||
- api_group
|
||||
role_ref_kind:
|
||||
description:
|
||||
- Kind is the type of resource being referenced
|
||||
aliases:
|
||||
- kind
|
||||
role_ref_name:
|
||||
description:
|
||||
- Name is the name of resource being referenced
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
subjects:
|
||||
description:
|
||||
- Subjects holds references to the objects the role applies to.
|
||||
type: list
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
cluster_role_binding:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
role_ref:
|
||||
description:
|
||||
- RoleRef can only reference a ClusterRole in the global namespace. If the RoleRef
|
||||
cannot be resolved, the Authorizer must return an error.
|
||||
type: complex
|
||||
subjects:
|
||||
description:
|
||||
- Subjects holds references to the objects the role applies to.
|
||||
type: list
|
||||
contains:
|
||||
api_group:
|
||||
description:
|
||||
- APIGroup holds the API group of the referenced subject. Defaults to ""
|
||||
for ServiceAccount subjects. Defaults to "rbac.authorization.k8s.io" for
|
||||
User and Group subjects.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind of object being referenced. Values defined by this API group are
|
||||
"User", "Group", and "ServiceAccount". If the Authorizer does not recognized
|
||||
the kind value, the Authorizer should report an error.
|
||||
type: str
|
||||
name:
|
||||
description:
|
||||
- Name of the object being referenced.
|
||||
type: str
|
||||
namespace:
|
||||
description:
|
||||
- Namespace of the referenced object. If the object kind is non-namespace,
|
||||
such as "User" or "Group", and this value is not empty the Authorizer
|
||||
should report an error.
|
||||
type: str
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('cluster_role_binding', 'v1beta1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,189 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1beta1_cluster_role_binding_list
|
||||
short_description: Kubernetes ClusterRoleBindingList
|
||||
description:
|
||||
- Retrieve a list of cluster_role_bindings. List operations provide a snapshot read
|
||||
of the underlying objects, returning a resource_version representing a consistent
|
||||
version of the listed objects.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
cluster_role_binding_list:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
items:
|
||||
description:
|
||||
- Items is a list of ClusterRoleBindings
|
||||
type: list
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value,
|
||||
and may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
role_ref:
|
||||
description:
|
||||
- RoleRef can only reference a ClusterRole in the global namespace. If the
|
||||
RoleRef cannot be resolved, the Authorizer must return an error.
|
||||
type: complex
|
||||
subjects:
|
||||
description:
|
||||
- Subjects holds references to the objects the role applies to.
|
||||
type: list
|
||||
contains:
|
||||
api_group:
|
||||
description:
|
||||
- APIGroup holds the API group of the referenced subject. Defaults to
|
||||
"" for ServiceAccount subjects. Defaults to "rbac.authorization.k8s.io"
|
||||
for User and Group subjects.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind of object being referenced. Values defined by this API group
|
||||
are "User", "Group", and "ServiceAccount". If the Authorizer does
|
||||
not recognized the kind value, the Authorizer should report an error.
|
||||
type: str
|
||||
name:
|
||||
description:
|
||||
- Name of the object being referenced.
|
||||
type: str
|
||||
namespace:
|
||||
description:
|
||||
- Namespace of the referenced object. If the object kind is non-namespace,
|
||||
such as "User" or "Group", and this value is not empty the Authorizer
|
||||
should report an error.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('cluster_role_binding_list', 'v1beta1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,197 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1beta1_cluster_role_list
|
||||
short_description: Kubernetes ClusterRoleList
|
||||
description:
|
||||
- Retrieve a list of cluster_roles. List operations provide a snapshot read of the
|
||||
underlying objects, returning a resource_version representing a consistent version
|
||||
of the listed objects.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
cluster_role_list:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
items:
|
||||
description:
|
||||
- Items is a list of ClusterRoles
|
||||
type: list
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value,
|
||||
and may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
rules:
|
||||
description:
|
||||
- Rules holds all the PolicyRules for this ClusterRole
|
||||
type: list
|
||||
contains:
|
||||
api_groups:
|
||||
description:
|
||||
- APIGroups is the name of the APIGroup that contains the resources.
|
||||
If multiple API groups are specified, any action requested against
|
||||
one of the enumerated resources in any API group will be allowed.
|
||||
type: list
|
||||
contains: str
|
||||
non_resource_ur_ls:
|
||||
description:
|
||||
- NonResourceURLs is a set of partial urls that a user should have access
|
||||
to. *s are allowed, but only as the full, final step in the path Since
|
||||
non-resource URLs are not namespaced, this field is only applicable
|
||||
for ClusterRoles referenced from a ClusterRoleBinding. Rules can either
|
||||
apply to API resources (such as "pods" or "secrets") or non-resource
|
||||
URL paths (such as "/api"), but not both.
|
||||
type: list
|
||||
contains: str
|
||||
resource_names:
|
||||
description:
|
||||
- ResourceNames is an optional white list of names that the rule applies
|
||||
to. An empty set means that everything is allowed.
|
||||
type: list
|
||||
contains: str
|
||||
resources:
|
||||
description:
|
||||
- Resources is a list of resources this rule applies to. ResourceAll
|
||||
represents all resources.
|
||||
type: list
|
||||
contains: str
|
||||
verbs:
|
||||
description:
|
||||
- Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions
|
||||
contained in this rule. VerbAll represents all kinds.
|
||||
type: list
|
||||
contains: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('cluster_role_list', 'v1beta1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,175 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1beta1_controller_revision
|
||||
short_description: Kubernetes ControllerRevision
|
||||
description:
|
||||
- Manage the lifecycle of a controller_revision object. Supports check mode, and attempts
|
||||
to to be idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
data_raw:
|
||||
description:
|
||||
- Raw is the underlying serialization of this object.
|
||||
aliases:
|
||||
- raw
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
revision:
|
||||
description:
|
||||
- Revision indicates the revision of the state represented by Data.
|
||||
type: int
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
controller_revision:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
data:
|
||||
description:
|
||||
- Data is the serialized representation of the state.
|
||||
type: complex
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
revision:
|
||||
description:
|
||||
- Revision indicates the revision of the state represented by Data.
|
||||
type: int
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('controller_revision', 'v1beta1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,165 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1beta1_controller_revision_list
|
||||
short_description: Kubernetes ControllerRevisionList
|
||||
description:
|
||||
- Retrieve a list of controller_revisions. List operations provide a snapshot read
|
||||
of the underlying objects, returning a resource_version representing a consistent
|
||||
version of the listed objects.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
controller_revision_list:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
items:
|
||||
description:
|
||||
- Items is the list of ControllerRevisions
|
||||
type: list
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value,
|
||||
and may reject unrecognized values.
|
||||
type: str
|
||||
data:
|
||||
description:
|
||||
- Data is the serialized representation of the state.
|
||||
type: complex
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
revision:
|
||||
description:
|
||||
- Revision indicates the revision of the state represented by Data.
|
||||
type: int
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- ''
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('controller_revision_list', 'v1beta1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,616 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1beta1_cron_job
|
||||
short_description: Kubernetes CronJob
|
||||
description:
|
||||
- Manage the lifecycle of a cron_job object. Supports check mode, and attempts to
|
||||
to be idempotent.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
spec_concurrency_policy:
|
||||
description:
|
||||
- Specifies how to treat concurrent executions of a Job. Defaults to Allow.
|
||||
aliases:
|
||||
- concurrency_policy
|
||||
spec_failed_jobs_history_limit:
|
||||
description:
|
||||
- The number of failed finished jobs to retain. This is a pointer to distinguish
|
||||
between explicit zero and not specified. Defaults to 1.
|
||||
aliases:
|
||||
- failed_jobs_history_limit
|
||||
type: int
|
||||
spec_job_template_metadata_annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
aliases:
|
||||
- job__metadata_annotations
|
||||
type: dict
|
||||
spec_job_template_metadata_labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
aliases:
|
||||
- job__metadata_labels
|
||||
type: dict
|
||||
spec_job_template_metadata_name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
aliases:
|
||||
- job__metadata_name
|
||||
spec_job_template_metadata_namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
aliases:
|
||||
- job__metadata_namespace
|
||||
spec_job_template_spec_active_deadline_seconds:
|
||||
description:
|
||||
- Specifies the duration in seconds relative to the startTime that the job may
|
||||
be active before the system tries to terminate it; value must be positive integer
|
||||
aliases:
|
||||
- job__active_deadline_seconds
|
||||
type: int
|
||||
spec_job_template_spec_backoff_limit:
|
||||
description:
|
||||
- Specifies the number of retries before marking this job failed. Defaults to
|
||||
6
|
||||
aliases:
|
||||
- job__backoff_limit
|
||||
type: int
|
||||
spec_job_template_spec_completions:
|
||||
description:
|
||||
- Specifies the desired number of successfully finished pods the job should be
|
||||
run with. Setting to nil means that the success of any pod signals the success
|
||||
of all pods, and allows parallelism to have any positive value. Setting to 1
|
||||
means that parallelism is limited to 1 and the success of that pod signals the
|
||||
success of the job.
|
||||
aliases:
|
||||
- job__completions
|
||||
type: int
|
||||
spec_job_template_spec_manual_selector:
|
||||
description:
|
||||
- manualSelector controls generation of pod labels and pod selectors. Leave `manualSelector`
|
||||
unset unless you are certain what you are doing. When false or unset, the system
|
||||
pick labels unique to this job and appends those labels to the pod template.
|
||||
When true, the user is responsible for picking unique labels and specifying
|
||||
the selector. Failure to pick a unique label may cause this and other jobs to
|
||||
not function correctly. However, You may see `manualSelector=true` in jobs that
|
||||
were created with the old `extensions/v1beta1` API.
|
||||
aliases:
|
||||
- job__manual_selector
|
||||
type: bool
|
||||
spec_job_template_spec_parallelism:
|
||||
description:
|
||||
- Specifies the maximum desired number of pods the job should run at any given
|
||||
time. The actual number of pods running in steady state will be less than this
|
||||
number when ((.spec.completions - .status.successful) < .spec.parallelism),
|
||||
i.e. when the work left to do is less than max parallelism.
|
||||
aliases:
|
||||
- job__parallelism
|
||||
type: int
|
||||
spec_job_template_spec_selector_match_expressions:
|
||||
description:
|
||||
- matchExpressions is a list of label selector requirements. The requirements
|
||||
are ANDed.
|
||||
aliases:
|
||||
- job__selector_match_expressions
|
||||
type: list
|
||||
spec_job_template_spec_selector_match_labels:
|
||||
description:
|
||||
- matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
|
||||
map is equivalent to an element of matchExpressions, whose key field is "key",
|
||||
the operator is "In", and the values array contains only "value". The requirements
|
||||
are ANDed.
|
||||
aliases:
|
||||
- job__selector_match_labels
|
||||
type: dict
|
||||
spec_job_template_spec_template_metadata_annotations:
|
||||
description:
|
||||
- Annotations is an unstructured key value map stored with a resource that may
|
||||
be set by external tools to store and retrieve arbitrary metadata. They are
|
||||
not queryable and should be preserved when modifying objects.
|
||||
type: dict
|
||||
spec_job_template_spec_template_metadata_labels:
|
||||
description:
|
||||
- Map of string keys and values that can be used to organize and categorize (scope
|
||||
and select) objects. May match selectors of replication controllers and services.
|
||||
type: dict
|
||||
spec_job_template_spec_template_metadata_name:
|
||||
description:
|
||||
- Name must be unique within a namespace. Is required when creating resources,
|
||||
although some resources may allow a client to request the generation of an appropriate
|
||||
name automatically. Name is primarily intended for creation idempotence and
|
||||
configuration definition. Cannot be updated.
|
||||
spec_job_template_spec_template_metadata_namespace:
|
||||
description:
|
||||
- Namespace defines the space within each name must be unique. An empty namespace
|
||||
is equivalent to the "default" namespace, but "default" is the canonical representation.
|
||||
Not all objects are required to be scoped to a namespace - the value of this
|
||||
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
|
||||
spec_job_template_spec_template_spec_active_deadline_seconds:
|
||||
description:
|
||||
- Optional duration in seconds the pod may be active on the node relative to StartTime
|
||||
before the system will actively try to mark it failed and kill associated containers.
|
||||
Value must be a positive integer.
|
||||
type: int
|
||||
spec_job_template_spec_template_spec_affinity_node_affinity_preferred_during_scheduling_ignored_during_execution:
|
||||
description:
|
||||
- The scheduler will prefer to schedule pods to nodes that satisfy the affinity
|
||||
expressions specified by this field, but it may choose a node that violates
|
||||
one or more of the expressions. The node that is most preferred is the one with
|
||||
the greatest sum of weights, i.e. for each node that meets all of the scheduling
|
||||
requirements (resource request, requiredDuringScheduling affinity expressions,
|
||||
etc.), compute a sum by iterating through the elements of this field and adding
|
||||
"weight" to the sum if the node matches the corresponding matchExpressions;
|
||||
the node(s) with the highest sum are the most preferred.
|
||||
aliases:
|
||||
- job__affinity_node_affinity_preferred_during_scheduling_ignored_during_execution
|
||||
type: list
|
||||
? spec_job_template_spec_template_spec_affinity_node_affinity_required_during_scheduling_ignored_during_execution_node_selector_terms
|
||||
: description:
|
||||
- Required. A list of node selector terms. The terms are ORed.
|
||||
aliases:
|
||||
- job__affinity_node_affinity_required_during_scheduling_ignored_during_execution_node_selector_terms
|
||||
type: list
|
||||
spec_job_template_spec_template_spec_affinity_pod_affinity_preferred_during_scheduling_ignored_during_execution:
|
||||
description:
|
||||
- The scheduler will prefer to schedule pods to nodes that satisfy the affinity
|
||||
expressions specified by this field, but it may choose a node that violates
|
||||
one or more of the expressions. The node that is most preferred is the one with
|
||||
the greatest sum of weights, i.e. for each node that meets all of the scheduling
|
||||
requirements (resource request, requiredDuringScheduling affinity expressions,
|
||||
etc.), compute a sum by iterating through the elements of this field and adding
|
||||
"weight" to the sum if the node has pods which matches the corresponding podAffinityTerm;
|
||||
the node(s) with the highest sum are the most preferred.
|
||||
aliases:
|
||||
- job__affinity_pod_affinity_preferred_during_scheduling_ignored_during_execution
|
||||
type: list
|
||||
spec_job_template_spec_template_spec_affinity_pod_affinity_required_during_scheduling_ignored_during_execution:
|
||||
description:
|
||||
- If the affinity requirements specified by this field are not met at scheduling
|
||||
time, the pod will not be scheduled onto the node. If the affinity requirements
|
||||
specified by this field cease to be met at some point during pod execution (e.g.
|
||||
due to a pod label update), the system may or may not try to eventually evict
|
||||
the pod from its node. When there are multiple elements, the lists of nodes
|
||||
corresponding to each podAffinityTerm are intersected, i.e. all terms must be
|
||||
satisfied.
|
||||
aliases:
|
||||
- job__affinity_pod_affinity_required_during_scheduling_ignored_during_execution
|
||||
type: list
|
||||
spec_job_template_spec_template_spec_affinity_pod_anti_affinity_preferred_during_scheduling_ignored_during_execution:
|
||||
description:
|
||||
- The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity
|
||||
expressions specified by this field, but it may choose a node that violates
|
||||
one or more of the expressions. The node that is most preferred is the one with
|
||||
the greatest sum of weights, i.e. for each node that meets all of the scheduling
|
||||
requirements (resource request, requiredDuringScheduling anti-affinity expressions,
|
||||
etc.), compute a sum by iterating through the elements of this field and adding
|
||||
"weight" to the sum if the node has pods which matches the corresponding podAffinityTerm;
|
||||
the node(s) with the highest sum are the most preferred.
|
||||
aliases:
|
||||
- job__affinity_pod_anti_affinity_preferred_during_scheduling_ignored_during_execution
|
||||
type: list
|
||||
spec_job_template_spec_template_spec_affinity_pod_anti_affinity_required_during_scheduling_ignored_during_execution:
|
||||
description:
|
||||
- If the anti-affinity requirements specified by this field are not met at scheduling
|
||||
time, the pod will not be scheduled onto the node. If the anti-affinity requirements
|
||||
specified by this field cease to be met at some point during pod execution (e.g.
|
||||
due to a pod label update), the system may or may not try to eventually evict
|
||||
the pod from its node. When there are multiple elements, the lists of nodes
|
||||
corresponding to each podAffinityTerm are intersected, i.e. all terms must be
|
||||
satisfied.
|
||||
aliases:
|
||||
- job__affinity_pod_anti_affinity_required_during_scheduling_ignored_during_execution
|
||||
type: list
|
||||
spec_job_template_spec_template_spec_automount_service_account_token:
|
||||
description:
|
||||
- AutomountServiceAccountToken indicates whether a service account token should
|
||||
be automatically mounted.
|
||||
aliases:
|
||||
- job__automount_service_account_token
|
||||
type: bool
|
||||
spec_job_template_spec_template_spec_containers:
|
||||
description:
|
||||
- List of containers belonging to the pod. Containers cannot currently be added
|
||||
or removed. There must be at least one container in a Pod. Cannot be updated.
|
||||
aliases:
|
||||
- job__containers
|
||||
type: list
|
||||
spec_job_template_spec_template_spec_dns_policy:
|
||||
description:
|
||||
- Set DNS policy for containers within the pod. One of 'ClusterFirstWithHostNet',
|
||||
'ClusterFirst' or 'Default'. Defaults to "ClusterFirst". To have DNS options
|
||||
set along with hostNetwork, you have to specify DNS policy explicitly to 'ClusterFirstWithHostNet'.
|
||||
aliases:
|
||||
- job__dns_policy
|
||||
spec_job_template_spec_template_spec_host_aliases:
|
||||
description:
|
||||
- HostAliases is an optional list of hosts and IPs that will be injected into
|
||||
the pod's hosts file if specified. This is only valid for non-hostNetwork pods.
|
||||
aliases:
|
||||
- job__host_aliases
|
||||
type: list
|
||||
spec_job_template_spec_template_spec_host_ipc:
|
||||
description:
|
||||
- "Use the host's ipc namespace. Optional: Default to false."
|
||||
aliases:
|
||||
- job__host_ipc
|
||||
type: bool
|
||||
spec_job_template_spec_template_spec_host_network:
|
||||
description:
|
||||
- Host networking requested for this pod. Use the host's network namespace. If
|
||||
this option is set, the ports that will be used must be specified. Default to
|
||||
false.
|
||||
aliases:
|
||||
- job__host_network
|
||||
type: bool
|
||||
spec_job_template_spec_template_spec_host_pid:
|
||||
description:
|
||||
- "Use the host's pid namespace. Optional: Default to false."
|
||||
aliases:
|
||||
- job__host_pid
|
||||
type: bool
|
||||
spec_job_template_spec_template_spec_hostname:
|
||||
description:
|
||||
- Specifies the hostname of the Pod If not specified, the pod's hostname will
|
||||
be set to a system-defined value.
|
||||
aliases:
|
||||
- job__hostname
|
||||
spec_job_template_spec_template_spec_image_pull_secrets:
|
||||
description:
|
||||
- ImagePullSecrets is an optional list of references to secrets in the same namespace
|
||||
to use for pulling any of the images used by this PodSpec. If specified, these
|
||||
secrets will be passed to individual puller implementations for them to use.
|
||||
For example, in the case of docker, only DockerConfig type secrets are honored.
|
||||
aliases:
|
||||
- job__image_pull_secrets
|
||||
type: list
|
||||
spec_job_template_spec_template_spec_init_containers:
|
||||
description:
|
||||
- List of initialization containers belonging to the pod. Init containers are
|
||||
executed in order prior to containers being started. If any init container fails,
|
||||
the pod is considered to have failed and is handled according to its restartPolicy.
|
||||
The name for an init container or normal container must be unique among all
|
||||
containers. Init containers may not have Lifecycle actions, Readiness probes,
|
||||
or Liveness probes. The resourceRequirements of an init container are taken
|
||||
into account during scheduling by finding the highest request/limit for each
|
||||
resource type, and then using the max of of that value or the sum of the normal
|
||||
containers. Limits are applied to init containers in a similar fashion. Init
|
||||
containers cannot currently be added or removed. Cannot be updated.
|
||||
aliases:
|
||||
- job__init_containers
|
||||
type: list
|
||||
spec_job_template_spec_template_spec_node_name:
|
||||
description:
|
||||
- NodeName is a request to schedule this pod onto a specific node. If it is non-empty,
|
||||
the scheduler simply schedules this pod onto that node, assuming that it fits
|
||||
resource requirements.
|
||||
aliases:
|
||||
- job__node_name
|
||||
spec_job_template_spec_template_spec_node_selector:
|
||||
description:
|
||||
- NodeSelector is a selector which must be true for the pod to fit on a node.
|
||||
Selector which must match a node's labels for the pod to be scheduled on that
|
||||
node.
|
||||
aliases:
|
||||
- job__node_selector
|
||||
type: dict
|
||||
spec_job_template_spec_template_spec_priority:
|
||||
description:
|
||||
- The priority value. Various system components use this field to find the priority
|
||||
of the pod. When Priority Admission Controller is enabled, it prevents users
|
||||
from setting this field. The admission controller populates this field from
|
||||
PriorityClassName. The higher the value, the higher the priority.
|
||||
aliases:
|
||||
- job__priority
|
||||
type: int
|
||||
spec_job_template_spec_template_spec_priority_class_name:
|
||||
description:
|
||||
- If specified, indicates the pod's priority. "SYSTEM" is a special keyword which
|
||||
indicates the highest priority. Any other name must be defined by creating a
|
||||
PriorityClass object with that name. If not specified, the pod priority will
|
||||
be default or zero if there is no default.
|
||||
aliases:
|
||||
- job__priority_class_name
|
||||
spec_job_template_spec_template_spec_restart_policy:
|
||||
description:
|
||||
- Restart policy for all containers within the pod. One of Always, OnFailure,
|
||||
Never. Default to Always.
|
||||
aliases:
|
||||
- job__restart_policy
|
||||
spec_job_template_spec_template_spec_scheduler_name:
|
||||
description:
|
||||
- If specified, the pod will be dispatched by specified scheduler. If not specified,
|
||||
the pod will be dispatched by default scheduler.
|
||||
aliases:
|
||||
- job__scheduler_name
|
||||
spec_job_template_spec_template_spec_security_context_fs_group:
|
||||
description:
|
||||
- "A special supplemental group that applies to all containers in a pod. Some\
|
||||
\ volume types allow the Kubelet to change the ownership of that volume to be\
|
||||
\ owned by the pod: 1. The owning GID will be the FSGroup 2. The setgid bit\
|
||||
\ is set (new files created in the volume will be owned by FSGroup) 3. The permission\
|
||||
\ bits are OR'd with rw-rw---- If unset, the Kubelet will not modify the ownership\
|
||||
\ and permissions of any volume."
|
||||
aliases:
|
||||
- job__securitycontext_fs_group
|
||||
type: int
|
||||
spec_job_template_spec_template_spec_security_context_run_as_non_root:
|
||||
description:
|
||||
- Indicates that the container must run as a non-root user. If true, the Kubelet
|
||||
will validate the image at runtime to ensure that it does not run as UID 0 (root)
|
||||
and fail to start the container if it does. If unset or false, no such validation
|
||||
will be performed. May also be set in SecurityContext. If set in both SecurityContext
|
||||
and PodSecurityContext, the value specified in SecurityContext takes precedence.
|
||||
aliases:
|
||||
- job__securitycontext_run_as_non_root
|
||||
type: bool
|
||||
spec_job_template_spec_template_spec_security_context_run_as_user:
|
||||
description:
|
||||
- The UID to run the entrypoint of the container process. Defaults to user specified
|
||||
in image metadata if unspecified. May also be set in SecurityContext. If set
|
||||
in both SecurityContext and PodSecurityContext, the value specified in SecurityContext
|
||||
takes precedence for that container.
|
||||
aliases:
|
||||
- job__securitycontext_run_as_user
|
||||
type: int
|
||||
spec_job_template_spec_template_spec_security_context_se_linux_options_level:
|
||||
description:
|
||||
- Level is SELinux level label that applies to the container.
|
||||
aliases:
|
||||
- job__securitycontext_se_linux_options_level
|
||||
spec_job_template_spec_template_spec_security_context_se_linux_options_role:
|
||||
description:
|
||||
- Role is a SELinux role label that applies to the container.
|
||||
aliases:
|
||||
- job__securitycontext_se_linux_options_role
|
||||
spec_job_template_spec_template_spec_security_context_se_linux_options_type:
|
||||
description:
|
||||
- Type is a SELinux type label that applies to the container.
|
||||
aliases:
|
||||
- job__securitycontext_se_linux_options_type
|
||||
spec_job_template_spec_template_spec_security_context_se_linux_options_user:
|
||||
description:
|
||||
- User is a SELinux user label that applies to the container.
|
||||
aliases:
|
||||
- job__securitycontext_se_linux_options_user
|
||||
spec_job_template_spec_template_spec_security_context_supplemental_groups:
|
||||
description:
|
||||
- A list of groups applied to the first process run in each container, in addition
|
||||
to the container's primary GID. If unspecified, no groups will be added to any
|
||||
container.
|
||||
aliases:
|
||||
- job__securitycontext_supplemental_groups
|
||||
type: list
|
||||
spec_job_template_spec_template_spec_service_account:
|
||||
description:
|
||||
- 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. Deprecated:
|
||||
Use serviceAccountName instead.'
|
||||
aliases:
|
||||
- job__service_account
|
||||
spec_job_template_spec_template_spec_service_account_name:
|
||||
description:
|
||||
- ServiceAccountName is the name of the ServiceAccount to use to run this pod.
|
||||
aliases:
|
||||
- job__service_account_name
|
||||
spec_job_template_spec_template_spec_subdomain:
|
||||
description:
|
||||
- If specified, the fully qualified Pod hostname will be "<hostname>.<subdomain>.<pod
|
||||
namespace>.svc.<cluster domain>". If not specified, the pod will not have a
|
||||
domainname at all.
|
||||
aliases:
|
||||
- job__subdomain
|
||||
spec_job_template_spec_template_spec_termination_grace_period_seconds:
|
||||
description:
|
||||
- Optional duration in seconds the pod needs to terminate gracefully. May be decreased
|
||||
in delete request. Value must be non-negative integer. The value zero indicates
|
||||
delete immediately. If this value is nil, the default grace period will be used
|
||||
instead. The grace period is the duration in seconds after the processes running
|
||||
in the pod are sent a termination signal and the time when the processes are
|
||||
forcibly halted with a kill signal. Set this value longer than the expected
|
||||
cleanup time for your process. Defaults to 30 seconds.
|
||||
aliases:
|
||||
- job__termination_grace_period_seconds
|
||||
type: int
|
||||
spec_job_template_spec_template_spec_tolerations:
|
||||
description:
|
||||
- If specified, the pod's tolerations.
|
||||
aliases:
|
||||
- job__tolerations
|
||||
type: list
|
||||
spec_job_template_spec_template_spec_volumes:
|
||||
description:
|
||||
- List of volumes that can be mounted by containers belonging to the pod.
|
||||
aliases:
|
||||
- job__volumes
|
||||
type: list
|
||||
spec_schedule:
|
||||
description:
|
||||
- The schedule in Cron format, see
|
||||
aliases:
|
||||
- schedule
|
||||
spec_starting_deadline_seconds:
|
||||
description:
|
||||
- Optional deadline in seconds for starting the job if it misses scheduled time
|
||||
for any reason. Missed jobs executions will be counted as failed ones.
|
||||
aliases:
|
||||
- starting_deadline_seconds
|
||||
type: int
|
||||
spec_successful_jobs_history_limit:
|
||||
description:
|
||||
- The number of successful finished jobs to retain. This is a pointer to distinguish
|
||||
between explicit zero and not specified. Defaults to 3.
|
||||
aliases:
|
||||
- successful_jobs_history_limit
|
||||
type: int
|
||||
spec_suspend:
|
||||
description:
|
||||
- This flag tells the controller to suspend subsequent executions, it does not
|
||||
apply to already started executions. Defaults to false.
|
||||
aliases:
|
||||
- suspend
|
||||
type: bool
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
cron_job:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
spec:
|
||||
description:
|
||||
- Specification of the desired behavior of a cron job, including the schedule.
|
||||
type: complex
|
||||
status:
|
||||
description:
|
||||
- Current status of a cron job.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('cron_job', 'v1beta1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,165 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: k8s_v1beta1_cron_job_list
|
||||
short_description: Kubernetes CronJobList
|
||||
description:
|
||||
- Retrieve a list of cron_jobs. List operations provide a snapshot read of the underlying
|
||||
objects, returning a resource_version representing a consistent version of the listed
|
||||
objects.
|
||||
version_added: 2.3.0
|
||||
author: OpenShift (@openshift)
|
||||
options:
|
||||
api_key:
|
||||
description:
|
||||
- Token used to connect to the API.
|
||||
cert_file:
|
||||
description:
|
||||
- Path to a certificate used to authenticate with the API.
|
||||
type: path
|
||||
context:
|
||||
description:
|
||||
- The name of a context found in the Kubernetes config file.
|
||||
debug:
|
||||
description:
|
||||
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
|
||||
default: false
|
||||
type: bool
|
||||
force:
|
||||
description:
|
||||
- If set to C(True), and I(state) is C(present), an existing object will updated,
|
||||
and lists will be replaced, rather than merged.
|
||||
default: false
|
||||
type: bool
|
||||
host:
|
||||
description:
|
||||
- Provide a URL for acessing the Kubernetes API.
|
||||
key_file:
|
||||
description:
|
||||
- Path to a key file used to authenticate with the API.
|
||||
type: path
|
||||
kubeconfig:
|
||||
description:
|
||||
- Path to an existing Kubernetes config file. If not provided, and no other connection
|
||||
options are provided, the openshift client will attempt to load the default
|
||||
configuration file from I(~/.kube/config.json).
|
||||
type: path
|
||||
password:
|
||||
description:
|
||||
- Provide a password for connecting to the API. Use in conjunction with I(username).
|
||||
resource_definition:
|
||||
description:
|
||||
- Provide the YAML definition for the object, bypassing any modules parameters
|
||||
intended to define object attributes.
|
||||
type: dict
|
||||
src:
|
||||
description:
|
||||
- Provide a path to a file containing the YAML definition of the object. Mutually
|
||||
exclusive with I(resource_definition).
|
||||
type: path
|
||||
ssl_ca_cert:
|
||||
description:
|
||||
- Path to a CA certificate used to authenticate with the API.
|
||||
type: path
|
||||
state:
|
||||
description:
|
||||
- Determines if an object should be created, patched, or deleted. When set to
|
||||
C(present), the object will be created, if it does not exist, or patched, if
|
||||
parameter values differ from the existing object's attributes, and deleted,
|
||||
if set to C(absent). A patch operation results in merging lists and updating
|
||||
dictionaries, with lists being merged into a unique set of values. If a list
|
||||
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
|
||||
is performed, where individual elements with a matching I(name_) or I(type)
|
||||
are merged. To force the replacement of lists, set the I(force) option to C(True).
|
||||
default: present
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
username:
|
||||
description:
|
||||
- Provide a username for connecting to the API.
|
||||
verify_ssl:
|
||||
description:
|
||||
- Whether or not to verify the API server's SSL certificates.
|
||||
type: bool
|
||||
requirements:
|
||||
- kubernetes == 4.0.0
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
api_version:
|
||||
description: Requested API version
|
||||
type: string
|
||||
cron_job_list:
|
||||
type: complex
|
||||
returned: when I(state) = C(present)
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
type: str
|
||||
items:
|
||||
description:
|
||||
- items is the list of CronJobs.
|
||||
type: list
|
||||
contains:
|
||||
api_version:
|
||||
description:
|
||||
- APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value,
|
||||
and may reject unrecognized values.
|
||||
type: str
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard object's metadata.
|
||||
type: complex
|
||||
spec:
|
||||
description:
|
||||
- Specification of the desired behavior of a cron job, including the schedule.
|
||||
type: complex
|
||||
status:
|
||||
description:
|
||||
- Current status of a cron job.
|
||||
type: complex
|
||||
kind:
|
||||
description:
|
||||
- Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to. Cannot
|
||||
be updated. In CamelCase.
|
||||
type: str
|
||||
metadata:
|
||||
description:
|
||||
- Standard list metadata.
|
||||
type: complex
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
module = KubernetesAnsibleModule('cron_job_list', 'v1beta1')
|
||||
except KubernetesAnsibleException as exc:
|
||||
# The helper failed to init, so there is no module object. All we can do is raise the error.
|
||||
raise Exception(exc.message)
|
||||
|
||||
try:
|
||||
module.execute_module()
|
||||
except KubernetesAnsibleException as exc:
|
||||
module.fail_json(msg="Module failed!", error=str(exc))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user