Init: mediaserver

This commit is contained in:
2023-02-08 12:13:28 +01:00
parent 848bc9739c
commit f7c23d4ba9
31914 changed files with 6175775 additions and 0 deletions

View File

@@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
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.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
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.
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.
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.
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.
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.
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.
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.
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.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"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.
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.
A "covered work" means either the unmodified Program or a work based
on the Program.
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.
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.
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.
1. Source Code.
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.
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.
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.
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.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
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.
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>.

View File

@@ -0,0 +1,43 @@
{
"collection_info": {
"namespace": "dellemc",
"name": "enterprise_sonic",
"version": "2.0.0",
"authors": [
"Senthil Kumar Ganesan <Senthil_Kumar_Ganesa@Dell.com>",
"Abirami <Abirami_N@Dell.com>",
"Dhivya <Dhivya_P@Dell.com>",
"Mohamed Javeed <Mohamed_Javeed_Faroo@Dell.com>",
"Nirai Madai <Niraimadaiselvam_Mar@Dell.com>",
"Shade Talabi <Shade_Talabi@Dell.com>",
"Kerry Meyer <Kerry_Meyer@Dell.com>",
"Mingjun Zhang <Mingjun_Zhang@Dell.com>"
],
"readme": "README.md",
"tags": [
"dellemc",
"dell",
"networking",
"nos",
"sonic"
],
"description": "Ansible Network Collection for Enterprise SONiC Distribution by Dell Technologies",
"license": [],
"license_file": "LICENSE",
"dependencies": {
"ansible.netcommon": ">=2.0.0"
},
"repository": "https://github.com/ansible-collections/dellemc.enterprise_sonic",
"documentation": null,
"homepage": null,
"issues": "https://github.com/ansible-collections/dellemc.enterprise_sonic/issues"
},
"file_manifest_file": {
"name": "FILES.json",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "f419780826940a762216126025170e01d39987da0d8fb273560a2488307493f5",
"format": 1
},
"format": 1
}

View File

@@ -0,0 +1,253 @@
Ansible Network Collection for Enterprise SONiC Distribution by Dell Technologies
=================================================================================
This collection includes Ansible core modules, network resource modules, and plugins needed to provision and manage Dell EMC PowerSwitch platforms running Enterprise SONiC Distribution by Dell Technologies. Sample playbooks and documentation are also included to show how the collection can be used.
Supported connections
---------------------
The SONiC Ansible collection supports network_cli and httpapi connections.
Plugins
--------
**CLICONF plugin**
Name | Description
--- | ---
[network_cli](https://github.com/ansible-collections/dellemc.enterprise_sonic)|Use Ansible CLICONF to run commands on Enterprise SONiC
**HTTPAPI plugin**
Name | Description
--- | ---
[httpapi](https://github.com/ansible-collections/dellemc.enterprise_sonic)|Use Ansible HTTPAPI to run commands on Enterprise SONiC
Collection core modules
------------------------
Name | Description | Connection type
--- | --- | ---
[**sonic_command**](https://docs.ansible.com/ansible/latest/collections/dellemc/enterprise_sonic/sonic_command_module.html#ansible-collections-dellemc-enterprise-sonic-sonic-command-module)|Run commands through the Management Framework CLI|network_cli
[**sonic_config**](https://docs.ansible.com/ansible/latest/collections/dellemc/enterprise_sonic/sonic_config_module.html#ansible-collections-dellemc-enterprise-sonic-sonic-config-module)|Manage configuration through the Management Framework CLI|network_cli
[**sonic_api**](https://docs.ansible.com/ansible/latest/collections/dellemc/enterprise_sonic/sonic_api_module.html#ansible-collections-dellemc-enterprise-sonic-sonic-api-module)|Perform REST operations through the Management Framework REST API|httpapi
Collection network resource modules
-----------------------------------
Listed are the SONiC Ansible network resource modules which need ***httpapi*** as the connection type. Supported operations are ***merged*** and ***deleted***.
| **Interfaces** | **BGP** | **VRF** | **Users** |
| -------------- | ------- | ------- | ------- |
| [**sonic_interfaces**](https://docs.ansible.com/ansible/latest/collections/dellemc/enterprise_sonic/sonic_interfaces_module.html#ansible-collections-dellemc-enterprise-sonic-sonic-interfaces-module)|[**sonic_bgp**](https://docs.ansible.com/ansible/latest/collections/dellemc/enterprise_sonic/sonic_bgp_module.html#ansible-collections-dellemc-enterprise-sonic-sonic-bgp-module)| [**sonic_vrfs**](https://docs.ansible.com/ansible/latest/collections/dellemc/enterprise_sonic/sonic_vrfs_module.html#ansible-collections-dellemc-enterprise-sonic-sonic-vrfs-module)|[**sonic_users**](https://docs.ansible.com/ansible/latest/collections/dellemc/enterprise_sonic/sonic_users_module.html#ansible-collections-dellemc-enterprise-sonic-sonic-users-module)|
| [**sonic_l2_interfaces**](https://docs.ansible.com/ansible/latest/collections/dellemc/enterprise_sonic/sonic_l2_interfaces_module.html#ansible-collections-dellemc-enterprise-sonic-sonic-l2-interfaces-module)| [**sonic_bgp_af**](https://docs.ansible.com/ansible/latest/collections/dellemc/enterprise_sonic/sonic_bgp_af_module.html#ansible-collections-dellemc-enterprise-sonic-sonic-bgp-af-module)| **MCLAG** | **AAA** |
| [**sonic_l3_interfaces**](https://docs.ansible.com/ansible/latest/collections/dellemc/enterprise_sonic/sonic_l3_interfaces_module.html#ansible-collections-dellemc-enterprise-sonic-sonic-l3-interfaces-module) |[**sonic_bgp_as_paths**](https://docs.ansible.com/ansible/latest/collections/dellemc/enterprise_sonic/sonic_bgp_as_paths_module.html#ansible-collections-dellemc-enterprise-sonic-sonic-bgp-as-paths-module)| [**sonic_mclag**](https://docs.ansible.com/ansible/latest/collections/dellemc/enterprise_sonic/sonic_mclag_module.html#ansible-collections-dellemc-enterprise-sonic-sonic-mclag-module)| [**sonic_aaa**](https://docs.ansible.com/ansible/latest/collections/dellemc/enterprise_sonic/sonic_aaa_module.html#ansible-collections-dellemc-enterprise-sonic-sonic-aaa-module)|
|**Port channel**|[**sonic_bgp_communities**](https://docs.ansible.com/ansible/latest/collections/dellemc/enterprise_sonic/sonic_bgp_communities_module.html#ansible-collections-dellemc-enterprise-sonic-sonic-bgp-communities-module)| **VxLANs** |[**sonic_tacacs_server**](https://docs.ansible.com/ansible/latest/collections/dellemc/enterprise_sonic/sonic_tacacs_server_module.html#ansible-collections-dellemc-enterprise-sonic-sonic-tacacs-server-module)|
|[**sonic_lag_interfaces**](https://docs.ansible.com/ansible/latest/collections/dellemc/enterprise_sonic/sonic_lag_interfaces_module.html#ansible-collections-dellemc-enterprise-sonic-sonic-lag-interfaces-module)|[**sonic_bgp_ext_communities**](https://docs.ansible.com/ansible/latest/collections/dellemc/enterprise_sonic/sonic_bgp_ext_communities_module.html#ansible-collections-dellemc-enterprise-sonic-sonic-bgp-ext-communities-module)| [**sonic_vxlans**](https://docs.ansible.com/ansible/latest/collections/dellemc/enterprise_sonic/sonic_vxlans_module.html#ansible-collections-dellemc-enterprise-sonic-sonic-vxlans-module)|[**sonic_radius_server**](https://docs.ansible.com/ansible/latest/collections/dellemc/enterprise_sonic/sonic_radius_server_module.html#ansible-collections-dellemc-enterprise-sonic-sonic-radius-server-module)|
|**VLANs**|[**sonic_bgp_neighbors**](https://docs.ansible.com/ansible/latest/collections/dellemc/enterprise_sonic/sonic_bgp_neighbors_module.html#ansible-collections-dellemc-enterprise-sonic-sonic-bgp-neighbors-module)| **Port breakout** | **System** |
|[**sonic_vlans**](https://docs.ansible.com/ansible/latest/collections/dellemc/enterprise_sonic/sonic_vlans_module.html#ansible-collections-dellemc-enterprise-sonic-sonic-vlans-module)|[**sonic_bgp_neighbors_af**](https://docs.ansible.com/ansible/latest/collections/dellemc/enterprise_sonic/sonic_bgp_neighbors_af_module.html#ansible-collections-dellemc-enterprise-sonic-sonic-bgp-neighbors-af-module)|[**sonic_port_breakout**](https://docs.ansible.com/ansible/latest/collections/dellemc/enterprise_sonic/sonic_port_breakout_module.html#ansible-collections-dellemc-enterprise-sonic-sonic-port-breakout-module) |[**sonic_system**](https://docs.ansible.com/ansible/latest/collections/dellemc/enterprise_sonic/sonic_system_module.html#ansible-collections-dellemc-enterprise-sonic-sonic-system-module) |
Sample use case playbooks
-------------------------
The playbooks directory includes this sample playbook that show end-to-end use cases.
Name | Description
--- | ---
[**BGP Layer 3 fabric**](https://github.com/ansible-collections/dellemc.enterprise_sonic/tree/master/playbooks/bgp_l3_fabric)|Example playbook to build a Layer 3 leaf-spine fabric
Version compatibility
----------------------
* Recommended Ansible version 2.10 or higher
* Enterprise SONiC Distribution by Dell Technologies version 3.1 or higher
* Recommended Python 3.5 or higher, or Python 2.7
* Dell Enterprise SONiC images for releases 3.1 - 3.5: Use Ansible Enterprise SONiC collection version 1.1.0 or later 1.m.n versions (from the 1.x branch of this repo)
* Dell Enterprise SONiC images for release 4.0 and later 4.x.y releases: Use Ansible Enterprise SONiC collection version 2.0.0 or later 2.m.n releases (from the "2.x" branch of this repo).
* In general: Dell Enterprise SONiC release versions "R.x.y" are supported by Ansible Enterprise SONiC collection versions "R-2.m.n" on branch "R-2.x".
> **NOTE**: Community SONiC versions that include the Management Framework container should work as well, however, this collection has not been tested nor validated
with community versions and is not supported.
Installation of Ansible 2.11+
-----------------------------
##### Dependencies for Ansible Enterprise SONiC collection
pip3 install paramiko>=2.7
pip3 install jinja2>=2.8
pip3 install ansible-core
Installation of Ansible 2.10+
-----------------------------
##### Dependencies for Ansible Enterprise SONiC collection
pip3 install paramiko>=2.7
pip3 install jinja2>=2.8
pip3 install ansible-base
Installation of Ansible 2.9
---------------------------
##### Dependencies for Ansible Enterprise SONiC collection
pip3 install paramiko>=2.7
pip3 install jinja2>=2.8
pip3 install ansible
##### Setting Environment Variables
To use the Enterprise SONiC collection in Ansible 2.9, it is required to add one of the two available environment variables.
Option 1: Add the environment variable while running the playbook.
ANSIBLE_NETWORK_GROUP_MODULES=sonic ansible-playbook sample_playbook.yaml -i inventory.ini
Option 2: Add the environment variable in user profile.
ANSIBLE_NETWORK_GROUP_MODULES=sonic
Installation of Enterprise SONiC collection from Ansible Galaxy
---------------------------------------------------------------
Install the latest version of the Enterprise SONiC collection from Ansible Galaxy.
ansible-galaxy collection install dellemc.enterprise_sonic
To install a specific version, specify a version range identifier. For example, to install the most recent version that is greater than or equal to 1.0.0 and less than 2.0.0.
ansible-galaxy collection install 'dellemc.enterprise_sonic:>=1.0.0,<2.0.0'
Sample playbooks
-----------------
**VLAN configuration using CLICONF**
***sonic_network_cli.yaml***
---
- name: SONiC Management Framework CLI configuration examples
hosts: sonic_switches
gather_facts: no
connection: network_cli
tasks:
- name: Add VLAN entry
dellemc.enterprise_sonic.sonic_config:
commands: ['interface Vlan 700','exit']
save: yes
register: config_op
- name: Test SONiC single command
dellemc.enterprise_sonic.sonic_command:
commands: 'show vlan'
register: cmd_op
**VLAN configuration using HTTPAPI**
***sonic_httpapi.yaml***
---
- name: SONiC Management Framework REST API examples
hosts: sonic_switches
gather_facts: no
connection: httpapi
tasks:
- name: Perform PUT operation to add a VLAN network instance
dellemc.enterprise_sonic.sonic_api:
url: data/openconfig-network-instance:network-instances/network-instance=Vlan100
method: "PUT"
body: {"openconfig-network-instance:network-instance": [{"name": "Vlan100","config": {"name": "Vlan100"}}]}
status_code: 204
- name: Perform GET operation to view VLAN network instance
dellemc.enterprise_sonic.sonic_api:
url: data/openconfig-network-instance:network-instances/network-instance=Vlan100
method: "GET"
status_code: 200
register: api_op
**Configuration using network resource modules**
***sonic_resource_modules.yaml***
---
- name: VLANs, Layer 2 and Layer 3 interfaces configuration using Enterprise SONiC resource modules
hosts: sonic_switches
gather_facts: no
connection: httpapi
tasks:
- name: Configure VLANs
dellemc.enterprise_sonic.sonic_vlans:
config:
- vlan_id: 701
- vlan_id: 702
- vlan_id: 703
- vlan_id: 704
state: merged
register: sonic_vlans_output
- name: Configure Layer 2 interfaces
dellemc.enterprise_sonic.sonic_l2_interfaces:
config:
- name: Eth1/2
access:
vlan: 701
trunk:
allowed_vlans:
- vlan: 702
- vlan: 703
state: merged
register: sonic_l2_interfaces_output
- name: Configure Layer 3 interfaces
dellemc.enterprise_sonic.sonic_l3_interfaces:
config:
- name: Eth1/3
ipv4:
- address: 8.1.1.1/16
ipv6:
- address: 3333::1/16
state: merged
register: sonic_l3_interfaces_output
***host_vars/sonic_sw1.yaml***
hostname: sonic_sw1
# Common parameters for connection type httpapi or network_cli:
ansible_user: xxxx
ansible_pass: xxxx
ansible_network_os: dellemc.enterprise_sonic.sonic
# Additional parameters for connection type httpapi:
ansible_httpapi_use_ssl: true
ansible_httpapi_validate_certs: false
***inventory.ini***
[sonic_sw1]
sonic_sw1 ansible_host=100.104.28.119
[sonic_sw2]
sonic_sw2 ansible_host=100.104.28.120
[sonic_switches:children]
sonic_sw1
sonic_sw2
Releasing, Versioning and Deprecation
-------------------------------------
This collection follows [Semantic Versioning](https://semver.org/). More details on versioning can be found [in the Ansible docs](https://docs.ansible.com/ansible/latest/dev_guide/developing_collections.html#collection-versions).
We plan to regularly release new minor or bugfix versions once new features or bugfixes have been implemented.
Enterprise SONiC Ansible Modules deprecation cycle is aligned with [Ansible](https://docs.ansible.com/ansible/latest/dev_guide/module_lifecycle.html).
Source control branches on Github:
- Released code versions are located on "release" branches with names of the form "M.x", where "M" specifies the "major" release version for releases residing on the branch.
- Unreleased and pre-release code versions are located on sub-branches of the "main" branch. This is a development branch, and is not intended for use in production environments.
Code of Conduct
---------------
This repository adheres to the [Ansible Community code of conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html)
(c) 2020-2021 Dell Inc. or its subsidiaries. All Rights Reserved.

View File

@@ -0,0 +1,170 @@
objects:
role: {}
plugins:
become: {}
cache: {}
callback: {}
cliconf:
sonic:
description: Use sonic cliconf to run command on Dell OS10 platform
name: sonic
version_added: null
connection: {}
httpapi:
sonic:
description: HttpApi Plugin for devices supporting Restconf SONIC API
name: sonic
version_added: 1.0.0
inventory: {}
lookup: {}
module:
sonic_aaa:
description: Manage AAA and its parameters
name: sonic_aaa
namespace: ''
version_added: 1.1.0
sonic_api:
description: Manages REST operations on devices running Enterprise SONiC
name: sonic_api
namespace: ''
version_added: 1.0.0
sonic_bgp:
description: Manage global BGP and its parameters
name: sonic_bgp
namespace: ''
version_added: 1.0.0
sonic_bgp_af:
description: Manage global BGP address-family and its parameters
name: sonic_bgp_af
namespace: ''
version_added: 1.0.0
sonic_bgp_as_paths:
description: Manage BGP autonomous system path (or as-path-list) and its parameters
name: sonic_bgp_as_paths
namespace: ''
version_added: 1.0.0
sonic_bgp_communities:
description: Manage BGP community and its parameters
name: sonic_bgp_communities
namespace: ''
version_added: 1.0.0
sonic_bgp_ext_communities:
description: Manage BGP extended community-list and its parameters
name: sonic_bgp_ext_communities
namespace: ''
version_added: 1.0.0
sonic_bgp_neighbors:
description: Manage a BGP neighbor and its parameters
name: sonic_bgp_neighbors
namespace: ''
version_added: 1.0.0
sonic_bgp_neighbors_af:
description: Manage the BGP neighbor address-family and its parameters
name: sonic_bgp_neighbors_af
namespace: ''
version_added: 1.0.0
sonic_command:
description: Runs commands on devices running Enterprise SONiC
name: sonic_command
namespace: ''
version_added: 1.0.0
sonic_config:
description: Manages configuration sections on devices running Enterprise SONiC
name: sonic_config
namespace: ''
version_added: 1.0.0
sonic_facts:
description: Collects facts on devices running Enterprise SONiC
name: sonic_facts
namespace: ''
version_added: 1.0.0
sonic_interfaces:
description: Configure Interface attributes on interfaces such as, Eth, LAG,
VLAN, and loopback. (create a loopback interface if it does not exist.)
name: sonic_interfaces
namespace: ''
version_added: 1.0.0
sonic_l2_interfaces:
description: Configure interface-to-VLAN association that is based on access
or trunk mode
name: sonic_l2_interfaces
namespace: ''
version_added: 1.0.0
sonic_l3_interfaces:
description: Configure the IPv4 and IPv6 parameters on Interfaces such as, Eth,
LAG, VLAN, and loopback
name: sonic_l3_interfaces
namespace: ''
version_added: 1.0.0
sonic_lag_interfaces:
description: Manage link aggregation group (LAG) interface parameters
name: sonic_lag_interfaces
namespace: ''
version_added: 1.0.0
sonic_mclag:
description: Manage multi chassis link aggregation groups domain (MCLAG) and
its parameters
name: sonic_mclag
namespace: ''
version_added: 1.0.0
sonic_ntp:
description: Manage NTP configuration on SONiC.
name: sonic_ntp
namespace: ''
version_added: 2.0.0
sonic_port_breakout:
description: Configure port breakout settings on physical interfaces
name: sonic_port_breakout
namespace: ''
version_added: 1.0.0
sonic_prefix_lists:
description: prefix list configuration handling for SONiC
name: sonic_prefix_lists
namespace: ''
version_added: 2.0.0
sonic_radius_server:
description: Manage RADIUS server and its parameters
name: sonic_radius_server
namespace: ''
version_added: 1.0.0
sonic_static_routes:
description: Manage static routes configuration on SONiC
name: sonic_static_routes
namespace: ''
version_added: 2.0.0
sonic_system:
description: Configure system parameters
name: sonic_system
namespace: ''
version_added: 1.0.0
sonic_tacacs_server:
description: Manage TACACS server and its parameters
name: sonic_tacacs_server
namespace: ''
version_added: 1.1.0
sonic_users:
description: Manage users and its parameters
name: sonic_users
namespace: ''
version_added: 1.1.0
sonic_vlans:
description: Manage VLAN and its parameters
name: sonic_vlans
namespace: ''
version_added: 1.0.0
sonic_vrfs:
description: Manage VRFs and associate VRFs to interfaces such as, Eth, LAG,
VLAN, and loopback
name: sonic_vrfs
namespace: ''
version_added: 1.0.0
sonic_vxlans:
description: Manage VxLAN EVPN and its parameters
name: sonic_vxlans
namespace: ''
version_added: 1.0.0
netconf: {}
shell: {}
strategy: {}
vars: {}
version: 2.0.0

View File

@@ -0,0 +1,119 @@
======================================
Dellemc.Enterprise_Sonic Release Notes
======================================
.. contents:: Topics
v2.0.0
======
Release Summary
---------------
This release provides Dell SONiC Enterprise Ansible Collection support for SONiC 4.x images. It is the first release for the 2.x branch of the collection. Subsequent enhancements for support of SONiC 4.x images will also be provided as needed on the 2.x branch. This release also contains bugfixes and enhancements to supplement the Ansible functionality provided previously for SONiC 3.x images. The changelog describes changes made to the modules and plugins included in this collection since release 1.1.0.
Major Changes
-------------
- Added 'static_routes' module to collection (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/82).
- Added a resource module for NTP support (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/99).
- Added a resource module for support of prefix lists (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/100).
- Updated backend REST API request formats in all applicable modules for compatibility with SONiC 4.x openconfig YANG compliant REST APIs. (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/53)
Minor Changes
-------------
- Added an execution-environment.yml file to the "meta" directory to enable use of Ansible execution environment infrastructure (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/88).
- bgp_af - Added support for BGP options to configure usage and advertisement of vxlan primary IP address related attributes (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/62).
- bgp_as_paths - updated module examples with 'permit' attribute (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/102)
- bgp_neighbors - Add BGP peer group support for multiple attributes. The added attributes correspond to the same set of attributes added for BGP neighbors with PR 72 (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/81).
- bgp_neighbors - Add support for multiple attributes (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/72).
- bgp_neighbors - add an auth_pwd dictionary and nbr_description attribute to the argspec (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/67).
- bgp_neighbors - added prefix-list related peer-group attributes (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/101).
- bgp_neighbors_af - added prefix-list related neighbor attributes (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/101).
- playbook - updated examples to reflect module changes (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/102)
- sonic_vxlans - Add configuration capability for the primary IP address of a vxlan vtep to facilitate vxlan path redundundancy (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/58).
- vlans - Added support for the vlan "description" attribute (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/98).
- workflow - Added stable-2.13 to the sanity test matrix (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/90).
Breaking Changes / Porting Guide
--------------------------------
- bgp_af - Add the route_advertise_list dictionary to the argspec to replace the deleted, obsolete advertise_prefix attribute used for SONiC 3.x images on the 1.x branch of this collection. This change corresponds to a SONiC 4.0 OC YANG REST compliance change for the BGP AF REST API. It enables specification of a route map in conjunction with each route advertisement prefix (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/63).
- bgp_af - remove the obsolete 'advertise_prefix' attribute from argspec and config code. This and subsequent co-req replacement with the new route advertise list argument structure require corresponding changes in playbooks previoulsly used for configuring route advertise prefixes for SONiC 3.x images. (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/60)
- bgp_neighbors - Replace the previously defined standalone "bfd" attribute with a bfd dictionary containing multiple attributes. This change corresponds to the revised SONiC 4.x implementation of OC YANG compatible REST APIs. Playbooks previously using the bfd attributes for SONiC 3.x images must be modified for useon SONiC 4.0 images to use the new definition for the bfd attribute argspec structure (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/72).
- bgp_neighbors - Replace, for BGP peer groups, the previously defined standalone "bfd" attribute with a bfd dictionary containing multiple attributes. This change corresponds to the revised SONiC 4.x implementation of OC YANG compatible REST APIs. Playbooks previously using the bfd attributes for SONiC 3.x images must be modified for useon SONiC 4.0 images to use the new definition for the bfd attribute argspec structure (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/81).
Bugfixes
--------
- Fixed regression test bugs in multiple modules (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/103).
- Fixed regression test sequencing and other regression test bugs in multiple modules (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/85).
- aaa - Fixed a bug in facts gathering by providing required conditional branching (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/90)
- aaa - Modify regression test sequencing to enable correct testing of the functionality for this module (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/78).
- bgp_neighbors - remove string conversion of timer attributes (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/60)
- port_breakout - Fixed a bug in formulation of port breakout REST APIs (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/88).
- sonic - Fix a bug in handling of interface names in standard interface naming mode (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/103).
- sonic_command - Fix bugs in handling of CLI commands involving a prompt and answer sequence (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/76/files).
- users - Fixed a bug in facts gathering (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/90).
- vxlan - update Vxlan test cases to comply with SONiC behavior (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/105).
New Modules
-----------
- dellemc.enterprise_sonic.sonic_ntp - Manage NTP configuration on SONiC.
- dellemc.enterprise_sonic.sonic_prefix_lists - prefix list configuration handling for SONiC
- dellemc.enterprise_sonic.sonic_static_routes - Manage static routes configuration on SONiC
v1.1.0
======
New Modules
-----------
- dellemc.enterprise_sonic.sonic_aaa - AAA resource module.
- dellemc.enterprise_sonic.sonic_radius_server - RADIUS resource module.
- dellemc.enterprise_sonic.sonic_system - SYSTEM resource module.
- dellemc.enterprise_sonic.sonic_tacacs_server - TACACS Server resource module.
v1.0.0
======
New Plugins
-----------
Cliconf
~~~~~~~
- dellemc.enterprise_sonic.sonic - Use Ansible CLICONF to run commands on Enterprise SONiC.
Httpapi
~~~~~~~
- dellemc.enterprise_sonic.sonic - Use Ansible HTTPAPI to run commands on Enterprise SONiC.
New Modules
-----------
- dellemc.enterprise_sonic.sonic_api - Perform REST operations through the Management Framework REST API.
- dellemc.enterprise_sonic.sonic_bgp - BGP resource module.
- dellemc.enterprise_sonic.sonic_bgp_af - BGP AF resource module.
- dellemc.enterprise_sonic.sonic_bgp_as_paths - BGP AS path resource module.
- dellemc.enterprise_sonic.sonic_bgp_communities - BGP communities resource module.
- dellemc.enterprise_sonic.sonic_bgp_ext_communities - BGP Ext communities resource module.
- dellemc.enterprise_sonic.sonic_bgp_neighbors - BGP neighbors resource module.
- dellemc.enterprise_sonic.sonic_bgp_neighbors_af - BGP neighbors AF resource module.
- dellemc.enterprise_sonic.sonic_command - Run commands through Management Framework CLI.
- dellemc.enterprise_sonic.sonic_config - Manage configuration through the Management Framework CLI.
- dellemc.enterprise_sonic.sonic_interfaces - Interface resource module.
- dellemc.enterprise_sonic.sonic_l2_interfaces - Layer 2 interface resource module.
- dellemc.enterprise_sonic.sonic_l3_interfaces - Layer 3 interface resource module.
- dellemc.enterprise_sonic.sonic_lag_interfaces - Link aggregation (LAG) resource module.
- dellemc.enterprise_sonic.sonic_mclag - MCLAG resource module.
- dellemc.enterprise_sonic.sonic_port_breakout - port breakout resource module.
- dellemc.enterprise_sonic.sonic_users - USERS resource module.
- dellemc.enterprise_sonic.sonic_vlans - VLAN resource module.
- dellemc.enterprise_sonic.sonic_vrfs - VRF resource module.
- dellemc.enterprise_sonic.sonic_vxlans - VxLAN EVPN resource module.

View File

@@ -0,0 +1,2 @@
major_changes:
- Added a resource module for support of prefix lists (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/100).

View File

@@ -0,0 +1,3 @@
minor_changes:
- bgp_neighbors - added prefix-list related peer-group attributes (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/101).
- bgp_neighbors_af - added prefix-list related neighbor attributes (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/101).

View File

@@ -0,0 +1,3 @@
minor_changes:
- bgp_as_paths - updated module examples with 'permit' attribute (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/102)
- playbook - updated examples to reflect module changes (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/102)

View File

@@ -0,0 +1,3 @@
bugfixes:
- sonic - Fix a bug in handling of interface names in standard interface naming mode (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/103).
- Fixed regression test bugs in multiple modules (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/103).

View File

@@ -0,0 +1,2 @@
bugfixes:
- vxlan - update Vxlan test cases to comply with SONiC behavior (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/105).

View File

@@ -0,0 +1,2 @@
release_summary: |
This release provides Dell SONiC Enterprise Ansible Collection support for SONiC 4.x images. It is the first release for the 2.x branch of the collection. Subsequent enhancements for support of SONiC 4.x images will also be provided as needed on the 2.x branch. This release also contains bugfixes and enhancements to supplement the Ansible functionality provided previously for SONiC 3.x images. The changelog describes changes made to the modules and plugins included in this collection since release 1.1.0.

View File

@@ -0,0 +1,2 @@
major_changes:
- Updated backend REST API request formats in all applicable modules for compatibility with SONiC 4.x openconfig YANG compliant REST APIs. (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/53)

View File

@@ -0,0 +1,2 @@
minor_changes:
- sonic_vxlans - Add configuration capability for the primary IP address of a vxlan vtep to facilitate vxlan path redundundancy (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/58).

View File

@@ -0,0 +1,4 @@
bugfixes:
- bgp_neighbors - remove string conversion of timer attributes (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/60)
breaking_changes:
- bgp_af - remove the obsolete 'advertise_prefix' attribute from argspec and config code. This and subsequent co-req replacement with the new route advertise list argument structure require corresponding changes in playbooks previoulsly used for configuring route advertise prefixes for SONiC 3.x images. (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/60)

View File

@@ -0,0 +1,2 @@
minor_changes:
- bgp_af - Added support for BGP options to configure usage and advertisement of vxlan primary IP address related attributes (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/62).

View File

@@ -0,0 +1,2 @@
breaking_changes:
- bgp_af - Add the route_advertise_list dictionary to the argspec to replace the deleted, obsolete advertise_prefix attribute used for SONiC 3.x images on the 1.x branch of this collection. This change corresponds to a SONiC 4.0 OC YANG REST compliance change for the BGP AF REST API. It enables specification of a route map in conjunction with each route advertisement prefix (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/63).

View File

@@ -0,0 +1,2 @@
minor_changes:
- bgp_neighbors - add an auth_pwd dictionary and nbr_description attribute to the argspec (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/67).

View File

@@ -0,0 +1,5 @@
minor_changes:
- bgp_neighbors - Add support for multiple attributes (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/72).
breaking_changes:
- bgp_neighbors - Replace the previously defined standalone "bfd" attribute with a bfd dictionary containing multiple attributes. This change corresponds to the revised SONiC 4.x implementation of OC YANG compatible REST APIs. Playbooks previously using the bfd attributes for SONiC 3.x images must be modified for useon SONiC 4.0 images to use the new definition for the bfd attribute argspec structure (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/72).

View File

@@ -0,0 +1,2 @@
bugfixes:
- sonic_command - Fix bugs in handling of CLI commands involving a prompt and answer sequence (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/76/files).

View File

@@ -0,0 +1,2 @@
bugfixes:
- aaa - Modify regression test sequencing to enable correct testing of the functionality for this module (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/78).

View File

@@ -0,0 +1,5 @@
minor_changes:
- bgp_neighbors - Add BGP peer group support for multiple attributes. The added attributes correspond to the same set of attributes added for BGP neighbors with PR 72 (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/81).
breaking_changes:
- bgp_neighbors - Replace, for BGP peer groups, the previously defined standalone "bfd" attribute with a bfd dictionary containing multiple attributes. This change corresponds to the revised SONiC 4.x implementation of OC YANG compatible REST APIs. Playbooks previously using the bfd attributes for SONiC 3.x images must be modified for useon SONiC 4.0 images to use the new definition for the bfd attribute argspec structure (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/81).

View File

@@ -0,0 +1,2 @@
major_changes:
- Added 'static_routes' module to collection (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/82).

View File

@@ -0,0 +1,2 @@
bugfixes:
- Fixed regression test sequencing and other regression test bugs in multiple modules (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/85).

View File

@@ -0,0 +1,5 @@
bugfixes:
- port_breakout - Fixed a bug in formulation of port breakout REST APIs (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/88).
minor_changes:
- Added an execution-environment.yml file to the "meta" directory to enable use of Ansible execution environment infrastructure (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/88).

View File

@@ -0,0 +1,6 @@
bugfixes:
- aaa - Fixed a bug in facts gathering by providing required conditional branching (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/90)
- users - Fixed a bug in facts gathering (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/90).
minor_changes:
- workflow - Added stable-2.13 to the sanity test matrix (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/90).

View File

@@ -0,0 +1,2 @@
minor_changes:
- vlans - Added support for the vlan "description" attribute (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/98).

View File

@@ -0,0 +1,2 @@
major_changes:
- Added a resource module for NTP support (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/99).

View File

@@ -0,0 +1,197 @@
ancestor: null
releases:
1.0.0:
modules:
- description: Perform REST operations through the Management Framework REST API.
name: sonic_api
namespace: ''
- description: BGP resource module.
name: sonic_bgp
namespace: ''
- description: BGP AF resource module.
name: sonic_bgp_af
namespace: ''
- description: BGP AS path resource module.
name: sonic_bgp_as_paths
namespace: ''
- description: BGP communities resource module.
name: sonic_bgp_communities
namespace: ''
- description: BGP Ext communities resource module.
name: sonic_bgp_ext_communities
namespace: ''
- description: BGP neighbors resource module.
name: sonic_bgp_neighbors
namespace: ''
- description: BGP neighbors AF resource module.
name: sonic_bgp_neighbors_af
namespace: ''
- description: Run commands through Management Framework CLI.
name: sonic_command
namespace: ''
- description: Manage configuration through the Management Framework CLI.
name: sonic_config
namespace: ''
- description: Interface resource module.
name: sonic_interfaces
namespace: ''
- description: Layer 2 interface resource module.
name: sonic_l2_interfaces
namespace: ''
- description: Layer 3 interface resource module.
name: sonic_l3_interfaces
namespace: ''
- description: Link aggregation (LAG) resource module.
name: sonic_lag_interfaces
namespace: ''
- description: MCLAG resource module.
name: sonic_mclag
namespace: ''
- description: port breakout resource module.
name: sonic_port_breakout
namespace: ''
- description: USERS resource module.
name: sonic_users
namespace: ''
- description: VLAN resource module.
name: sonic_vlans
namespace: ''
- description: VRF resource module.
name: sonic_vrfs
namespace: ''
- description: VxLAN EVPN resource module.
name: sonic_vxlans
namespace: ''
plugins:
cliconf:
- description: Use Ansible CLICONF to run commands on Enterprise SONiC.
name: sonic
namespace: null
httpapi:
- description: Use Ansible HTTPAPI to run commands on Enterprise SONiC.
name: sonic
namespace: null
release_date: '2020-12-07'
1.1.0:
modules:
- description: AAA resource module.
name: sonic_aaa
namespace: ''
- description: RADIUS resource module.
name: sonic_radius_server
namespace: ''
- description: SYSTEM resource module.
name: sonic_system
namespace: ''
- description: TACACS Server resource module.
name: sonic_tacacs_server
namespace: ''
release_date: '2021-05-28'
2.0.0:
changes:
breaking_changes:
- bgp_af - Add the route_advertise_list dictionary to the argspec to replace
the deleted, obsolete advertise_prefix attribute used for SONiC 3.x images
on the 1.x branch of this collection. This change corresponds to a SONiC 4.0
OC YANG REST compliance change for the BGP AF REST API. It enables specification
of a route map in conjunction with each route advertisement prefix (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/63).
- bgp_af - remove the obsolete 'advertise_prefix' attribute from argspec and
config code. This and subsequent co-req replacement with the new route advertise
list argument structure require corresponding changes in playbooks previoulsly
used for configuring route advertise prefixes for SONiC 3.x images. (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/60)
- bgp_neighbors - Replace the previously defined standalone "bfd" attribute
with a bfd dictionary containing multiple attributes. This change corresponds
to the revised SONiC 4.x implementation of OC YANG compatible REST APIs. Playbooks
previously using the bfd attributes for SONiC 3.x images must be modified
for useon SONiC 4.0 images to use the new definition for the bfd attribute
argspec structure (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/72).
- bgp_neighbors - Replace, for BGP peer groups, the previously defined standalone
"bfd" attribute with a bfd dictionary containing multiple attributes. This
change corresponds to the revised SONiC 4.x implementation of OC YANG compatible
REST APIs. Playbooks previously using the bfd attributes for SONiC 3.x images
must be modified for useon SONiC 4.0 images to use the new definition for
the bfd attribute argspec structure (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/81).
bugfixes:
- Fixed regression test bugs in multiple modules (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/103).
- Fixed regression test sequencing and other regression test bugs in multiple
modules (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/85).
- aaa - Fixed a bug in facts gathering by providing required conditional branching
(https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/90)
- aaa - Modify regression test sequencing to enable correct testing of the functionality
for this module (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/78).
- bgp_neighbors - remove string conversion of timer attributes (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/60)
- port_breakout - Fixed a bug in formulation of port breakout REST APIs (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/88).
- sonic - Fix a bug in handling of interface names in standard interface naming
mode (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/103).
- sonic_command - Fix bugs in handling of CLI commands involving a prompt and
answer sequence (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/76/files).
- users - Fixed a bug in facts gathering (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/90).
- vxlan - update Vxlan test cases to comply with SONiC behavior (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/105).
major_changes:
- Added 'static_routes' module to collection (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/82).
- Added a resource module for NTP support (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/99).
- Added a resource module for support of prefix lists (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/100).
- Updated backend REST API request formats in all applicable modules for compatibility
with SONiC 4.x openconfig YANG compliant REST APIs. (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/53)
minor_changes:
- Added an execution-environment.yml file to the "meta" directory to enable
use of Ansible execution environment infrastructure (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/88).
- bgp_af - Added support for BGP options to configure usage and advertisement
of vxlan primary IP address related attributes (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/62).
- bgp_as_paths - updated module examples with 'permit' attribute (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/102)
- bgp_neighbors - Add BGP peer group support for multiple attributes. The added
attributes correspond to the same set of attributes added for BGP neighbors
with PR 72 (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/81).
- bgp_neighbors - Add support for multiple attributes (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/72).
- bgp_neighbors - add an auth_pwd dictionary and nbr_description attribute to
the argspec (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/67).
- bgp_neighbors - added prefix-list related peer-group attributes (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/101).
- bgp_neighbors_af - added prefix-list related neighbor attributes (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/101).
- playbook - updated examples to reflect module changes (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/102)
- sonic_vxlans - Add configuration capability for the primary IP address of
a vxlan vtep to facilitate vxlan path redundundancy (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/58).
- vlans - Added support for the vlan "description" attribute (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/98).
- workflow - Added stable-2.13 to the sanity test matrix (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/90).
release_summary: 'This release provides Dell SONiC Enterprise Ansible Collection
support for SONiC 4.x images. It is the first release for the 2.x branch of
the collection. Subsequent enhancements for support of SONiC 4.x images will
also be provided as needed on the 2.x branch. This release also contains bugfixes
and enhancements to supplement the Ansible functionality provided previously
for SONiC 3.x images. The changelog describes changes made to the modules
and plugins included in this collection since release 1.1.0.
'
fragments:
- 100-prefix_lists-resource-module.yaml
- 101-bgp-prefix_lists.yaml
- 102-playbook-example-updates.yaml
- 103-standard-interface-naming-and-other-bugfixes.yaml
- 105-vxlan-regression-test-fix.yaml
- 2.0.0.yaml
- 53-oc-yang-compliance.yaml
- 58-vxlan-primary-ip.yaml
- 60-bgp-regression-test_fixes.yaml
- 62-bgp-vxlan-primary-ip.yaml
- 63-bgp_af-route_advertise_list.yaml
- 67-bgp_neighbors-auth_pwd-and-neighbor_description.yaml
- 72-bgp_neighbors-add-attributes.yaml
- 76-CLI-command-prompt-answer-fix.yaml
- 78-aaa-regression-fix.yaml
- 81-add-bgp-peer-group-attributes.yaml
- 82-static_routes.yaml
- 85-regression-test-fixes.yaml
- 88-port_breakout-and-execution-environment.yaml
- 90-aaa-and-users-bugfix.yaml
- 98-vlans-description.yaml
- 99-ntp-resource-module.yaml
modules:
- description: Manage NTP configuration on SONiC.
name: sonic_ntp
namespace: ''
- description: prefix list configuration handling for SONiC
name: sonic_prefix_lists
namespace: ''
- description: Manage static routes configuration on SONiC
name: sonic_static_routes
namespace: ''
release_date: '2022-09-02'

View File

@@ -0,0 +1,33 @@
changelog_filename_template: CHANGELOG.rst
changelog_filename_version_depth: 0
changes_file: changelog.yaml
changes_format: combined
ignore_other_fragment_extensions: true
keep_fragments: false
archive_path_template: changelogs/archive_fragments/{version}
mention_ancestor: true
new_plugins_after_name: removed_features
notesdir: fragments
prelude_section_name: release_summary
prelude_section_title: Release Summary
sanitize_changelog: true
sections:
- - major_changes
- Major Changes
- - minor_changes
- Minor Changes
- - breaking_changes
- Breaking Changes / Porting Guide
- - deprecated_features
- Deprecated Features
- - removed_features
- Removed Features (previously deprecated)
- - security_fixes
- Security Fixes
- - bugfixes
- Bugfixes
- - known_issues
- Known Issues
title: Dellemc.Enterprise_Sonic
trivial_section_name: trivial
use_fqcn: true

View File

@@ -0,0 +1,3 @@
dependencies:
python: requirements.txt
version: 1

View File

@@ -0,0 +1,53 @@
requires_ansible: '>=2.9.10'
plugin_routing:
action:
sonic_config:
redirect: dellemc.enterprise_sonic.sonic
sonic_command:
redirect: dellemc.enterprise_sonic.sonic
sonic_api:
redirect: dellemc.enterprise_sonic.sonic
sonic_facts:
redirect: dellemc.enterprise_sonic.sonic
sonic_interfaces:
redirect: dellemc.enterprise_sonic.sonic
sonic_lag_interfaces:
redirect: dellemc.enterprise_sonic.sonic
sonic_l2_interfaces:
redirect: dellemc.enterprise_sonic.sonic
sonic_l3_interfaces:
redirect: dellemc.enterprise_sonic.sonic
sonic_vlans:
redirect: dellemc.enterprise_sonic.sonic
sonic_bgp:
redirect: dellemc.enterprise_sonic.sonic
sonic_bgp_af:
redirect: dellemc.enterprise_sonic.sonic
sonic_bgp_neighbors:
redirect: dellemc.enterprise_sonic.sonic
sonic_bgp_neighbors_af:
redirect: dellemc.enterprise_sonic.sonic
sonic_bgp_as_paths:
redirect: dellemc.enterprise_sonic.sonic
sonic_bgp_communities:
redirect: dellemc.enterprise_sonic.sonic
sonic_bgp_ext_communities:
redirect: dellemc.enterprise_sonic.sonic
sonic_vxlans:
redirect: dellemc.enterprise_sonic.sonic
sonic_mclag:
redirect: dellemc.enterprise_sonic.sonic
sonic_users:
redirect: dellemc.enterprise_sonic.sonic
sonic_port_breakout:
redirect: dellemc.enterprise_sonic.sonic
sonic_vrfs:
redirect: dellemc.enterprise_sonic.sonic
sonic_tacacs_server:
redirect: dellemc.enterprise_sonic.sonic
sonic_radius_server:
redirect: dellemc.enterprise_sonic.sonic
sonic_aaa:
redirect: dellemc.enterprise_sonic.sonic
sonic_system:
redirect: dellemc.enterprise_sonic.sonic

View File

@@ -0,0 +1,43 @@
---
- hosts: datacenter
connection: httpapi
gather_facts: no
collections:
- dellemc.enterprise_sonic
tasks:
- name: Create Interfaces
sonic_interfaces:
config: "{{sonic_interfaces}}"
when: sonic_interfaces is defined and sonic_interfaces
- name: Create L3 Interfaces
sonic_l3_interfaces:
config: "{{sonic_l3_interfaces}}"
when: sonic_l3_interfaces is defined and sonic_l3_interfaces
- name: "Push configs for clos-fabric usecase"
vars:
ansible_connection: network_cli
sonic_config:
src: clos_fabric_cfg.j2
register: result
- name: Create BGP configuration
sonic_bgp:
config: "{{sonic_bgp}}"
when: sonic_bgp is defined and sonic_bgp
- name: Create BGP AF configuration
sonic_bgp_af:
config: "{{sonic_bgp_af}}"
when: sonic_bgp_af is defined and sonic_bgp_af
- name: Create BGP Neighbors configuration
sonic_bgp_neighbors:
config: "{{sonic_bgp_neighbors}}"
when: sonic_bgp_neighbors is defined and sonic_bgp_neighbors
- name: Create BGP Neighbors AF configuration
sonic_bgp_neighbors_af:
config: "{{sonic_bgp_neighbors_af}}"
when: sonic_bgp_neighbors_af is defined and sonic_bgp_neighbors_af

View File

@@ -0,0 +1,49 @@
ansible_user: admin
ansible_password: admin
ansible_network_os: dellemc.enterprise_sonic.sonic
# Changing the interface name here will be reflected in all places
# Spine to Leaf interface connections
spine_leaf1_inf1: Eth1/1
spine_leaf2_inf2: Eth1/2
spine_leaf25_inf3: Eth1/25
spine_leaf26_inf4: Eth1/26
# Leaf to spine interface connections
leaf_spine1_inf1: Eth1/14
leaf_spine2_inf2: Eth1/15
# Logical interface defintions
loopback_inf0: Loopback0
loopback_inf1: Loopback1
host_data:
leaf1:
loopback0_ip: 10.0.2.1/32
loopback1_ip: 10.10.10.1/32
bgp_asn: 65001
leaf2:
loopback0_ip: 10.0.2.2/32
loopback1_ip: 10.10.10.2/32
bgp_asn: 65001
leaf25:
loopback0_ip: 10.0.2.25/32
loopback1_ip: 10.10.10.25/32
bgp_asn: 65025
leaf26:
loopback0_ip: 10.0.2.26/32
loopback1_ip: 10.10.10.26/32
bgp_asn: 65025
spine1:
loopback0_ip: 10.0.1.1/32
bgp_asn: 65000
spine2:
loopback0_ip: 10.0.1.2/32
bgp_asn: 65000
ansible_httpapi_use_ssl: true
ansible_httpapi_validate_certs: false
loopback0_ip: "{{ host_data[inventory_hostname].loopback0_ip }}"
loopback1_ip: "{{host_data[inventory_hostname].loopback1_ip}}"
bgp_asn: "{{ host_data[inventory_hostname].bgp_asn }}"

View File

@@ -0,0 +1,103 @@
sonic_interfaces:
- name: "{{ leaf_spine1_inf1 }}"
description: "{{ leaf_spine1_inf1 }} Spine1"
enabled: true
- name: "{{ leaf_spine2_inf2 }}"
description: "{{ leaf_spine2_inf2 }} Spine2"
enabled: true
- name: "{{ loopback_inf0 }}"
- name: "{{ loopback_inf1 }}"
sonic_l3_interfaces:
- name: "{{ loopback_inf0 }}"
ipv4:
addresses:
- address: "{{ loopback0_ip }}"
- name: "{{ loopback_inf1 }}"
ipv4:
addresses:
- address: "{{ loopback1_ip }}"
- name: "{{ leaf_spine1_inf1 }}"
ipv6:
enabled: true
- name: "{{ leaf_spine2_inf2 }}"
ipv6:
enabled: true
sonic_route_maps_cli:
- name: REDISTU
permit: true
seq: 10
match_ip_prefix_list: UNDERLAY
- name: REDISTL3
permit: true
seq: 10
match_ip_prefix_list: L3OVERLAY
sonic_prefix_list_cli:
- name: UNDERLAY
permit: true
entries:
- ip: 10.0.2.0/24
condition: ge 32 le 32
seq: 1
- ip: 10.10.10.0/24
condition: ge 32 le 32
seq: 2
- name: L3OVERLAY
permit: true
entries:
- ip: 192.168.50.0/24
seq: 3
sonic_bgp:
- bgp_as: "{{ bgp_asn }}"
router_id: "{{ loopback0_ip.split('/')[0] }}"
bestpath:
as_path:
multipath_relax: true
sonic_bgp_af:
- bgp_as: "{{ bgp_asn }}"
address_family:
afis:
- afi: l2vpn
safi: evpn
advertise_all_vni: true
- afi: ipv4
safi: unicast
redistribute:
- protocol: connected
route_map: REDISTU
sonic_bgp_neighbors:
- bgp_as: "{{ bgp_asn }}"
peer_group:
- name: SPINE
remote_as:
peer_type: external
advertisement_interval: 5
timers:
keepalive: 3
holdtime: 9
bfd:
check_failure: true
enabled: true
profile: 'profile 1'
capability:
extended_nexthop: true
address_family:
afis:
- afi: l2vpn
safi: evpn
activate: true
- afi: ipv4
safi: unicast
activate: true
allowas_in:
value: 2
neighbors:
- neighbor: "{{ leaf_spine1_inf1 }}"
peer_group: SPINE
- neighbor: "{{ leaf_spine2_inf2 }}"
peer_group: SPINE

View File

@@ -0,0 +1,87 @@
loopback_inf0: Loopback0
sonic_interfaces:
- name: "{{ spine_leaf1_inf1 }}"
description: "{{ spine_leaf1_inf1 }} Leaf1"
enabled: true
- name: "{{ spine_leaf2_inf2 }}"
description: "{{ spine_leaf2_inf2 }} Leaf2"
enabled: true
- name: "{{ spine_leaf25_inf3 }}"
description: "{{ spine_leaf25_inf3 }} Leaf25"
enabled: true
- name: "{{ spine_leaf26_inf4 }}"
description: "{{ spine_leaf26_inf4 }} Leaf26"
enabled: true
- name: "{{ loopback_inf0 }}"
sonic_l3_interfaces:
- name: "{{ loopback_inf0 }}"
ipv4:
addresses:
- address: "{{ loopback0_ip }}"
- name: "{{ spine_leaf1_inf1 }}"
ipv6:
enabled: true
- name: "{{ spine_leaf2_inf2 }}"
ipv6:
enabled: true
- name: "{{ spine_leaf25_inf3 }}"
ipv6:
enabled: true
- name: "{{ spine_leaf26_inf4 }}"
ipv6:
enabled: true
sonic_bgp:
- bgp_as: "{{ bgp_asn }}"
router_id: "{{ loopback0_ip.split('/')[0] }}"
bestpath:
as_path:
multipath_relax: true
sonic_bgp_af:
- bgp_as: "{{ bgp_asn }}"
address_family:
afis:
- afi: l2vpn
safi: evpn
advertise_all_vni: true
- afi: ipv4
safi: unicast
redistribute:
- protocol: connected
sonic_bgp_neighbors:
- bgp_as: "{{ bgp_asn }}"
peer_group:
- name: LEAF
remote_as:
peer_type: external
advertisement_interval: 5
timers:
keepalive: 3
holdtime: 9
bfd:
check_failure: true
enabled: true
profile: 'profile1'
capability:
extended_nexthop: true
address_family:
afis:
- afi: l2vpn
safi: evpn
activate: true
- afi: ipv4
safi: unicast
activate: true
neighbors:
- neighbor: "{{ spine_leaf1_inf1 }}"
peer_group: LEAF
- neighbor: "{{ spine_leaf2_inf2 }}"
peer_group: LEAF
- neighbor: "{{ spine_leaf25_inf3 }}"
peer_group: LEAF
- neighbor: "{{ spine_leaf26_inf4 }}"
peer_group: LEAF

View File

@@ -0,0 +1,20 @@
spine1 ansible_host=100.94.81.19
spine2 ansible_host=100.10.10.2
leaf1 ansible_host=100.94.81.17
leaf2 ansible_host=100.10.10.4
leaf25 ansible_host=100.10.10.5
leaf26 ansible_host=100.10.10.6
[leaf]
leaf1
leaf2
leaf25
leaf26
[spine]
spine1
spine2
[datacenter:children]
leaf
spine

View File

@@ -0,0 +1,25 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
{#######################################
#Purpose:
BGP L3 Fabric usecase configuration for SONiC devices
#######################################}
{# prefix list start #}
{% if sonic_prefix_list_cli is defined and sonic_prefix_list_cli %}
{% for sonic_prefix in sonic_prefix_list_cli %}
{% for prefix_entires in sonic_prefix.entries %}
ip prefix-list {{ sonic_prefix.name }} seq {{ prefix_entires.seq }} {{ 'permit' if sonic_prefix.permit else 'deny' }} {{ prefix_entires.ip }} {{ prefix_entires.condition if prefix_entires.condition is defined else ''}}
{% endfor %}
{% endfor %}
{% endif %}
{# prefix list end #}
{# Route map configuration start #}
{% if sonic_route_maps_cli is defined and sonic_route_maps_cli %}
{% for sonic_route_map in sonic_route_maps_cli %}
route-map {{ sonic_route_map.name }} {{ 'permit' if sonic_route_map.permit else 'deny' }} {{ sonic_route_map.seq }}
match ip address prefix-list {{ sonic_route_map.match_ip_prefix_list }}
{% endfor %}
{% endif %}
{# Route map configuration start #}

View File

@@ -0,0 +1,12 @@
sonic1 ansible_host=100.94.81.17 ansible_user=admin ansible_password=admin
sonic2 ansible_host=100.94.81.19 ansible_user=admin ansible_password=admin
[datacenter]
sonic1
sonic2
[datacenter:vars]
ansible_network_os=dellemc.enterprise_sonic.sonic
ansible_python_interpreter=/usr/bin/python3
ansible_httpapi_use_ssl=true
ansible_httpapi_validate_certs=false

View File

@@ -0,0 +1,32 @@
---
- hosts: datacenter
connection: network_cli
gather_facts: no
collections:
- dellemc.enterprise_sonic
tasks:
- name: "Configure description for interface in native name"
sonic_config:
commands:
- description Ethernet0
parents:
- interface Ethernet0
# Same prompt and answer for cli "no interface-naming standard"
- name: "Configure cli with prompts on SONiC device"
sonic_config:
commands:
- command: "interface-naming standard"
prompt: "Broadcast message: Interface naming mode has changed. Users running 'sonic-cli' are required to restart your session."
answer: "\n"
- name: "reset ssh connection"
meta: reset_connection
- name: "Configure description for interface in standard name"
sonic_config:
commands:
- description Eth1/1
parents:
- interface Eth1/1

View File

@@ -0,0 +1,8 @@
{"openconfig-if-ip:ipv4": {
"addresses": {
"address": [
{
"ip": "131.1.1.1",
"config": {"ip": "131.1.1.1", "prefix-length": 24}
}]}}
}

View File

@@ -0,0 +1,79 @@
---
- name: Ansible resource module example for sonic_aaa
hosts: datacenter
gather_facts: False
connection: httpapi
collections:
- dellemc.enterprise_sonic
tasks:
- name: delete all users
sonic_users:
config:
state: deleted
- name: delete all aaa
sonic_aaa:
config:
state: deleted
- name: delete all tacacs servers
sonic_tacacs_server:
config:
state: deleted
- name: delete all radius servers
sonic_radius_server:
config:
state: deleted
- name: Merge users configurations
sonic_users:
config:
- name: sysadmin
role: admin
password: admin
update_password: always
- name: sysoperator
role: operator
password: operator
update_password: always
state: merged
- name: Test SONiC aaa
sonic_aaa:
config:
authentication:
data:
fail_through: true
group: tacacs+
local: true
state: merged
- name: Merge tacacs configurations
sonic_tacacs_server:
config:
auth_type: pap
key: pap
source_interface: Eth 1/2
timeout: 10
servers:
host:
- name: 1.2.3.4
auth_type: pap
key: 1234
state: merged
- name: Merge radius configurations
sonic_radius_server:
config:
auth_type: chap
key: chap
nas_ip: 1.2.3.4
statistics: true
timeout: 10
retransmit: 3
servers:
host:
- name: localhost
auth_type: mschapv2
key: local
priority: 2
port: 52
retransmit: 2
timeout: 20
source_interface: Eth 1/2
vrf: mgmt
state: merged

View File

@@ -0,0 +1,37 @@
---
- name: Ansible resource module example
hosts: datacenter
gather_facts: False
connection: httpapi
collections:
- dellemc.enterprise_sonic
tasks:
- name: "Test patch_api"
sonic_api:
url: data/openconfig-interfaces:interfaces/interface=Eth1%2f26/config/description
method: "PATCH"
status_code: 204
body: {"openconfig-interfaces:description": "hi "}
- name: "Test patch_api"
sonic_api:
url: data/openconfig-interfaces:interfaces/interface=Eth1%2f26/subinterfaces/subinterface=0/openconfig-if-ip:ipv4/
method: "PATCH"
status_code: 204
body: "{{ lookup('file','patch.txt') }}"
- name: "Test put_api"
sonic_api:
url: data/openconfig-network-instance:network-instances/network-instance=Vlan100
method: "PUT"
body: {"openconfig-network-instance:network-instance": [{"name": "Vlan100", "config": {"name": "Vlan100"}}]}
status_code: 204
- name: "Test get_api"
sonic_api:
url: data/openconfig-interfaces:interfaces/interface=Eth1%2f26
method: "GET"
status_code: 200
- name: "Test delete_api"
sonic_api:
url: data/openconfig-interfaces:interfaces/interface=Eth1%2f26/subinterfaces/subinterface=0/openconfig-if-ip:ipv4/addresses/address=131.1.1.1/config/prefix-length
method: "DELETE"
status_code: 204

View File

@@ -0,0 +1,321 @@
---
- name: Ansible Enterprise SONiC BGP resource module example
hosts: datacenter
gather_facts: False
connection: httpapi
collections:
- dellemc.enterprise_sonic
vars:
bgp_as1: 4
bgp_as2: 10
bgp_as3: 11
vrf1: VrfCheck1
tasks:
- name: "Configure route map configurations"
vars:
ansible_connection: network_cli
sonic_config:
commands:
- route-map aa permit 11
- route-map bb permit 22
- ip prefix-list p1 seq 1 permit 1.1.1.0/24
- ip prefix-list p2 seq 2 permit 2.2.2.128/25
save: yes
- name: Configure VRFs
sonic_vrfs:
config:
- name: "{{vrf1}}"
- name: "Test sonic_bgp"
sonic_bgp:
config:
- bgp_as: "{{bgp_as1}}"
router_id: 10.2.2.4
log_neighbor_changes: False
bestpath:
as_path:
confed: True
ignore: True
multipath_relax: False
multipath_relax_as_set: True
compare_routerid: True
med:
confed: True
missing_as_worst: True
max_med:
on_startup:
timer: 667
med_val: 7878
- bgp_as: "{{bgp_as2}}"
log_neighbor_changes: True
vrf_name: "{{vrf1}}"
bestpath:
as_path:
confed: False
ignore: True
multipath_relax_as_set: True
compare_routerid: True
med:
confed: True
missing_as_worst: True
max_med:
on_startup:
timer: 332
med_val: 9987
state: merged
- name: "Test sonic_bgp_af merge 01"
sonic_bgp_af:
config:
- bgp_as: "{{bgp_as1}}"
address_family:
afis:
- afi: ipv4
safi: unicast
advertise_all_vni: false
redistribute:
- metric: "20"
protocol: connected
route_map: aa
- metric: "26"
protocol: ospf
route_map: bb
- metric: "25"
protocol: static
route_map: aa
- afi: ipv6
safi: unicast
advertise_all_vni: true
redistribute:
- metric: "21"
protocol: connected
route_map: bb
- metric: "27"
protocol: ospf
route_map: aa
- metric: "28"
protocol: static
route_map: aa
- afi: l2vpn
safi: evpn
advertise_all_vni: True
advertise_default_gw: True
route_advertise_list:
- advertise_afi: ipv4
route_map: aa
- advertise_afi: ipv6
route_map: bb
- bgp_as: "{{bgp_as2}}"
vrf_name: "{{vrf1}}"
address_family:
afis:
- afi: ipv4
safi: unicast
redistribute:
- metric: "20"
protocol: connected
route_map: aa
- metric: "26"
protocol: ospf
route_map: bb
- metric: "25"
protocol: static
route_map: aa
- afi: ipv6
safi: unicast
redistribute:
- metric: "21"
protocol: connected
route_map: bb
- metric: "27"
protocol: ospf
route_map: aa
- metric: "28"
protocol: static
route_map: aa
- afi: l2vpn
safi: evpn
advertise_default_gw: True
route_advertise_list:
- advertise_afi: ipv4
route_map: aa
- advertise_afi: ipv6
route_map: bb
state: merged
- name: "Test sonic_bgp_neighbors merged state"
sonic_bgp_neighbors:
config:
- bgp_as: "{{bgp_as1}}"
peer_group:
- name: SPINE
remote_as:
peer_type: internal
bfd:
check_failure: true
enabled: true
profile: 'profile 1'
advertisement_interval: 15
timers:
keepalive: 50
holdtime: 40
capability:
dynamic: true
extended_nexthop: true
address_family:
afis:
- afi: ipv4
safi: unicast
ip_afi:
default_policy_name: aa
send_default_route: false
prefix_limit:
max_prefixes: 200
prevent_teardown: false
warning_threshold: 88
restart_timer: 5
prefix_list_in: p2
prefix_list_out: p1
- name: SPINE2
neighbors:
- neighbor: Eth1/1
remote_as:
peer_type: internal
peer_group: SPINE
advertisement_interval: 10
timers:
keepalive: 40
holdtime: 50
bfd:
enabled: false
capability:
dynamic: true
extended_nexthop: true
- neighbor: 192.168.1.4
- neighbor: Eth1/2
remote_as:
peer_as: 3
peer_group: SPINE2
advertisement_interval: 20
timers:
keepalive: 30
holdtime: 20
capability:
dynamic: true
- bgp_as: "{{bgp_as2}}"
vrf_name: "{{vrf1}}"
peer_group:
- name: SPINE3
remote_as:
peer_type: internal
bfd:
check_failure: false
enabled: true
profile: 'profile 3'
advertisement_interval: 15
timers:
keepalive: 50
holdtime: 40
capability:
dynamic: true
extended_nexthop: true
neighbors:
- neighbor: Eth1/11
peer_group: SPINE3
- neighbor: Eth1/12
state: merged
- name: "Test sonic_bgp_neighbors_af merge 01"
sonic_bgp_neighbors_af:
config:
- bgp_as: "{{bgp_as1}}"
neighbors:
- neighbor: Eth1/1
address_family:
- afi: ipv4
safi: unicast
activate: true
allowas_in:
value: 6
route_map:
- name: aa
direction: out
- name: bb
direction: in
route_reflector_client: false
route_server_client: true
- neighbor: Eth1/2
address_family:
- afi: ipv4
safi: unicast
activate: true
allowas_in:
origin: true
route_map:
- name: aa
direction: out
- name: bb
direction: in
route_reflector_client: true
route_server_client: true
ip_afi:
default_policy_name: bb
send_default_route: true
prefix_limit:
max_prefixes: 100
prevent_teardown: true
warning_threshold: 80
prefix_list_in: p1
prefix_list_out: p2
- bgp_as: "{{bgp_as2}}"
vrf_name: "{{vrf1}}"
neighbors:
- neighbor: Eth1/11
address_family:
- afi: ipv4
safi: unicast
activate: true
allowas_in:
value: 6
route_map:
- name: aa
direction: out
- name: bb
direction: in
route_reflector_client: false
route_server_client: true
- afi: ipv6
safi: unicast
activate: true
allowas_in:
value: 6
route_map:
- name: aa
direction: out
- name: bb
direction: in
route_reflector_client: false
route_server_client: true
- neighbor: Eth1/12
address_family:
- afi: ipv4
safi: unicast
activate: true
allowas_in:
origin: true
route_map:
- name: aa
direction: out
- name: bb
direction: in
route_reflector_client: true
route_server_client: true
- afi: ipv6
safi: unicast
activate: true
allowas_in:
value: 2
route_map:
- name: aa
direction: out
- name: bb
direction: in
route_reflector_client: true
route_server_client: true
state: merged

View File

@@ -0,0 +1,66 @@
---
- name: "Test Enterprise SONiC BGP Community configurations"
hosts: datacenter
gather_facts: no
connection: httpapi
collections:
- dellemc.enterprise_sonic
tasks:
- name: Add as_path_list configuration
sonic_bgp_as_paths:
config:
- name: test
members:
- "11"
- "22"
- "33"
permit: true
- name: test_1
members:
- "101.101"
- "201.201"
- "301.301"
permit: false
state: merged
- name: Add bgp_community configuration
sonic_bgp_communities:
config:
- name: test
type: expanded
permit: true
members:
regex:
- "11"
- "22"
- "33"
- name: test_1
type: expanded
permit: true
members:
regex:
- "101.101"
- "201.201"
- "301.301"
state: merged
- name: Add bgp_extcommunity configuration
sonic_bgp_ext_communities:
config:
- name: exp1
type: expanded
permit: true
members:
regex:
- "11"
- "22"
- "33"
- name: std1
type: standard
permit: true
members:
route_target:
- "101.101"
- "201.201"
route_origin:
- "301.301"
- "401.401"
state: merged

View File

@@ -0,0 +1,58 @@
---
- name: "Test SONiC CLI"
hosts: datacenter
gather_facts: no
connection: network_cli
collections:
- dellemc.enterprise_sonic
tasks:
- name: Test SONiC single command
sonic_command:
commands: 'show interface status'
register: cmd_op
- name: Test SONiC single command with wait_for
sonic_command:
commands: 'show version'
wait_for:
- result[0] contains Del
register: cmd_op
- name: Test SONiC multiple command with wait_for
sonic_command:
commands:
- 'show version'
- 'show system'
wait_for:
- result[0] contains Dell
- result[1] contains Hostname
register: cmd_op
- name: Test SONiC commands with wait_for negative case
sonic_command:
commands:
- 'show version'
- 'show system'
wait_for:
- result[0] contains Fel
- result[1] contains Hostname
register: cmd_op
ignore_errors: yes
- name: Test SONiC commands with wait_for and match=any
sonic_command:
commands:
- 'show version'
- 'show system'
wait_for:
- result[0] contains Fel
- result[1] contains Hostname
match: any
retries: 3
interval: 2
register: cmd_op
- name: Test SONiC command with prompt handling
sonic_command:
commands:
- command: 'image remove all'
prompt: '\[y/N\]:$'
answer: 'N'
register: cmd_op

View File

@@ -0,0 +1,42 @@
---
- hosts: datacenter
connection: network_cli
gather_facts: no
collections:
- dellemc.enterprise_sonic
tasks:
- name: "Configure SNMP community for SONiC device along with 'save'"
sonic_config:
commands: ['snmp-server community public group ro']
save: yes
- name: "Configure interface description using 'parents' option on SONiC device"
sonic_config:
lines:
- description hi
parents: ['interface Eth1/3']
- name: "Configure bgp using multiple level 'parents' on SONiC device"
sonic_config:
lines:
- maximum-paths 4
parents: ['router bgp 4', 'address-family ipv4 unicast']
- name: "Configure ip access-list using 'before' and 'after' option on SONiC device"
sonic_config:
lines:
- seq 1 permit tcp any any ack
parents: ['ip access-list test']
before: ['no ip access-list test']
after: ['no ip access-list test']
- name: "Configure cli using source file"
sonic_config:
src: src.txt
- name: "Configure cli with prompts on SONiC device"
sonic_config:
commands:
- command: 'do image remove all'
prompt: '\[y/N\]:$'
answer: 'N'

View File

@@ -0,0 +1,22 @@
---
- name: Ansible resource module facts example
hosts: datacenter
gather_facts: True
connection: httpapi
collections:
- dellemc.enterprise_sonic
tasks:
- name: "Gather facts"
sonic_facts:
gather_subset: min
gather_network_resources:
- interfaces
- l3_interfaces
- lag_interfaces
- vlans
- bgp
register: result
- name: "debug facts"
debug:
msg: "{{ result.ansible_facts.ansible_network_resources }}"

View File

@@ -0,0 +1,77 @@
---
- name: Ansible resource module example
hosts: datacenter
gather_facts: False
connection: httpapi
collections:
- dellemc.enterprise_sonic
tasks:
- name: sonic_interfaces configuration
sonic_interfaces:
config:
- name: Loopback91
- name: Eth1/12
description: "hi test"
enabled: False
- name: Eth1/13
description: "hi ans"
enabled: False
- name: Add VLANs
sonic_vlans:
config:
- vlan_id: 11
- vlan_id: 12
- vlan_id: 13
state: merged
- name: sonic_l2_interfaces configuration
sonic_l2_interfaces:
config:
- name: Eth1/12
access:
vlan: 12
- name: Eth1/13
access:
vlan: 11
trunk:
allowed_vlans:
- vlan: 12
- vlan: 13
state: merged
- name: sonic_lag_interfaces configuration
sonic_lag_interfaces:
config:
- name: PortChannel12
members:
interfaces:
- member: Eth1/20
- member: Eth1/21
- name: PortChannel1
members:
interfaces:
- member: Eth1/22
- name: PortChannel2
state: merged
- name: sonic_l3_interfaces configuration
sonic_l3_interfaces:
config:
- name: Loopback100
ipv4:
addresses:
- address: 101.1.1.1/32
- name: vlan 11
ipv6:
addresses:
- address: 150::1/16
- name: po 12
ipv4:
addresses:
- address: 180.1.1.1/16
- name: Eth1/24
ipv6:
enabled: true
- name: Merge port breakout configurations
sonic_port_breakout:
config:
- name: 1/11
mode: 1x100G
state: merged

View File

@@ -0,0 +1,18 @@
---
- name: Ansible resource module example for sonic_system
hosts: datacenter
gather_facts: False
connection: httpapi
collections:
- dellemc.enterprise_sonic
tasks:
- name: Test SONiC system
sonic_system:
config:
hostname: SONIC-test
interface_naming: standard
anycast_address:
ipv4: true
ipv6: true
mac_address: 00:09:5B:EC:EE:F2
state: merged

View File

@@ -0,0 +1,38 @@
---
- name: Ansible resource module example
hosts: datacenter
gather_facts: False
connection: httpapi
collections:
- dellemc.enterprise_sonic
tasks:
- name: Add VLANs configuration
sonic_vlans:
config:
- vlan_id: 11
- vlan_id: 12
- vlan_id: 13
state: merged
- name: configure VRFs
sonic_vrfs:
config:
- name: Vrfcheck1
- name: Vrfcheck2
- name: "sonic_vxlans configuration"
sonic_vxlans:
config:
- name: vteptest1
source_ip: 1.1.1.1
primary_ip: 2.2.2.2
evpn_nvo: nvo6
vlan_map:
- vni: 101
vlan: 11
- vni: 102
vlan: 12
vrf_map:
- vni: 101
vrf: Vrfcheck1
- vni: 102
vrf: Vrfcheck2
register: merged03_output

View File

@@ -0,0 +1,4 @@
interface Eth1/10
description hello
mtu 1800

View File

@@ -0,0 +1,51 @@
#
# (c) 2020 Red Hat Inc.
#
# (c) 2020 Dell Inc.
#
# This file is part of Ansible
#
# Ansible 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.
#
# Ansible 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 Ansible. If not, see <http://www.gnu.org/licenses/>.
#
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible_collections.ansible.netcommon.plugins.action.network import ActionModule as ActionNetworkModule
from ansible.utils.display import Display
display = Display()
DOCUMENTATION = """
short_description: Action plugin module for sonic CLI modules
version_added: 1.0.0
"""
class ActionModule(ActionNetworkModule):
def run(self, task_vars=None):
module_name = self._task.action.split('.')[-1]
self._config_module = True if module_name == 'sonic_config' else False
if self._play_context.connection in ('network_cli', 'httpapi'):
provider = self._task.args.get('provider', {})
if any(provider.values()):
display.warning('provider is unnecessary when using network_cli and will be ignored')
del self._task.args['provider']
result = super(ActionModule, self).run(task_vars=task_vars)
return result

View File

@@ -0,0 +1,118 @@
#
# (c) 2020 Red Hat Inc.
#
# (c) 2020 Dell Inc.
#
# This file is part of Ansible
#
# Ansible 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.
#
# Ansible 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 Ansible. If not, see <http://www.gnu.org/licenses/>.
#
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = """
---
name: sonic
short_description: Use sonic cliconf to run command on Dell OS10 platform
description:
- This sonic plugin provides low level abstraction apis for
sending and receiving CLI commands from Dell OS10 network devices.
"""
import json
from itertools import chain
from ansible.errors import AnsibleConnectionFailure
from ansible.module_utils._text import to_bytes, to_text
from ansible.module_utils.common._collections_compat import Mapping
from ansible_collections.ansible.netcommon.plugins.module_utils.network.common.utils import to_list
from ansible.plugins.cliconf import CliconfBase, enable_mode
class Cliconf(CliconfBase):
def get_device_info(self):
device_info = {}
device_info['network_os'] = 'sonic'
return device_info
@enable_mode
def edit_config(self, command):
response = []
self.send_command("configure terminal")
for cmd in to_list(command):
if isinstance(cmd, dict):
resp = self.get(command=cmd["command"], prompt=cmd["prompt"], answer=cmd["answer"])
response.append(resp)
else:
response.append(self.send_command(to_bytes(cmd)))
self.send_command("end")
return response
@enable_mode
def get_config(self, source="running", flags=None, format=None):
if source not in ("running", "startup"):
raise ValueError(
"fetching configuration from %s is not supported" % source
)
if not flags:
flags = []
if source == "running":
cmd = "show running-config "
else:
cmd = "show startup-config "
cmd += " ".join(to_list(flags))
cmd = cmd.strip()
return self.send_command(cmd)
def get(self, command, prompt=None, answer=None, sendonly=False, newline=True, check_all=False):
return self.send_command(command=command, prompt=prompt, answer=answer, sendonly=sendonly, newline=newline, check_all=check_all)
def get_capabilities(self):
result = super(Cliconf, self).get_capabilities()
return json.dumps(result)
def run_commands(self, commands=None, check_rc=True):
if commands is None:
raise ValueError("'commands' value is required")
responses = list()
for cmd in to_list(commands):
if not isinstance(cmd, Mapping):
cmd = {'command': cmd}
output = cmd.pop('output', None)
if output:
raise ValueError("'output' value %s is not supported for run_commands" % output)
try:
out = self.send_command(**cmd)
except AnsibleConnectionFailure as e:
if check_rc:
raise
out = getattr(e, 'err', to_text(e))
responses.append(out)
return responses
def set_cli_prompt_context(self):
"""
Make sure we are in the operational cli mode
:return: None
"""
if self._connection.connected:
self._update_cli_prompt_context(config_context=')#')

View File

@@ -0,0 +1,113 @@
# (c) 2019 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible 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.
#
# Ansible 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 Ansible. If not, see <http://www.gnu.org/licenses/>.
#
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = """
---
name: sonic
short_description: HttpApi Plugin for devices supporting Restconf SONIC API
description:
- This HttpApi plugin provides methods to connect to Restconf SONIC API endpoints.
version_added: 1.0.0
options:
root_path:
type: str
description:
- Specifies the location of the Restconf root.
default: '/restconf'
vars:
- name: ansible_httpapi_restconf_root
"""
import json
from ansible.module_utils._text import to_text
from ansible.module_utils.connection import ConnectionError
from ansible.module_utils.six.moves.urllib.error import HTTPError
from ansible.plugins.httpapi import HttpApiBase
from ansible_collections.ansible.netcommon.plugins.module_utils.network.common.utils import to_list
CONTENT_TYPE = 'application/yang-data+json'
class HttpApi(HttpApiBase):
def send_request(self, data, **message_kwargs):
if data:
data = json.dumps(data)
path = '/'.join([self.get_option('root_path').rstrip('/'), message_kwargs.get('path', '').lstrip('/')])
headers = {
'Content-Type': message_kwargs.get('content_type') or CONTENT_TYPE,
'Accept': message_kwargs.get('accept') or CONTENT_TYPE,
}
response, response_data = self.connection.send(path, data, headers=headers, method=message_kwargs.get('method'))
return handle_response(response, response_data, message_kwargs)
def get(self, command):
return self.send_request(path=command, data=None, method='get')
def edit_config(self, requests):
"""Send a list of http requests to remote device and return results
"""
if requests is None:
raise ValueError("'requests' value is required")
responses = list()
for req in to_list(requests):
try:
response = self.send_request(**req)
except ConnectionError as exc:
raise ConnectionError(to_text(exc, errors='surrogate_then_replace'))
responses.append(response)
return responses
def get_capabilities(self):
result = {}
result['rpc'] = []
result['network_api'] = 'sonic_rest'
return json.dumps(result)
def handle_response(response, response_data, request_data):
response_data = response_data.read()
try:
if not response_data:
response_data = ""
else:
response_data = json.loads(response_data.decode('utf-8'))
except ValueError:
pass
if isinstance(response, HTTPError):
if response_data:
if 'errors' in response_data:
errors = response_data['errors']['error']
error_text = '\n'.join((error['error-message'] for error in errors))
else:
error_text = response_data
error_text.update({u'code': response.code})
error_text.update({u'request_data': request_data})
raise ConnectionError(error_text, code=response.code)
raise ConnectionError(to_text(response), code=response.code)
return response.getcode(), response_data

View File

@@ -0,0 +1,66 @@
#
# -*- coding: utf-8 -*-
# Copyright 2021 Dell Inc. or its subsidiaries. All Rights Reserved
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#############################################
# WARNING #
#############################################
#
# This file is auto generated by the resource
# module builder playbook.
#
# Do not edit this file manually.
#
# Changes to this file will be over written
# by the resource module builder.
#
# Changes should be made in the model used to
# generate this file or in the resource module
# builder template.
#
#############################################
"""
The arg spec for the sonic_aaa module
"""
from __future__ import absolute_import, division, print_function
__metaclass__ = type
class AaaArgs(object): # pylint: disable=R0903
"""The arg spec for the sonic_aaa module
"""
def __init__(self, **kwargs):
pass
argument_spec = {
'config': {
'options': {
'authentication': {
'options': {
'data': {
'options': {
'fail_through': {'type': 'bool'},
'group': {
'choices': ['ldap', 'radius', 'tacacs+'],
'type': 'str'
},
'local': {'type': 'bool'}
},
'type': 'dict'
}
},
'type': 'dict'
}
},
'type': 'dict'
},
'state': {
'choices': ['merged', 'deleted'],
'default': 'merged', 'type': 'str'
}
} # pylint: disable=C0301

View File

@@ -0,0 +1,97 @@
#
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#############################################
# WARNING #
#############################################
#
# This file is auto generated by the resource
# module builder playbook.
#
# Do not edit this file manually.
#
# Changes to this file will be over written
# by the resource module builder.
#
# Changes should be made in the model used to
# generate this file or in the resource module
# builder template.
#
#############################################
"""
The arg spec for the sonic_bgp module
"""
from __future__ import absolute_import, division, print_function
__metaclass__ = type
class BgpArgs(object): # pylint: disable=R0903
"""The arg spec for the sonic_bgp module
"""
def __init__(self, **kwargs):
pass
argument_spec = {
'config': {
'elements': 'dict',
'options': {
'bestpath': {
'options': {
'as_path': {
'options': {
'confed': {'type': 'bool'},
'ignore': {'type': 'bool'},
'multipath_relax': {'type': 'bool'},
'multipath_relax_as_set': {'type': 'bool'}
},
'type': 'dict'
},
'compare_routerid': {'type': 'bool'},
'med': {
'options': {
'confed': {'type': 'bool'},
'missing_as_worst': {'type': 'bool'},
'always_compare_med': {'type': 'bool'}
},
'type': 'dict'
}
},
'type': 'dict'
},
'bgp_as': {'required': True, 'type': 'str'},
'log_neighbor_changes': {'type': 'bool'},
'router_id': {'type': 'str'},
"max_med": {
"options": {
"on_startup": {
"options": {
"timer": {"type": "int"},
"med_val": {"type": "int"}
},
"type": "dict"
}
},
"type": "dict"
},
'timers': {
'options': {
'holdtime': {'type': 'int'},
'keepalive_interval': {'type': 'int'}
},
'type': 'dict'
},
'vrf_name': {'default': 'default', 'type': 'str'}
},
'type': 'list'
},
'state': {
'choices': ['merged', 'deleted'],
'default': 'merged'
}
} # pylint: disable=C0301

View File

@@ -0,0 +1,117 @@
#
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#############################################
# WARNING #
#############################################
#
# This file is auto generated by the resource
# module builder playbook.
#
# Do not edit this file manually.
#
# Changes to this file will be over written
# by the resource module builder.
#
# Changes should be made in the model used to
# generate this file or in the resource module
# builder template.
#
#############################################
"""
The arg spec for the sonic_bgp_af module
"""
from __future__ import absolute_import, division, print_function
__metaclass__ = type
class Bgp_afArgs(object): # pylint: disable=R0903
"""The arg spec for the sonic_bgp_af module
"""
def __init__(self, **kwargs):
pass
argument_spec = {
'config': {
'elements': 'dict',
'options': {
'address_family': {
'options': {
'afis': {
'elements': 'dict',
'options': {
'advertise_pip': {'type': 'bool'},
'advertise_pip_ip': {'type': 'str'},
'advertise_pip_peer_ip': {'type': 'str'},
'advertise_svi_ip': {'type': 'bool'},
'route_advertise_list': {
'elements': 'dict',
'options': {
'advertise_afi': {
'choices': ['ipv4', 'ipv6'],
'required': True,
'type': 'str'
},
'route_map': {
'type': 'str'
}
},
'type': 'list'
},
'advertise_all_vni': {'type': 'bool'},
'advertise_default_gw': {'type': 'bool'},
'afi': {
'choices': ['ipv4', 'ipv6', 'l2vpn'],
'required': True,
'type': 'str'
},
'max_path': {
'options': {
'ebgp': {'type': 'int'},
'ibgp': {'type': 'int'}
},
'type': 'dict'
},
'network': {'type': 'list', 'elements': 'str'},
'dampening': {'type': 'bool'},
'redistribute': {
'elements': 'dict',
'options': {
'metric': {'type': 'str'},
'protocol': {
'choices': ['ospf', 'static', 'connected'],
'required': True,
'type': 'str'
},
'route_map': {'type': 'str'}
},
'type': 'list'
},
'safi': {
'choices': ['unicast', 'evpn'],
'default': 'unicast',
'type': 'str'
}
},
'required_together': [['afi', 'safi']],
'type': 'list'
}
},
'type': 'dict'
},
'bgp_as': {'required': True, 'type': 'str'},
'vrf_name': {'default': 'default', 'type': 'str'}
},
'type': 'list'
},
'state': {
'choices': ['merged', 'deleted'],
'default': 'merged'
}
} # pylint: disable=C0301

View File

@@ -0,0 +1,48 @@
#
# -*- coding: utf-8 -*-
# Copyright 2020 Dell Inc. or its subsidiaries. All Rights Reserved
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#############################################
# WARNING #
#############################################
#
# This file is auto generated by the resource
# module builder playbook.
#
# Do not edit this file manually.
#
# Changes to this file will be over written
# by the resource module builder.
#
# Changes should be made in the model used to
# generate this file or in the resource module
# builder template.
#
#############################################
"""
The arg spec for the sonic_bgp_as_paths module
"""
from __future__ import absolute_import, division, print_function
__metaclass__ = type
class Bgp_as_pathsArgs(object): # pylint: disable=R0903
"""The arg spec for the sonic_bgp_as_paths module
"""
def __init__(self, **kwargs):
pass
argument_spec = {'config': {'elements': 'dict',
'options': {'permit': {'required': False, 'type': 'bool'},
'members': {'elements': 'str',
'required': False,
'type': 'list'},
'name': {'required': True, 'type': 'str'}},
'type': 'list'},
'state': {'choices': ['merged', 'deleted'],
'default': 'merged',
'type': 'str'}} # pylint: disable=C0301

View File

@@ -0,0 +1,59 @@
#
# -*- coding: utf-8 -*-
# Copyright 2020 Dell Inc. or its subsidiaries. All Rights Reserved
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#############################################
# WARNING #
#############################################
#
# This file is auto generated by the resource
# module builder playbook.
#
# Do not edit this file manually.
#
# Changes to this file will be over written
# by the resource module builder.
#
# Changes should be made in the model used to
# generate this file or in the resource module
# builder template.
#
#############################################
"""
The arg spec for the sonic_bgp_communities module
"""
from __future__ import absolute_import, division, print_function
__metaclass__ = type
class Bgp_communitiesArgs(object): # pylint: disable=R0903
"""The arg spec for the sonic_bgp_communities module
"""
def __init__(self, **kwargs):
pass
argument_spec = {'config': {'elements': 'dict',
'options': {'aann': {'type': 'str'},
'local_as': {'type': 'bool'},
'match': {'choices': ['ALL', 'ANY'],
'default': 'ANY',
'type': 'str'},
'members': {'options': {'regex': {'elements': 'str',
'type': 'list'}},
'type': 'dict'},
'name': {'required': True, 'type': 'str'},
'no_advertise': {'type': 'bool'},
'no_export': {'type': 'bool'},
'no_peer': {'type': 'bool'},
'permit': {'type': 'bool'},
'type': {'choices': ['standard', 'expanded'],
'default': 'standard',
'type': 'str'}},
'type': 'list'},
'state': {'choices': ['merged', 'deleted'],
'default': 'merged',
'type': 'str'}} # pylint: disable=C0301

View File

@@ -0,0 +1,75 @@
#
# -*- coding: utf-8 -*-
# Copyright 2020 Dell Inc. or its subsidiaries. All Rights Reserved
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#############################################
# WARNING #
#############################################
#
# This file is auto generated by the resource
# module builder playbook.
#
# Do not edit this file manually.
#
# Changes to this file will be over written
# by the resource module builder.
#
# Changes should be made in the model used to
# generate this file or in the resource module
# builder template.
#
#############################################
"""
The arg spec for the sonic_bgp_ext_communities module
"""
from __future__ import absolute_import, division, print_function
__metaclass__ = type
class Bgp_ext_communitiesArgs(object): # pylint: disable=R0903
"""The arg spec for the sonic_bgp_ext_communities module
"""
def __init__(self, **kwargs):
pass
argument_spec = {
'config': {
'elements': 'dict',
'options': {
'match': {
'choices': ['all', 'any'],
'default': 'any',
'type': 'str'
},
'members': {
'mutually_exclusive': [
['regex', 'route_origin'],
['regex', 'route_target']
],
'options': {
'regex': {'elements': 'str', 'type': 'list'},
'route_origin': {'elements': 'str', 'type': 'list'},
'route_target': {'elements': 'str', 'type': 'list'}
},
'type': 'dict'
},
'name': {'required': True, 'type': 'str'},
'permit': {'type': 'bool'},
'type': {
'choices': ['standard', 'expanded'],
'default': 'standard',
'type': 'str'
}
},
'type': 'list'
},
'state': {
'choices': ['merged', 'deleted'],
'default': 'merged',
'type': 'str'
}
} # pylint: disable=C0301

Some files were not shown because too many files have changed in this diff Show More