diff options
Diffstat (limited to 'ansible_collections/dellemc/os10/roles')
361 files changed, 34914 insertions, 0 deletions
diff --git a/ansible_collections/dellemc/os10/roles/os10_aaa/LICENSE b/ansible_collections/dellemc/os10/roles/os10_aaa/LICENSE new file mode 100644 index 00000000..2c9b8e1f --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_aaa/LICENSE @@ -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) 2020, Dell Inc. All rights reserved. + + 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) 2020, Dell Inc. All rights reserved. + 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>. diff --git a/ansible_collections/dellemc/os10/roles/os10_aaa/README.md b/ansible_collections/dellemc/os10/roles/os10_aaa/README.md new file mode 100644 index 00000000..cabee7ea --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_aaa/README.md @@ -0,0 +1,136 @@ +AAA role +======== + +This role facilitates the configuration of authentication, authorization, and acccounting (AAA). It supports the configuration of RADIUS server, TACACS server, and AAA. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. + +The AAA role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. + +Role variables +-------------- + +- Role is abstracted using the `ansible_network_os` variable that can take `dellemc.os10.os10` as the value +- If `os10_cfg_generate` is set to true, the variable generates the role configuration commands in a file +- Any role variable with a corresponding state variable set to absent negates the configuration of that variable +- Setting an empty value for any variable negates the corresponding configuration +- Variables and values are case-sensitive + +**os10_aaa keys** + +| Key | Type | Description | Support | +|------------|---------------------------|---------------------------------------------------------|-----------------------| +| ``radius_server`` | dictionary | Configures the RADIUS server (see ``radius_server.*``) | os10 | +| ``radius_server.retransmit`` | integer | Configures the number of retransmissions | os10 | +| ``radius_server.timeout`` | integer | Configures the timeout for retransmissions | os10 | +| ``radius_server.host`` | dictionary | Configures the RADIUS server host (see ``host.*``) | os10 | +| ``host.ip`` | string | Configures the RADIUS server host address | os10 | +| ``host.key`` | string (required); 0,7,LINE | Configures the authentication key | os10 | +| ``host.auth_port`` | integer | Configures the authentication port (0 to 65535) | os10 | +| ``host.state`` | string: present,absent | Removes the RADIUS server host if set to absent | os10 | +| ``auth.key`` | string (required); 0,7,LINE | Configures the authentication key | os10 | +| ``tacacs_server`` | dictionary | Configures the TACACS server (see ``tacacs_server.*``) | os10 | +| ``tacacs_server.timeout`` | integer | Configures the timeout for retransmissions | os10 | +| ``tacacs_server.host`` | dictionary | Configures the TACACS server host (see ``host.*``) | os10 | +| ``host.ip`` | string | Configures the TACACS server host address | os10 | +| ``host.key`` | string (required); 0,7,LINE | Configures the authentication key | os10 | +| ``host.auth_port`` | integer | Configures the authentication port (0 to 65535) | os10 | +| ``host.state`` | string: present,absent | Removes the TACACS server host if set to absent | os10 | +| ``auth.key`` | string (required); 0,7,LINE | Configures the authentication key | os10 | +| ``aaa_accounting`` | dictionary | Configures accounting parameters (see ``aaa_accounting.*``) | os10 | +| ``aaa_accounting.accounting.accounting_type`` | dictionary | Configures accounting type | os10 | +| ``aaa_accounting.accounting.connection_type`` | dictionary | Configures accounting connection type | os10 | +| ``aaa_accounting.accounting.account_mode`` | dictionary | Configures accounting mode | os10 | +| ``aaa_accounting.accounting.server_group`` | dictionary | Configures accounting server group | os10 | +| ``aaa_accounting.accounting.state`` | string: present,absent | Configures/unconfigures accounting parameters | os10 | +| ``aaa_authentication`` | dictionary | Configures authentication parameters (see ``aaa_authentication.*``) | os10 | +| ``aaa_authentication.login`` | dictionary | Configures authentication login (see ``aaa_authentication.login.*``)| os10 | +| ``aaa_authentication.login.console`` | dictionary | Configures authentication method for console login | os10 | +| ``aaa_authentication.login.state`` | string: present,absent | Unconfigures authentication login if set to absent | os10 | +| ``aaa_authentication.login.type`` | dictionary | Configures authentication type | os10 | +| ``aaa_authentication.re_authenticate`` | boolean | Configures re-authenticate by enable if set to true | os10 | + +> **NOTE**: Asterisk (*) denotes the default value if none is specified. + +Connection variables +-------------------- + +Ansible Dell EMC network roles require connection information to establish communication with the nodes in your inventory. This information can exist in the Ansible *group_vars* or *host_vars* directories or inventory, or in the playbook itself. + +| Key | Required | Choices | Description | +|-------------|----------|------------|-----------------------------------------------------| +| ``ansible_host`` | yes | | Specifies the hostname or address for connecting to the remote device over the specified transport | +| ``ansible_port`` | no | | Specifies the port used to build the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_PORT` option is used; it defaults to 22 | +| ``ansible_ssh_user`` | no | | Specifies the username that authenticates the CLI login for the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_USER` environment variable value is used | +| ``ansible_ssh_pass`` | no | | Specifies the password that authenticates the connection to the remote device | +| ``ansible_become`` | no | yes, no\* | Instructs the module to enter privileged mode on the remote device before sending any commands; if value is unspecified, the `ANSIBLE_BECOME` environment variable value is used, and the device attempts to execute all commands in non-privileged mode | +| ``ansible_become_method`` | no | enable, sudo\* | Instructs the module to allow the become method to be specified for handling privilege escalation; if value is unspecified, the `ANSIBLE_BECOME_METHOD` environment variable value is used | +| ``ansible_become_pass`` | no | | Specifies the password to use if required to enter privileged mode on the remote device; if ``ansible_become`` is set to no this key is not applicable | +| ``ansible_network_os`` | yes | os10, null\* | Loads the correct terminal and cliconf plugins to communicate with the remote device | + +> **NOTE**: Asterisk (*) denotes the default value if none is specified. + + +Example playbook +---------------- + +This example uses the *os10_aaa* role to configure AAA for radius and TACACS servers. It creates a *hosts* file with the switch details and corresponding variables. The hosts file should define the `ansible_network_os` variable with the corresponding Dell EMC OS10 name. + +When `os10_cfg_generate` is set to true, the variable generates the configuration commands as a .part file in the *build_dir* path. By default, it is set to false and it writes a simple playbook that only references the *os10_aaa* role. + +**Sample hosts file** + + leaf1 ansible_host= <ip_address> + +**Sample host_vars/leaf1** + + hostname: leaf1 + ansible_become: yes + ansible_become_method: xxxxx + ansible_become_pass: xxxxx + ansible_ssh_user: xxxxx + ansible_ssh_pass: xxxxx + ansible_network_os: dellemc.os10.os10 + build_dir: ../temp/temp_os10 + + os10_aaa: + radius_server: + retransmit: 5 + timeout: 10 + host: + - ip: 2001:4898:f0:f09b::1001 + key: 0 + value: "abc" + auth_port: 3 + state: present + tacacs_server: + host: + - ip: 2001:4898:f0:f09b::1001 + key: 0 + value: "abc" + auth_port: 3 + state: present + timeout: 6 + aaa_authentication: + login: + - console: true + type: group radius group tacacs+ local + state: present + re_authenticate: true + aaa_accounting: + accounting: + - accounting_type: commands + connection_type: console + account_mode: start-stop + server_group: group tacacs+ + state: present + +**Simple playbook to setup system — leaf.yaml** + + - hosts: leaf1 + roles: + - dellemc.os10.os10_aaa + +**Run** + + ansible-playbook -i hosts leaf.yaml + +(c) 2017-2020 Dell Inc. or its subsidiaries. All rights reserved.
\ No newline at end of file diff --git a/ansible_collections/dellemc/os10/roles/os10_aaa/defaults/main.yml b/ansible_collections/dellemc/os10/roles/os10_aaa/defaults/main.yml new file mode 100644 index 00000000..4f8b5c8c --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_aaa/defaults/main.yml @@ -0,0 +1,16 @@ +--- +# defaults file for dellemc.os10.os10_aaa +attribute_type: + mandatory: mandatory + on_for_login_auth: on-for-login-auth + include_in_access_req: include-in-access-req + mac: "mac format" + mac_ietf: "mac format ietf" + mac_ietf_lower_case: "mac format ietf lower-case" + mac_ietf_upper_case: "mac format ietf upper-case" + mac_legacy: "mac format legacy" + mac_legacy_lower_case: "mac format legacy lower-case" + mac_legacy_upper_case: "mac format legacy upper-case" + mac_unformatted: "mac format unformatted" + mac_unformatted_lower_case: "mac format unformatted lower-case" + mac_unformatted_upper_case: "mac format unformatted upper-case" diff --git a/ansible_collections/dellemc/os10/roles/os10_aaa/handlers/main.yml b/ansible_collections/dellemc/os10/roles/os10_aaa/handlers/main.yml new file mode 100644 index 00000000..0b86ef12 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_aaa/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for dellemc.os10.os10_aaa diff --git a/ansible_collections/dellemc/os10/roles/os10_aaa/meta/main.yml b/ansible_collections/dellemc/os10/roles/os10_aaa/meta/main.yml new file mode 100644 index 00000000..54fde54e --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_aaa/meta/main.yml @@ -0,0 +1,17 @@ +# copyright (c) 2020 Dell Inc. or its subsidiaries. All Rights Reserved. +--- +galaxy_info: + author: Dell EMC Networking Engineering + description: The os10_aaa role facilitates the configuration of Authentication Authorization Acccounting (AAA) attributes in devices running Dell EMC SmartFabric OS10. + license: GPLv3 + min_ansible_version: 2.9.6 + + platforms: + - name: os10 + + galaxy_tags: + - networking + - dell + - emc + - dellemc + - os10 diff --git a/ansible_collections/dellemc/os10/roles/os10_aaa/tasks/main.yml b/ansible_collections/dellemc/os10/roles/os10_aaa/tasks/main.yml new file mode 100644 index 00000000..77eb07fc --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_aaa/tasks/main.yml @@ -0,0 +1,17 @@ +--- +# tasks file for os10 + + - name: "Generating AAA configuration for os10" + template: + src: os10_aaa.j2 + dest: "{{ build_dir }}/aaa10_{{ hostname }}.conf.part" + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") and ((os10_cfg_generate | default('False')) | bool) +# notify: save config os10 + register: generate_output + + - name: "Provisioning AAA configuration for os10" + os10_config: + src: os10_aaa.j2 + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") +# notify: save config os10 + register: output diff --git a/ansible_collections/dellemc/os10/roles/os10_aaa/templates/os10_aaa.j2 b/ansible_collections/dellemc/os10/roles/os10_aaa/templates/os10_aaa.j2 new file mode 100644 index 00000000..438c0f8e --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_aaa/templates/os10_aaa.j2 @@ -0,0 +1,148 @@ +#jinja2: trim_blocks: True,lstrip_blocks: True +{############################################# +Purpose: +Configure AAA commands for os10 Devices + +os10_aaa: + radius_server: + retransmit: 5 + timeout: 10 + host: + - ip: 2001:4898:f0:f09b::1001 + key: 0 + value: "abc" + auth_port: 3 + state: present + tacacs_server: + host: + - ip: 2001:4898:f0:f09b::1001 + key: 0 + value: "abc" + auth_port: 3 + state: present + timeout: 6 + aaa_authentication: + login: + - console: true + type: group radius group tacacs+ local + state: present + re_authenticate: true + aaa_accounting: + accounting: + - accounting_type: commands + connection_type: console + account_mode: start-stop + server_group: group tacacs+ + state: present + +##################################################} +{% if os10_aaa is defined and os10_aaa %} + {% if os10_aaa.radius_server is defined and os10_aaa.radius_server %} + {% set item = os10_aaa.radius_server %} + {% if item.retransmit is defined and item.retransmit %} +radius-server retransmit {{ item.retransmit }} + {% else %} +no radius-server retransmit + {% endif %} + {% if item.timeout is defined and item.timeout %} +radius-server timeout {{ item.timeout }} + {% else %} +no radius-server timeout + {% endif %} + {% if item.host is defined and item.host %} + {% for it in item.host %} + {% if it.ip is defined and it.ip %} + {% if it.state is defined and it.state == "absent" %} +no radius-server host {{ it.ip }} + {% else %} + {% if it.auth_port is defined and it.auth_port %} +radius-server host {{ it.ip }} auth-port {{ it.auth_port }} key {{ it.key }} {{ it.value }} + {% else %} +radius-server host {{ it.ip }} key {{ it.key }} {{ it.value }} + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% endif %} + {% if os10_aaa.tacacs_server is defined and os10_aaa.tacacs_server %} + {% set item = os10_aaa.tacacs_server %} + {% if item.timeout is defined and item.timeout %} +tacacs-server timeout {{ item.timeout }} + {% else %} +no tacacs-server timeout + {% endif %} + {% if item.host is defined and item.host %} + {% for it in item.host %} + {% if it.ip is defined and it.ip %} + {% if item.state is defined and item.state == "absent"%} +no tacacs-server host {{it.ip}} + {% else %} + {% if it.auth_port is defined and it.auth_port %} +tacacs-server host {{it.ip}} auth-port {{it.auth_port}} key {{it.key}} {{it.value}} + {% else %} +tacacs-server host {{it.ip}} key {{it.key}} {{it.value}} + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% endif %} + {% if os10_aaa.aaa_authentication is defined and os10_aaa.aaa_authentication %} + {% set aaa_list = os10_aaa.aaa_authentication %} + {% if aaa_list.login is defined and aaa_list.login %} + {% for aaa_vars in aaa_list.login %} + {% if aaa_vars.console is defined and aaa_vars.console %} + {% if aaa_vars.state is defined and aaa_vars.state == "absent"%} +no aaa authentication login console + {% else %} + {% if aaa_vars.type is defined and aaa_vars.type %} +aaa authentication login console {{aaa_vars.type}} + {% endif %} + {% endif %} + {% else %} + {% if aaa_vars.state is defined and aaa_vars.state == "absent"%} +no aaa authentication login default + {% else %} + {% if aaa_vars.type is defined and aaa_vars.type %} +aaa authentication login default {{aaa_vars.type}} + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% set aaa_vars = os10_aaa.aaa_authentication %} + {% if aaa_vars.re_authenticate is defined %} + {% if aaa_vars.re_authenticate %} +aaa re-authenticate enable + {% else %} +no aaa re-authenticate enable + {% endif %} + {% endif %} + {% endif %} + {% if os10_aaa.aaa_accounting is defined and os10_aaa.aaa_accounting %} + {% set acc_list = os10_aaa.aaa_accounting %} + {% if acc_list.accounting is defined and acc_list.accounting %} + {% for aaa_vars in acc_list.accounting %} + {% if aaa_vars.accounting_type is defined and aaa_vars.accounting_type %} + {% if aaa_vars.accounting_type == "commands" %} + {% set accounting_type = aaa_vars.accounting_type + " all" %} + {% endif %} + {% if aaa_vars.connection_type is defined and aaa_vars.connection_type %} + {% if aaa_vars.state is defined and aaa_vars.state == "absent"%} +no aaa accounting {{accounting_type}} {{aaa_vars.connection_type}} + {% else %} + {% if aaa_vars.account_mode is defined and aaa_vars.account_mode == "none" %} +aaa accounting {{accounting_type}} {{aaa_vars.connection_type}} {{aaa_vars.account_mode}} + {% else %} + {% if aaa_vars.server_group is defined and aaa_vars.server_group %} +aaa accounting {{accounting_type}} {{aaa_vars.connection_type}} {{aaa_vars.account_mode}} {{aaa_vars.server_group}} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% endif %} +{% endif %} diff --git a/ansible_collections/dellemc/os10/roles/os10_aaa/tests/inventory.yaml b/ansible_collections/dellemc/os10/roles/os10_aaa/tests/inventory.yaml new file mode 100644 index 00000000..b1ff63e6 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_aaa/tests/inventory.yaml @@ -0,0 +1,22 @@ +--- +spine1 ansible_host=10.11.182.25 ansible_network_os="dellemc.os10.os10" +spine2 ansible_host=10.16.151.220 ansible_network_os="dellemc.os10.os10" + +leaf1 ansible_host=10.11.182.23 ansible_network_os="dellemc.os10.os10" +leaf2 ansible_host=10.11.182.16 ansible_network_os="dellemc.os10.os10" +leaf3 ansible_host=10.11.182.17 ansible_network_os="dellemc.os10.os10" +leaf4 ansible_host=10.16.148.79 ansible_network_os="dellemc.os10.os10" + +[spine] +spine1 +spine2 + +[leaf] +leaf1 +leaf2 +leaf3 +leaf4 + +[datacenter:children] +spine +leaf diff --git a/ansible_collections/dellemc/os10/roles/os10_aaa/tests/main.os10.yaml b/ansible_collections/dellemc/os10/roles/os10_aaa/tests/main.os10.yaml new file mode 100644 index 00000000..a845c14d --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_aaa/tests/main.os10.yaml @@ -0,0 +1,35 @@ +--- +# vars file for dellemc.os10.os10_aaa, +# below gives a sample configuration +# Sample vars for OS10 device +os10_aaa: + radius_server: + retransmit: 5 + timeout: 10 + host: + - ip: 2001:4898:f0:f09b::1001 + key: 0 + value: "abc" + auth_port: 3 + state: present + tacacs_server: + host: + - ip: 2001:4898:f0:f09b::1001 + key: 0 + value: "abc" + auth_port: 3 + state: present + timeout: 6 + aaa_authentication: + login: + - console: true + type: group radius group tacacs+ local + state: present + re_authenticate: true + aaa_accounting: + accounting: + - accounting_type: commands + connection_type: console + account_mode: start-stop + server_group: group tacacs+ + state: present diff --git a/ansible_collections/dellemc/os10/roles/os10_aaa/tests/test.yaml b/ansible_collections/dellemc/os10/roles/os10_aaa/tests/test.yaml new file mode 100644 index 00000000..b3d685fb --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_aaa/tests/test.yaml @@ -0,0 +1,5 @@ +--- +- hosts: datacenter + connection: network_cli + roles: + - dellemc.os10.os10_aaa diff --git a/ansible_collections/dellemc/os10/roles/os10_aaa/vars/main.yml b/ansible_collections/dellemc/os10/roles/os10_aaa/vars/main.yml new file mode 100644 index 00000000..6854698e --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_aaa/vars/main.yml @@ -0,0 +1 @@ +# vars file for dellemc.os10.os10_aaa diff --git a/ansible_collections/dellemc/os10/roles/os10_acl/LICENSE b/ansible_collections/dellemc/os10/roles/os10_acl/LICENSE new file mode 100644 index 00000000..2c9b8e1f --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_acl/LICENSE @@ -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) 2020, Dell Inc. All rights reserved. + + 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) 2020, Dell Inc. All rights reserved. + 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>. diff --git a/ansible_collections/dellemc/os10/roles/os10_acl/README.md b/ansible_collections/dellemc/os10/roles/os10_acl/README.md new file mode 100644 index 00000000..14a1fe2a --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_acl/README.md @@ -0,0 +1,130 @@ +ACL role +======== + +This role facilitates the configuration of an access-control list (ACL). It supports the configuration of different types of ACLs (standard and extended) for both IPv4 and IPv6, and assigns the access-class to the line terminals. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. + +The ACL role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. + +Role variables +-------------- + +- Role is abstracted using the `ansible_network_os` variable that can take `dellemc.os10.os10` as the value +- If `os10_cfg_generate` is set to true, the variable generates the role configuration commands in a file +- Any role variable with a corresponding state variable set to absent negates the configuration of that variable +- Setting an empty value for any variable negates the corresponding configuration +- Variables and values are case-sensitive + +**os10_acl keys** + +| Key | Type | Description | Support | +|------------|---------------------------|---------------------------------------------------------|-----------------------| +| ``type`` | string (required): ipv4, ipv6, mac | Configures the L3 (IPv4/IPv6) or L2 (MAC) access-control list | os10 | +| ``name`` | string (required) | Configures the name of the access-control list | os10 | +| ``description`` | string | Configures the description about the access-control list | os10 | +| ``remark`` | list | Configures the ACL remark (see ``remark.*``) | os10| +| ``remark.number`` | integer (required) | Configures the remark sequence number | os10 | +| ``remark.description`` | string | Configures the remark description | os10 | +| ``remark.state`` | string: absent,present\* | Deletes the configured remark for an ACL entry if set to absent | os10 | +| ``entries`` | list | Configures ACL rules (see ``seqlist.*``) | os10 | +| ``entries.number`` | integer (required) | Specifies the sequence number of the ACL rule | os10 | +| ``entries.permit`` | boolean (required): true,false | Specifies the rule to permit packets if set to true; specifies to reject packets if set to false | os10 | +| ``entries.protocol`` | string (required) | Specifies the type of protocol or the protocol number to filter | os10 | +| ``entries.source`` | string (required) | Specifies the source address to match in the packets | os10 | +| ``entries.src_condition`` | string | Specifies the condition to filter packets from the source address; ignored if MAC | os10 | +| ``entries.destination`` | string (required) | Specifies the destination address to match in the packets | os10 | +| ``entries.dest_condition`` | string | Specifies the condition to filter packets to the destination address | os10 | +| ``entries.other_options`` | string | Specifies the other options applied on packets (count, log, order, monitor, and so on) | os10 | +| ``entries.state`` | string: absent,present\* | Deletes the rule from the ACL if set to absent | os10 | +| ``stage_ingress`` | list | Configures ingress ACL to the interface (see ``stage_ingress.*``) | os10 | +| ``stage_ingress.name`` | string (required) | Configures the ingress ACL filter to the interface with this interface name | os10 | +| ``stage_ingress.state`` | string: absent,present\* | Deletes the configured ACL from the interface if set to absent | os10 | +| ``stage_egress`` | list | Configures egress ACL to the interface (see ``stage_egress.*``) | os10 | +| ``stage_egress.name`` | string (required) | Configures the egress ACL filter to the interface with this interface name | os10 | +| ``stage_egress.state`` | string: absent,present\* | Deletes the configured egress ACL from the interface if set to absent | os10 | +| ``lineterminal`` | list | Configures the terminal to apply the ACL (see ``lineterminal.*``) | os10 | +| ``lineterminal.state`` | string: absent,present\* | Deletes the access-class from line terminal if set to absent | os10 | +| ``state`` | string: absent,present\* | Deletes the ACL if set to absent | os10 | + +> **NOTE**: Asterisk (\*) denotes the default value if none is specified. + +Connection variables +-------------------- + +Ansible Dell EMC network roles require connection information to establish communication with the nodes in inventory. This information can exist in the Ansible *group_vars* or *host_vars* directories or inventory, or in the playbook itself. + +| Key | Required | Choices | Description | +|-------------|----------|------------|-------------------------------------------------------| +| ``ansible_host`` | yes | | Specifies the hostname or address for connecting to the remote device over the specified transport | +| ``ansible_port`` | no | | Specifies the port used to build the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_PORT` option is used; it defaults to 22 | +| ``ansible_ssh_user`` | no | | Specifies the username that authenticates the CLI login for the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_USER` environment variable value is used | +| ``ansible_ssh_pass`` | no | | Specifies the password that authenticates the connection to the remote device | +| ``ansible_become`` | no | yes, no\* | Instructs the module to enter privileged mode on the remote device before sending any commands; if value is unspecified, the `ANSIBLE_BECOM`E environment variable value is used, and the device attempts to execute all commands in non-privileged mode | +| ``ansible_become_method`` | no | enable, sudo\* | Instructs the module to allow the become method to be specified for handling privilege escalation; if value is unspecified, the `ANSIBLE_BECOME_METHOD` environment variable value is used | +| ``ansible_become_pass`` | no | | Specifies the password to use if required to enter privileged mode on the remote device; if ``ansible_become`` is set to no this key is not applicable | +| ``ansible_network_os`` | yes | os10, null\* | Loads the correct terminal and cliconf plugins to communicate with the remote device | + +> **NOTE**: Asterisk (_*_) denotes the default value if none is specified. + + +Example playbook +---------------- + +This example uses the *os10_acl* role to configure different types of ACLs (standard and extended) for both IPv4 and IPv6 and assigns the access-class to the line terminals. The example creates a *hosts* file with the switch details and corresponding variables. The hosts file should define the `ansible_network_os` variable with the corresponding Dell EMC OS10 name. + +When `os10_cfg_generate` is set to true, it generates the configuration commands as a .part file in the *build_dir* path. By default it is set to false. It writes a simple playbook that only references the *os10_acl* role. + +**Sample hosts file** + + leaf1 ansible_host= <ip_address> + +**Sample host_vars/leaf1** + + hostname: leaf1 + ansible_become: yes + ansible_become_method: xxxxx + ansible_become_pass: xxxxx + ansible_ssh_user: xxxxx + ansible_ssh_pass: xxxxx + ansible_network_os: dellemc.os10.os10 + build_dir: ../temp/temp_os10 + os10_acl: + - name: ssh + type: ipv4 + description: acl + remark: + - description: 1 + number: 3 + state: absent + entries: + - number: 14 + permit: true + protocol: tcp + source: any + src_condition: neq 6 + destination: any + dest_condition: eq 4 + other_options: count + state: present + stage_ingress: + - name: ethernet 1/1/1 + state: absent + - name: ethernet 1/1/2 + state: absent + stage_egress: + - name: ethernet 1/1/3 + state: absent + lineterminal: + state: absent + state: present + +**Simple playbook to setup system — leaf.yaml** + + - hosts: leaf1 + roles: + - dellemc.os10.os10_acl + +**Run** + + ansible-playbook -i hosts leaf.yaml + +(c) 2017-2020 Dell Inc. or its subsidiaries. All rights reserved.
\ No newline at end of file diff --git a/ansible_collections/dellemc/os10/roles/os10_acl/defaults/main.yml b/ansible_collections/dellemc/os10/roles/os10_acl/defaults/main.yml new file mode 100644 index 00000000..9c7559e3 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_acl/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for dellemc.os10.os10_acl diff --git a/ansible_collections/dellemc/os10/roles/os10_acl/handlers/main.yml b/ansible_collections/dellemc/os10/roles/os10_acl/handlers/main.yml new file mode 100644 index 00000000..162d4a3f --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_acl/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for dellemc.os10.os10_acl diff --git a/ansible_collections/dellemc/os10/roles/os10_acl/meta/main.yml b/ansible_collections/dellemc/os10/roles/os10_acl/meta/main.yml new file mode 100644 index 00000000..c354b58f --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_acl/meta/main.yml @@ -0,0 +1,17 @@ +# Copyright (c) 2017-2020 Dell Inc. or its subsidiaries. All Rights Reserved. +--- +galaxy_info: + author: Dell EMC Networking Engineering + description: The os10_acl role facilitates the configuration of access control list (ACL) attributes in devices running Dell EMC SmartFabric OS10. + license: GPLv3 + min_ansible_version: 2.9.6 + + platforms: + - name: os10 + + galaxy_tags: + - networking + - dell + - emc + - dellemc + - os10 diff --git a/ansible_collections/dellemc/os10/roles/os10_acl/tasks/main.yml b/ansible_collections/dellemc/os10/roles/os10_acl/tasks/main.yml new file mode 100644 index 00000000..ace51340 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_acl/tasks/main.yml @@ -0,0 +1,16 @@ +--- +# tasks file for os10 + - name: "Generating ACL configuration for os10" + template: + src: os10_acl.j2 + dest: "{{ build_dir }}/acl10_{{ hostname }}.conf.part" + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") and ((os10_cfg_generate | default('False')) | bool) +# notify: save config os10 + register: generate_output + + - name: "Provisioning ACL configuration for os10" + os10_config: + src: os10_acl.j2 + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") +# notify: save config os10 + register: output diff --git a/ansible_collections/dellemc/os10/roles/os10_acl/templates/os10_acl.j2 b/ansible_collections/dellemc/os10/roles/os10_acl/templates/os10_acl.j2 new file mode 100644 index 00000000..7d6cb31d --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_acl/templates/os10_acl.j2 @@ -0,0 +1,212 @@ +#jinja2: trim_blocks: True,lstrip_blocks: True +{#################################### + +Purpose: +Configure ACL commands for OS10 devices + +os10_acl: + - name: ssh-only + type: ipv4 + description: acl + remark: + - description: 1 + number: 3 + state: present + entries: + - number: 10 + permit: true + protocol: tcp + source: any + destination: any + src_condition: eq 22 + dest_condition: eq 2 ack + other_options: count + state: present + stage_ingress: + - name: ethernet 1/1/1 + state: present + - name: ethernet 1/0/1 + state: present + stage_egress: + - name: ethernet 1/1/2 + state: present + lineterminal: + state: present + state: present +#####################################} +{% if os10_acl is defined and os10_acl %} + {% for val in os10_acl %} + {% if val.name is defined and val.name %} + {% if val.state is defined and val.state == "absent" %} + {% if val.type is defined and val.type == "ipv4" %} +no ip access-list {{ val.name }} + {% elif val.type is defined and val.type == "ipv6" %} +no ipv6 access-list {{ val.name }} + {% elif val.type is defined and val.type == "mac" %} +no mac access-list {{ val.name }} + {% endif %} + {% else %} + {% if val.type is defined and val.type == "ipv4" %} +ip access-list {{ val.name }} + {% elif val.type is defined and val.type == "ipv6" %} +ipv6 access-list {{ val.name }} + {% elif val.type is defined and val.type == "mac" %} +mac access-list {{ val.name }} + {% endif %} + {% if val.description is defined %} + {% if val.description %} + description "{{ val.description }}" + {% endif %} + {% endif %} + {% if val.remark is defined and val.remark %} + {% for remark in val.remark %} + {% if remark.description is defined and remark.description %} + {% if remark.number is defined and remark.number %} + {% if remark.state is defined and remark.state == "absent" %} + no seq {{ remark.number }} + {% else %} + seq {{ remark.number }} remark "{{ remark.description }}" + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% if val.entries is defined and val.entries %} + {% for rule in val.entries %} + {% if rule.number is defined and rule.number %} + {% if rule.state is defined and rule.state == "absent" %} + no seq {{ rule.number }} + {% else %} + {% if rule.permit is defined %} + {% if rule.permit %} + {% set is_permit = "permit" %} + {% else %} + {% set is_permit = "deny" %} + {% endif %} + {% endif %} + {% if val.type is defined and val.type %} + {% if rule.protocol is defined and rule.protocol %} + {% if rule.source is defined and rule.source %} + {% if rule.src_condition is defined and rule.src_condition %} + {% if rule.destination is defined and rule.destination %} + {% if rule.dest_condition is defined and rule.dest_condition %} + {% if rule.other_options is defined and rule.other_options %} + {% set other_options = rule.other_options %} + seq {{ rule.number }} {{ is_permit }} {{ rule.protocol }} {{ rule.source }} {{ rule.src_condition }} {{ rule.destination }} {{ rule.dest_condition }} {{ other_options }} + {% else %} + seq {{ rule.number }} {{ is_permit }} {{ rule.protocol }} {{ rule.source }} {{ rule.src_condition }} {{ rule.destination }} {{ rule.dest_condition }} + {% endif %} + {% else %} + {% if rule.other_options is defined and rule.other_options %} + {% set other_options = rule.other_options %} + seq {{ rule.number }} {{ is_permit }} {{ rule.protocol }} {{ rule.source }} {{ rule.src_condition }} {{ rule.destination }} {{ other_options }} + {% else %} + seq {{ rule.number }} {{ is_permit }} {{ rule.protocol }} {{ rule.source }} {{ rule.src_condition }} {{ rule.destination }} + {% endif %} + {% endif %} + {% endif %} + {% else %} + {% if rule.destination is defined and rule.destination %} + {% if rule.dest_condition is defined and rule.dest_condition %} + {% if rule.other_options is defined and rule.other_options %} + {% set other_options = rule.other_options %} + seq {{ rule.number }} {{ is_permit }} {{ rule.protocol }} {{ rule.source }} {{ rule.destination }} {{ rule.dest_condition }} {{ other_options }} + {% else %} + seq {{ rule.number }} {{ is_permit }} {{ rule.protocol }} {{ rule.source }} {{ rule.destination }} {{ rule.dest_condition }} + {% endif %} + {% else %} + {% if rule.other_options is defined and rule.other_options %} + {% set other_options = rule.other_options %} + seq {{ rule.number }} {{ is_permit }} {{ rule.protocol }} {{ rule.source }} {{ rule.destination }} {{ other_options }} + {% else %} + seq {{ rule.number }} {{ is_permit }} {{ rule.protocol }} {{ rule.source }} {{ rule.destination }} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + + {% if val.lineterminal is defined and val.lineterminal %} + {% if val.type is defined and not val.type == "mac" %} +line vty + {% if val.lineterminal.state is defined and val.lineterminal.state == "absent" %} + {% if val.type == "ipv6" %} + no ipv6 access-class {{ val.name }} + {% elif val.type == "ipv4" %} + no ip access-class {{ val.name }} + {% endif %} + {% else %} + {% if val.type == "ipv6" %} + ipv6 access-class {{ val.name }} + {% elif val.type == "ipv4" %} + ip access-class {{ val.name }} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + + {% if val.stage_ingress is defined and val.stage_ingress %} + {% for intf in val.stage_ingress %} + {% if intf.state is defined and intf.state == "absent" %} + {% if intf.name is defined and intf.name %} +interface {{ intf.name }} + {% if val.type is defined and val.type == "mac" %} + no mac access-group {{ val.name }} in + {% elif val.type is defined and val.type == "ipv6" %} + no ipv6 access-group {{ val.name }} in + {% else %} + no ip access-group {{ val.name }} in + {% endif %} + {% endif %} + {% else %} + {% if intf.name is defined and intf.name %} +interface {{ intf.name }} + {% if val.type is defined and val.type == "mac" %} + mac access-group {{ val.name }} in + {% elif val.type is defined and val.type == "ipv6" %} + ipv6 access-group {{ val.name }} in + {% else %} + ip access-group {{ val.name }} in + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + + {% if val.stage_egress is defined and val.stage_egress %} + {% for intf in val.stage_egress %} + {% if intf.state is defined and intf.state == "absent" %} + {% if intf.name is defined and intf.name %} +interface {{ intf.name }} + {% if val.type is defined and val.type == "mac" %} + no mac access-group {{ val.name }} out + {% elif val.type is defined and val.type == "ipv6" %} + no ipv6 access-group {{ val.name }} out + {% else %} + no ip access-group {{ val.name }} out + {% endif %} + {% endif %} + {% else %} + {% if intf.name is defined and intf.name %} +interface {{ intf.name }} + {% if val.type is defined and val.type == "mac" %} + mac access-group {{ val.name }} out + {% elif val.type is defined and val.type == "ipv6" %} + ipv6 access-group {{ val.name }} out + {% else %} + ip access-group {{ val.name }} out + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% endif %} + {% endif %} + {% endfor %} +{% endif %} diff --git a/ansible_collections/dellemc/os10/roles/os10_acl/tests/inventory.yaml b/ansible_collections/dellemc/os10/roles/os10_acl/tests/inventory.yaml new file mode 100644 index 00000000..b1ff63e6 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_acl/tests/inventory.yaml @@ -0,0 +1,22 @@ +--- +spine1 ansible_host=10.11.182.25 ansible_network_os="dellemc.os10.os10" +spine2 ansible_host=10.16.151.220 ansible_network_os="dellemc.os10.os10" + +leaf1 ansible_host=10.11.182.23 ansible_network_os="dellemc.os10.os10" +leaf2 ansible_host=10.11.182.16 ansible_network_os="dellemc.os10.os10" +leaf3 ansible_host=10.11.182.17 ansible_network_os="dellemc.os10.os10" +leaf4 ansible_host=10.16.148.79 ansible_network_os="dellemc.os10.os10" + +[spine] +spine1 +spine2 + +[leaf] +leaf1 +leaf2 +leaf3 +leaf4 + +[datacenter:children] +spine +leaf diff --git a/ansible_collections/dellemc/os10/roles/os10_acl/tests/main.os10.yaml b/ansible_collections/dellemc/os10/roles/os10_acl/tests/main.os10.yaml new file mode 100644 index 00000000..c3db9c98 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_acl/tests/main.os10.yaml @@ -0,0 +1,33 @@ +--- +# vars file for dellemc.os10.os10_acl, +# below gives a sample configuration +# Sample variables for OS10 device +os10_acl: + - name: ssh + type: ipv4 + description: acl + remark: + - description: 1 + number: 3 + state: absent + entries: + - number: 14 + permit: true + protocol: tcp + source: any + src_condition: neq 6 + destination: any + dest_condition: eq 4 + other_options: count + state: present + stage_ingress: + - name: ethernet 1/1/1 + state: absent + - name: ethernet 1/1/2 + state: absent + stage_egress: + - name: ethernet 1/1/3 + state: absent + lineterminal: + state: absent + state: present diff --git a/ansible_collections/dellemc/os10/roles/os10_acl/tests/test.yaml b/ansible_collections/dellemc/os10/roles/os10_acl/tests/test.yaml new file mode 100644 index 00000000..653f9d69 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_acl/tests/test.yaml @@ -0,0 +1,5 @@ +--- +- hosts: datacenter + connection: network_cli + roles: + - dellemc.os10.os10_acl diff --git a/ansible_collections/dellemc/os10/roles/os10_acl/vars/main.yml b/ansible_collections/dellemc/os10/roles/os10_acl/vars/main.yml new file mode 100644 index 00000000..0cd37964 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_acl/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for dellemc.os10.os10_acl diff --git a/ansible_collections/dellemc/os10/roles/os10_bfd/LICENSE b/ansible_collections/dellemc/os10/roles/os10_bfd/LICENSE new file mode 100644 index 00000000..2c9b8e1f --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_bfd/LICENSE @@ -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) 2020, Dell Inc. All rights reserved. + + 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) 2020, Dell Inc. All rights reserved. + 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>. diff --git a/ansible_collections/dellemc/os10/roles/os10_bfd/README.md b/ansible_collections/dellemc/os10/roles/os10_bfd/README.md new file mode 100644 index 00000000..c6907992 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_bfd/README.md @@ -0,0 +1,89 @@ +BFD role +=========== + +This role facilitates the configuration of bidirectional forwarding detection (BFD) global attributes. It specifically enables configuration of BFD interval, min_rx, multiplier, and role. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. + +The BFD role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. + +Role variables +-------------- + +- Role is abstracted using the `ansible_network_os` variable that can take `dellemc.os10.os10` as the value +- If `os10_cfg_generate` is set to true, the variable generates the role configuration commands in a file +- Any role variable with a corresponding state variable set to absent negates the configuration of that variable +- Setting an empty value for any variable negates the corresponding configuration +- Variables and values are case-sensitive + +**os10_bfd keys** + +| Key | Type | Description | Support | +|------------|---------------------------|---------------------------------------------------------|-----------------------| +| ``bfd`` | dictionary | Configures global BFD parameters (see ``bfd.*``) | os10 | +| ``bfd.interval`` | integer | Configures the time interval in ms (100 to 1000) | os10 | +| ``bfd.min_rx`` | integer | Configures maximum waiting time for receiving control packets from BFD peers in ms (100 to 1000)| os10 | +| ``bfd.multiplier`` | integer | Configures the maximum number of consecutive packets that are not received from BFD peers before session state changes to Down (3 to 50) | os10 | +| ``bfd.role`` | string: passive,active\* | Configures the BFD role | os10 | +| ``bfd.state`` | string: absent,present\* | Removes the global BFD if set to absent | os10 | + +> **NOTE**: Asterisk (\*) denotes the default value if none is specified. + +Connection variables +******************** + +Ansible Dell EMC network roles require connection information to establish communication with the nodes in your inventory. This information can exist in the Ansible *group_vars* or *host_vars* directories, or inventory or in the playbook itself. + +| Key | Required | Choices | Description | +|-------------|----------|------------|-----------------------------------------------------| +| ``ansible_host`` | yes | | Specifies the hostname or address for connecting to the remote device over the specified transport | +| ``ansible_port`` | no | | Specifies the port used to build the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_PORT` option is used; it defaults to 22 | +| ``ansible_ssh_user`` | no | | Specifies the username that authenticates the CLI login for the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_USER` environment variable value is used | +| ``ansible_ssh_pass`` | no | | Specifies the password that authenticates the connection to the remote device | +| ``ansible_become`` | no | yes, no\* | Instructs the module to enter privileged mode on the remote device before sending any commands; if value is unspecified, the `ANSIBLE_BECOME` environment variable value is used, and the device attempts to execute all commands in non-privileged mode | +| ``ansible_become_method`` | no | enable, sudo\* | Instructs the module to allow the become method to be specified for handling privilege escalation; if value is unspecified, the `ANSIBLE_BECOME_METHOD` environment variable value is used | +| ``ansible_become_pass`` | no | | Specifies the password to use if required to enter privileged mode on the remote device; if ``ansible_become`` is set to no this key is not applicable | +| ``ansible_network_os`` | yes | os10, null\* | Loads the correct terminal and cliconf plugins to communicate with the remote device | + +> **NOTE**: Asterisk (\*) denotes the default value if none is specified. + + +Example playbook +---------------- + +This example uses the *os10_bfd role* to completely set the global BFD attributes. It creates a *hosts* file with the switch details and corresponding variables. The hosts file should define the `ansible_network_os` variable with corresponding Dell EMC OS10 name. + +When `os10_cfg_generate` is set to true, the variable generates the configuration commands as a .part file in *build_dir* path. By default, the variable is set to false. The bfd role writes a simple playbook that only references the *os10_bfd* role. By including the role, you automatically get access to all of the tasks to configure BFD feature. + +**Sample hosts file** + + leaf1 ansible_host= <ip_address> + +**Sample host_vars/leaf1** + + hostname: leaf1 + ansible_become: yes + ansible_become_method: xxxxx + ansible_become_pass: xxxxx + ansible_ssh_user: xxxxx + ansible_ssh_pass: xxxxx + ansible_network_os: dellemc.os10.os10 + build_dir: ../temp/os10 + + os10_bfd: + bfd: + interval: 100 + min_rx: 100 + multiplier: 3 + role: "active" + state: "present" + +**Simple playbook to setup bfd — leaf.yaml** + + - hosts: leaf1 + roles: + - dellemc.os10.os10_bfd + +**Run** + + ansible-playbook -i hosts leaf.yaml + +(c) 2017-2020 Dell Inc. or its subsidiaries. All rights reserved.
\ No newline at end of file diff --git a/ansible_collections/dellemc/os10/roles/os10_bfd/defaults/main.yml b/ansible_collections/dellemc/os10/roles/os10_bfd/defaults/main.yml new file mode 100644 index 00000000..4aa9bfbb --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_bfd/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for dellemc.os10.os10_bfd diff --git a/ansible_collections/dellemc/os10/roles/os10_bfd/handlers/main.yml b/ansible_collections/dellemc/os10/roles/os10_bfd/handlers/main.yml new file mode 100644 index 00000000..b490464e --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_bfd/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for dellemc.os10.os10_bfd diff --git a/ansible_collections/dellemc/os10/roles/os10_bfd/meta/main.yml b/ansible_collections/dellemc/os10/roles/os10_bfd/meta/main.yml new file mode 100644 index 00000000..fce02059 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_bfd/meta/main.yml @@ -0,0 +1,18 @@ +# Copyright (c) 2020 Dell Inc. or its subsidiaries. All Rights Reserved. +--- +galaxy_info: + role_name: os10_bfd + author: Dell EMC Networking Engineering + description: The os10_bfd role facilitates the configuration of global bfd attributes in devices running Dell EMC SmartFabric OS10. + license: GPLv3 + min_ansible_version: 2.9.6 + + platforms: + - name: os10 + + galaxy_tags: + - networking + - dell + - emc + - dellemc + - os10 diff --git a/ansible_collections/dellemc/os10/roles/os10_bfd/tasks/main.yml b/ansible_collections/dellemc/os10/roles/os10_bfd/tasks/main.yml new file mode 100644 index 00000000..88ac0eb5 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_bfd/tasks/main.yml @@ -0,0 +1,16 @@ +--- +# tasks file for os10 + - name: "Generating bfd global configuration for os10" + template: + src: os10_bfd.j2 + dest: "{{ build_dir }}/bfd10_{{ hostname }}.conf.part" + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") and ((os10_cfg_generate | default('False')) | bool) +# notify: save config os10 + register: generate_output + + - name: "Provisioning bfd global configuration for os10" + os10_config: + src: os10_bfd.j2 + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") +# notify: save config os10 + register: output diff --git a/ansible_collections/dellemc/os10/roles/os10_bfd/templates/os10_bfd.j2 b/ansible_collections/dellemc/os10/roles/os10_bfd/templates/os10_bfd.j2 new file mode 100644 index 00000000..18c94644 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_bfd/templates/os10_bfd.j2 @@ -0,0 +1,34 @@ +#jinja2: trim_blocks: True,lstrip_blocks: True +{############################################# +#Purpose: +Configure bfd global commands for os10 Devices + +os10_bfd: + bfd: + interval: 200 + min_rx: 200 + multiplier: 3 + role: "active" + state: "present" +###############################################} +{% if os10_bfd is defined and os10_bfd %} + {% set bfd_vars = os10_bfd %} + {% if bfd_vars.bfd is defined and bfd_vars.bfd %} + {% set bfd = bfd_vars.bfd %} + {% if bfd.state is defined and bfd.state == "absent" %} +no bfd enable +no bfd interval + {% else %} +bfd enable + {% if bfd.interval is defined and bfd.min_rx is defined and bfd.multiplier is defined %} + {% if bfd.interval and bfd.min_rx and bfd.multiplier %} + {% if bfd.role is defined and bfd.role %} +bfd interval {{ bfd.interval }} min_rx {{ bfd.min_rx }} multiplier {{ bfd.multiplier }} role {{ bfd.role }} + {% else %} +bfd interval {{ bfd.interval }} min_rx {{ bfd.min_rx }} multiplier {{ bfd.multiplier }} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endif %} +{% endif %} diff --git a/ansible_collections/dellemc/os10/roles/os10_bfd/tests/inventory.yaml b/ansible_collections/dellemc/os10/roles/os10_bfd/tests/inventory.yaml new file mode 100644 index 00000000..b1ff63e6 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_bfd/tests/inventory.yaml @@ -0,0 +1,22 @@ +--- +spine1 ansible_host=10.11.182.25 ansible_network_os="dellemc.os10.os10" +spine2 ansible_host=10.16.151.220 ansible_network_os="dellemc.os10.os10" + +leaf1 ansible_host=10.11.182.23 ansible_network_os="dellemc.os10.os10" +leaf2 ansible_host=10.11.182.16 ansible_network_os="dellemc.os10.os10" +leaf3 ansible_host=10.11.182.17 ansible_network_os="dellemc.os10.os10" +leaf4 ansible_host=10.16.148.79 ansible_network_os="dellemc.os10.os10" + +[spine] +spine1 +spine2 + +[leaf] +leaf1 +leaf2 +leaf3 +leaf4 + +[datacenter:children] +spine +leaf diff --git a/ansible_collections/dellemc/os10/roles/os10_bfd/tests/main.yaml b/ansible_collections/dellemc/os10/roles/os10_bfd/tests/main.yaml new file mode 100644 index 00000000..844b91c1 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_bfd/tests/main.yaml @@ -0,0 +1,11 @@ +--- +# vars file for dellemc.os10.os10_bfd, +# below gives a sample configuration +# Sample variables for OS10 device +os10_bfd: + bfd: + interval: 100 + min_rx: 100 + multiplier: 3 + role: "active" + state: "present" diff --git a/ansible_collections/dellemc/os10/roles/os10_bfd/tests/test.yaml b/ansible_collections/dellemc/os10/roles/os10_bfd/tests/test.yaml new file mode 100644 index 00000000..a0de5db5 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_bfd/tests/test.yaml @@ -0,0 +1,5 @@ +--- +- hosts: datacenter + connection: network_cli + roles: + - dellemc.os10.os10_bfd diff --git a/ansible_collections/dellemc/os10/roles/os10_bfd/vars/main.yml b/ansible_collections/dellemc/os10/roles/os10_bfd/vars/main.yml new file mode 100644 index 00000000..781a25c8 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_bfd/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for dellemc.os10.os10_bfd diff --git a/ansible_collections/dellemc/os10/roles/os10_bgp/LICENSE b/ansible_collections/dellemc/os10/roles/os10_bgp/LICENSE new file mode 100644 index 00000000..2c9b8e1f --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_bgp/LICENSE @@ -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) 2020, Dell Inc. All rights reserved. + + 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) 2020, Dell Inc. All rights reserved. + 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>. diff --git a/ansible_collections/dellemc/os10/roles/os10_bgp/README.md b/ansible_collections/dellemc/os10/roles/os10_bgp/README.md new file mode 100644 index 00000000..e4e7c94e --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_bgp/README.md @@ -0,0 +1,729 @@ +BGP role +======== + +This role facilitates the configuration of border gateway protocol (BGP) attributes. It supports the configuration of router ID, networks, neighbors, and maximum paths. This role is abstracted for Dell EMC PowerSwitch platforms running SmartFabric OS10. + +The BGP role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. + +Role variables +-------------- + +- Role is abstracted using the `ansible_network_os` variable that can take `dellemc.os10.os10` as the value +- If `os10_cfg_generate` is set to true, it generates the role configuration commands in a file +- Any role variable with a corresponding state variable setting to absent negates the configuration of that variable +- Setting an empty value for any variable negates the corresponding configuration +- Variables and values are case-sensitive + +**os10_bgp keys** + +| Key | Type | Description | Support | +|------------|---------------------------|---------------------------------------------------------|-----------------------| +| ``asn`` | string (required) | Configures the autonomous system (AS) number of the local BGP instance | os10 | +| ``router_id`` | string | Configures the IP address of the local BGP router instance | os10 | +| ``graceful_restart`` | boolean | Configures graceful restart capability | os10 | +| ``maxpath_ibgp`` | integer | Configures the maximum number of paths to forward packets through iBGP (1 to 64; default 1) | os10 | +| ``maxpath_ebgp`` | integer | Configures the maximum number of paths to forward packets through eBGP (1 to 64; default 1) | os10 | +| ``log_neighbor_changes`` | boolean | Configures log neighbors up/down | os10 | +| ``fast_ext_fallover`` | boolean | Configures a reset session if a link to a directly connected external peer goes down | os10 | +| ``always_compare_med`` | boolean | Configures comparing MED from different neighbors | os10 | +| ``default_loc_pref`` | integer | Configures the default local preference value | os10 | +| ``as_notation`` | string | Configures AS number notation format | os10 | +| ``enforce_first_as`` | boolean | Configures the first AS for eBGP routes | os10 | +| ``non_deterministic_med`` | boolean | Configures nondeterministic path selection algorithm | os10 | +| ``outbound_optimization`` | boolean | Configures outbound optimization for iBGP peer-group members | os10 | +| ``confederation`` | dictionary | Configures AS confederation parameters (see ``confederation.*``) | os10 | +| ``confederation.identifier`` | integer | Configures the routing domain confederation AS | os10 | +| ``confederation.peers`` | string | Configures the peer AS in BGP confederation | os10 | +| ``confederation.peers_state`` | string: absent,present\* | Deletes the peer AS in BGP confederation if set to absent | os10 | +| ``route_reflector`` | dictionary | Configures route reflection parameters (see ``route_reflector.*``) | os10 | +| ``route_reflector.client_to_client`` | boolean | Configures client-to-client route reflection | os10 | +| ``route_reflector.cluster_id`` | string | Configures the route reflector cluster-id | os10 | +| ``address_family_ipv4`` | dictionary | Configures IPv4 address family parameters (see ``address_family_ipv4.*``) | os10 | +| ``address_family_ipv4.aggregate_addr`` | list | Configures IPv4 BGP aggregate entries (see ``aggregate_addr.*``) | os10 | +| ``aggregate_addr.ip_and_mask`` | string | Configures the IPv4 BGP aggregate address | os10 | +| ``aggregate_addr.adv_map`` | string | Configures the advertise map for IPv4 BGP aggregate address | os10 | +| ``aggregate_addr.attr_map`` | string | Configures the attribute map for IPv4 BGP aggregate address | os10 | +| ``aggregate_addr.suppress_map`` | string | Configures the suppress map for IPv4 BGP aggregate address | os10 | +| ``aggregate_addr.summary_only`` | boolean | Sets address to summary only if true | os10 | +| ``aggregate_addr.state`` | string: absent,present\* | Deletes an IPv4 BGP aggregate entry if set to absent | os10 | +| ``address_family_ipv4.dampening`` | dictionary | Configures route-flap dampening (see ``dampening.*``) | os10 | +| ``dampening.value`` | dictionary | Configures dampening values (<half-life time> <start value to reuse> <start value to suppress> <max duration> format; default 15 750 2000 60) | os10 | +| ``dampening.route_map`` | string | Configures the route-map to specify criteria for dampening | os10 | +| ``dampening.state`` | string: absent,present\* | Deletes dampening if set to absent | os10 | +| ``address_family_ipv4.ibgp_redist_internal`` | dictionary | Configures internal BGP reditribution (see ``ibgp_redist_internal.*``) | os10 | +| ``ibgp_redist_internal.state`` | boolean | Configures the internal BGP redistribution for an IPv4 address family | os10 | +| ``address_family_ipv4.default_metric`` | integer | Configures the metric of redistributed routes for IPv4 address family | os10 | +| ``address_family_ipv4.distance_bgp`` | dictionary | Configures BGP distances (see ``distance_bgp.*``) | os10 | +| ``distance_bgp.value`` | dictionary | Configures the BGP administrative distance for IPv4 address family (<routes external to AS> <routes internal to AS> <local routes> format; distance bgp 2 3 4) | os10 | +| ``distance_bgp.state`` | string: absent,present\* | Deletes distance BGP if set to absent | os10 | +| ``address_family_ipv6`` | dictionary | Configures IPv6 address family parameters (see ``address_family_ipv6.*``) | os10 | +| ``address_family_ipv6.aggregate_addr`` | list | Configures IPv6 BGP aggregate entries (see ``aggregate_addr.*``) | os10 | +| ``aggregate_addr.ip_and_mask`` | string | Configures the IPv6 BGP aggregate address | os10 | +| ``aggregate_addr.adv_map`` | string | Configures the advertise map for IPv6 BGP aggregate address | os10 | +| ``aggregate_addr.attr_map`` | string | Configures the attribute map for IPv6 BGP aggregate address | os10 | +| ``aggregate_addr.suppress_map`` | string | Configures the suppress map for IPv6 BGP aggregate address | os10 | +| ``aggregate_addr.summary_only`` | boolean | Sets address to summary-only if true | os10 | +| ``aggregate_addr.state`` | string: absent,present\* | Deletes an IPv6 BGP aggregate entry if set to absent | os10 | +| ``address_family_ipv6.dampening`` | dictionary | Configures route-flap dampening (see ``dampening.*``) | os10 | +| ``dampening.value`` | dictionary | Configures dampening values (<half-life time> <start value to reuse> <start value to suppress> <max duration> format; default 15 750 2000 60) | os10 | +| ``dampening.route_map`` | string | Configures the route-map to specify criteria for dampening | os10 | +| ``dampening.state`` | string: absent,present\* | Deletes dampening if set to absent | os10 | +| ``address_family_ipv6.ibgp_redist_internal`` | dictionary | Configures iBGP reditribution (see ``ibgp_redist_internal.*``) | os10 | +| ``ibgp_redist_internal.state`` | boolean | Configures the iBGP redistribution for an IPv6 address family | os10 | +| ``address_family_ipv6.default_metric`` | integer | Configures the metric of redistributed routes for IPv6 address family | os10 | +| ``address_family_ipv6.distance_bgp`` | dictionary | Configures BGP distances (see ``distance_bgp.*``) | os10 | +| ``distance_bgp.value`` | dictionary | Configures the BGP administrative distance for an IPv6 address family (<routes external to AS> <routes internal to AS> <local routes> format; distance bgp 2 3 4) | os10 | +| ``distance_bgp.state`` | string: absent,present\* | Deletes distance BGP if set to absent | os10 | +| ``best_path`` | list | Configures the default best-path selection (see ``best_path.*``) | os10 | +| ``best_path.as_path`` | string (required): ignore,multipath-relax | Configures the AS path used for the best-path computation | os10 | +| ``best_path.as_path_state`` | string: absent,present\* | Deletes the AS path configuration if set to absent | os10 | +| ``best_path.ignore_router_id`` | boolean: true,false | Ignores the router identifier in best-path computation if set to true | os10 | +| ``best_path.med`` | list | Configures the MED attribute (see ``med.*``) | os10 | +| ``med.attribute`` | string (required): confed,missing-as-best | Configures the MED attribute used for the best-path computation | os10 | +| ``med.state`` | string: absent,present\* | Deletes the MED attribute if set to absent | os10 | +| ``ipv4_network`` | list | Configures an IPv4 BGP networks (see ``ipv4_network.*``) | os10 | +| ``ipv4_network.address`` | string (required) | Configures the IPv4 address of the BGP network (A.B.C.D/E format) | os10 | +| ``ipv4_network.state`` | string: absent,present\* | Deletes an IPv4 BGP network if set to absent | os10 | +| ``ipv6_network`` | list | Configures an IPv6 BGP network (see ``ipv6_network.*``) | os10 | +| ``ipv6_network.address`` | string (required) | Configures the IPv6 address of the BGP network (2001:4898:5808:ffa2::1/126 format) | os10 | +| ``ipv6_network.state`` | string: absent,present\* | Deletes an IPv6 BGP network if set to absent | os10 | +| ``neighbor`` | list | Configures IPv4 BGP neighbors (see ``neighbor.*``) | os10 | +| ``neighbor.ip`` | string (required) | Configures the IPv4 address of the BGP neighbor (10.1.1.1) | os10 | +| ``neighbor.interface`` | string | Configures the BGP neighbor interface details | os10 | +| ``neighbor.name`` | string (required) | Configures the BGP peer-group with this name; supported only when the neighbor is a peer group; mutually exclusive with *neighbor.ip* | os10 | +| ``neighbor.type`` | string (required): ipv4,ipv6,peergroup | Specifies the BGP neighbor type | os10 | +| ``neighbor.auto_peer`` |string: unnumbered-auto | Enables auto discovery of neighbors | os10 | +| ``neighbor.password`` | string | Configures the BGP neighbor password | os10 | +| ``neighbor.peergroup_type`` | string (ibgp, ebgp) | Configures the BGP neighbor peer-group type| os10 | +| ``neighbor.ebgp_peergroup`` | string | Configures the peer-group to all auto-discovered external neighbors | os10 | +| ``neighbor.ebgp_peergroup_state`` | string: present,absent | Removes the peer-group from all auto-discovered external neighbors | os10 | +| ``neighbor.ibgp_peergroup`` | string | Configures the peer-group to all auto-discovered internal neighbors | os10 | +| ``neighbor.ibgp_peergroup_state`` | string: present,absent | Removes the peer-group from all auto-discovered internal neighbors | os10 | +| ``neighbor.route_reflector_client`` | boolean | Configures router reflector client on the BGP neighbor | os10 | +| ``neighbor.local_as`` | integer | Configures the local AS for the BGP peer | os10 | +| ``neighbor.weight`` | integer | Configures the default weight for routes from the neighbor interface | os10 | +| ``neighbor.send_community`` | list | Configures the send community attribute to the BGP neighbor (see ``send_community.*``) | os10 | +| ``send_community.type`` | string (required) | Configures the send community attribute to the BGP neighbor | os10 | +| ``send_community.state`` | string: absent,present\* | Deletes the send community attribute of the BGP neighbor if set to absent | os10 | +| ``neighbor.address_family`` | list | Configures address family commands on the BGP neighbor (see ``address_family.*``)| os10 | +| ``address_family.type`` | string (required): ipv4,ipv6,l2vpn | Configures IPv4/IPv6/EVPN address family command mode on the BGP neighbor | os10 | +| ``address_family.activate`` | boolean | Configures activation/deactivation of IPv4/IPv6 address family command mode on the BGP neighbor | os10 | +| ``address_family.sender_loop_detect`` | boolean | Enables/disables the sender-side loop detection process for a BGP neighbor of IPv4/IPv6/l2vpn address family | os10 | +| ``address_family.allow_as_in`` | integer | Configures the local AS number in the as-path | os10 | +| ``address_family.next_hop_self`` | boolean | Configures disabling the next-hop calculation for the neighbor | os10 | +| ``address_family.soft_reconf`` | boolean | Configures per neighbor soft reconfiguration | os10 | +| ``address_family.add_path`` | string | Configures send or receive multiple paths (value can be 'both <no of paths>', 'send <no of paths>', 'receive')| os10 | +| ``address_family.route_map`` | list | Configures the route-map on the BGP neighbor (see ``route_map.*``) | os10 | +| ``route_map.name`` | string | Configures the name of the route-map for the BGP neighbor | os10 | +| ``route_map.filter`` | string | Configures the filter for routing updates | os10 | +| ``route_map.state`` | string, choices: absent,present\* | Deletes the route-map of the BGP neighbor if set to absent | os10 | +| ``address_family.max_prefix`` | dictionary | Configures maximum-prefix parameters (see ``max_prefix.\*``) | os10 | +| ``max_prefix.count`` | integer | Configures maximum number of prefix accepted from the peer | os10 | +| ``max_prefix.state`` | string: absent,present | Deletes maximum prefix configured for the peer | os10 | +| ``max_prefix.threshold`` | integer | Configures threshold percentage at which warning log is thrown | os10 | +| ``max_prefix.warning``| boolean | Configures a warning without dropping the session when maximum limit exceeds if set to true | os10| +| ``address_family.default_originate`` | dictionary | Configures default-originate parameters (see ``default_originate.\*``) | os10 | +| ``default_originate.route_map`` | string | Configures the name of the route-map to specify criteria to originate default | os10 | +| ``default_originate.state`` | string, choices: absent,present\* | Deletes the default-originate if set to absent | os10 | +| ``address_family.distribute_list`` | list | Configures the distribute list to filter networks from routing updates (see ``distribute_list.*``) | os10 | +| ``distribute_list.in`` | string | Configures the name of the prefix-list to filter incoming packets | os10 | +| ``distribute_list.in_state`` | string: absent,present\* | Deletes the filter at incoming packets if set to absent | os10 | +| ``distribute_list.out`` | string | Configures the name of the prefix-list to filter outgoing packets | os10 | +| ``distribute_list.out_state`` | string: absent,present\* | Deletes the filter at outgoing packets if set to absent | os10 | +| ``address_family.state`` | string: absent,present\* | Deletes the address family command mode of the BGP neighbor if set to absent | os10 | +| ``neighbor.remote_asn`` | string (required) | Configures the remote AS number of the BGP neighbor | os10 | +| ``neighbor.remote_asn_state`` | string: absent,present\* | Deletes the remote AS number from the peer group if set to absent; supported only when *neighbor.type* is "peergroup" | os10 | +| ``neighbor.timer`` | string | Configures neighbor timers; 5 10, where 5 is the keepalive interval and 10 is the holdtime | os10 | +| ``neighbor.peergroup`` | string | Configures neighbor to BGP peer-group (configured peer-group name) | os10 | +| ``neighbor.peergroup_state`` | string: absent,present\* | Deletes the IPv4 BGP neighbor from the peer-group if set to absent | os10 | +| ``neighbor.distribute_list`` | list | Configures the distribute list to filter networks from routing updates (see ``distribute_list.*``) | os10 | +| ``distribute_list.in`` | string | Configures the name of the prefix-list to filter incoming packets | os10 | +| ``distribute_list.in_state`` | string: absent,present\* | Deletes the filter at incoming packets if set to absent | os10 | +| ``distribute_list.out`` | string | Configures the name of the prefix-list to filter outgoing packets | os10 | +| ``distribute_list.out_state`` | string: absent,present\* | Deletes the filter at outgoing packets if set to absent | os10 | +| ``neighbor.admin`` | string: up,down | Configures the administrative state of the neighbor | os10 | +| ``neighbor.adv_interval`` | integer | Configures the advertisement interval of the neighbor | os10 | +| ``neighbor.adv_start`` | integer | Set the advertisement start of the neighbor | os10 | +| ``neighbor.adv_start_state`` | string: absent,present\* | Configures or unconfigures the advertisement start of a neighbor | os10 | +| ``neighbor.conn_retry_timer`` | integer | Configures the peer connection retry timer | os10 | +| ``neighbor.remove_pri_as`` | string: absent,present | Configures the remove private AS number from outbound updates | os10 | +| ``neighbor.fall_over`` | string: absent,present | Configures the session fall on peer-route loss | os10 | +| ``neighbor.sender_loop_detect`` | boolean: true,false | Enables or disables the sender-side loop detect for neighbors | os10 | +| ``neighbor.src_loopback`` | integer | Configures the source loopback interface for routing packets | os10 | +| ``neighbor.ebgp_multihop`` | integer | Configures the maximum-hop count value allowed in eBGP neighbors that are not directly connected (default 255) | os10 | +| ``neighbor.listen`` | list | Configures listen commands on the BGP template (see ``listen.*``)| os10 | +| ``listen.subnet`` | string (required) | Configures the passive BGP neighbor IPv4/IPv6 to this subnet | os10 | +| ``listen.subnet_state`` | string: absent,present\* | Deletes the subnet range set for dynamic IPv4/IPv6 BGP neighbor if set to absent | os10 | +| ``listen.limit`` | integer | Configures maximum dynamic peers count (key is required together with ``neighbor.subnet``) | os10 | +| ``neighbor.bfd`` | boolean | Enables BFD for neighbor | os10 | +| ``neighbor.description`` | string | Configures neighbor description | os10 | +| ``neighbor.state`` | string: absent,present\* | Deletes the IPv4 BGP neighbor if set to absent | os10 | +| ``redistribute`` | list | Configures the redistribute list to get information from other routing protocols (see ``redistribute.*``) | os10 | +| ``redistribute.route_type`` | string (required): static,connected,imported_bgp,l2vpn,ospf | Configures the name of the routing protocol to redistribute | os10 | +| ``redistribute.route_map_name`` | string | Configures the route-map to redistribute | os10 | +| ``redistribute.imported_bgp_vrf_name`` | string | Configures the redistribute imported BGP VRF name | os10 | +| ``redistribute.ospf_id`` | string | Configures the redistribute OSPF | os10 | +| ``redistribute.address_type`` | string (required): ipv4,ipv6 | Configures the address type of IPv4 or IPv6 routes | os10 | +| ``redistribute.state`` | string: absent,present\* | Deletes the redistribution information if set to absent | os10 | +| ``bfd_all_neighbors`` | dictionary | Enables BFD for all BGP neighbors | os10 | +| ``bfd_all_neighbors.interval`` | integer: 100 to 1000 | Configures time interval for sending control packets to BFD peers in ms| os10 | +| ``bfd_all_neighbors.min_rx`` | integer: 100 to 1000 | Configures maximum waiting time for receiving control packets from BFD peers in ms| os10 | +| ``bfd_all_neighbors.multiplier`` | integer: 3 to 50 | Configures maximum number of consecutive packets that are not received from BFD peers before session state changes to Down| os10 | +| ``bfd_all_neighbors.role``| string: active, passive | Configures BFD role | os10 | +| ``bfd_all_neighbors.state`` |string: absent,present\* | Deletes BFD for all neighbors if set to absent | os10 | +| ``vrfs`` | list | Enables VRF under BGP | os10 | +| ``vrf.name`` | string (Required)| Configures VRF name | os10 | +| ``vrf.router_id`` | string | Configures the IP address of the local BGP router instance in VRF | os10 | +| ``vrf.graceful_restart`` | boolean | Configures graceful restart capability in VRF | os10 | +| ``vrf.maxpath_ibgp`` | integer | Configures the maximum number of paths to forward packets through iBGP (1 to 64; default 1) in VRF | os10 | +| ``vrf.maxpath_ebgp`` | integer | Configures the maximum number of paths to forward packets through eBGP (1 to 64; default 1) in VRF | os10 | +| ``vrf.log_neighbor_changes`` | boolean | Configures log neighbors up/down in VRF | os10 | +| ``vrf.fast_ext_fallover`` | boolean | Configures a reset session if a link to a directly connected external peer goes down in VRF | os10 | +| ``vrf.always_compare_med`` | boolean | Configures comparing MED from different neighbors in VRF | os10 | +| ``vrf.default_loc_pref`` | integer | Configures the default local preference value in VRF | os10 | +| ``vrf.as_notation`` | string | Changes the AS number notation format in VRF | os10 | +| ``vrf.enforce_first_as`` | boolean | Configures the first AS for eBGP routes in VRF | os10 | +| ``vrf.non_deterministic_med`` | boolean | Configures nondeterministic path selection algorithm in VRF | os10 | +| ``vrf.outbound_optimization`` | boolean | Configures outbound optimization for iBGP peer-group members in VRF | os10 | +| ``vrf.route_reflector`` | dictionary | Configures route reflection parameters (see ``route_reflector.*``) in VRF | os10 | +| ``vrf.route_reflector.client_to_client`` | boolean | Configures client-to-client route reflection in VRF | os10 | +| ``vrf.route_reflector.cluster_id`` | string | Configures the route-reflector cluster-id in VRF | os10 | +| ``vrf.address_family_ipv4`` | dictionary | Configures IPv4 address family parameters in VRF (see ``address_family_ipv4.*``) in VRF | os10 | +| ``address_family_ipv4.aggregate_addr`` | list | Configures IPv4 BGP aggregate entries (see ``aggregate_addr.*``) in VRF | os10 | +| ``aggregate_addr.ip_and_mask`` | string | Configures the IPv4 BGP aggregate address in VRF | os10 | +| ``aggregate_addr.adv_map`` | string | Configures the advertise map for IPv4 BGP aggregate address | os10 | +| ``aggregate_addr.attr_map`` | string | Configures the attribute map for IPv4 BGP aggregate address | os10 | +| ``aggregate_addr.suppress_map`` | string | Configures the suppress map for IPv4 BGP aggregate address | os10 | +| ``aggregate_addr.summary_only`` | boolean | Sets address to summary-only if true in VRF | os10 | +| ``aggregate_addr.state`` | string: absent,present\* | Deletes an IPv4 BGP aggregate entry if set to absent in VRF | os10 | +| ``address_family_ipv4.dampening`` | dictionary | Configures route-flap dampening (see ``dampening.*``) | os10 | +| ``dampening.value`` | dictionary | Configures dampening values (<half-life time> <start value to reuse> <start value to suppress> <max duration> format; default 15 750 2000 60) | os10 | +| ``dampening.route_map`` | string | Configures the route-map to specify criteria for dampening | os10 | +| ``dampening.state`` | string: absent,present\* | Deletes dampening if set to absent | os10 | +| ``address_family_ipv4.ibgp_redist_internal`` | dictionary | Configures iBGP reditribution (see ``ibgp_redist_internal.*``) | os10 | +| ``ibgp_redist_internal.state`` | boolean | Configures the iBGP redistribution for a IPV4 address family | os10 | +| ``address_family_ipv4.default_metric`` | integer | Configures the metric of redistributed routes for IPV4 address family | os10 | +| ``address_family_ipv4.distance_bgp`` | dictionary | Configures BGP distances (see ``distance_bgp.*``) | os10 | +| ``distance_bgp.value`` | dictionary | Configures the BGP administrative distance for IPV4 address family (<routes external to AS> <routes internal to AS> <local routes> format; distance bgp 2 3 4) | os10 | +| ``distance_bgp.state`` | string: absent,present\* | Deletes distance BGP if set to absent | os10 | +| ``vrf.address_family_ipv6`` | dictionary | Configures IPv6 address family parameters in VRF (see ``address_family_ipv6.*``) | os10 | +| ``address_family_ipv6.aggregate_addr`` | list | Configures IPv6 BGP aggregate entries (see ``aggregate_addr.*``) | os10 | +| ``aggregate_addr.ip_and_mask`` | string | Configures the IPv6 BGP aggregate address | os10 | +| ``aggregate_addr.adv_map`` | string | Configures the advertise map for IPv6 BGP aggregate address | os10 | +| ``aggregate_addr.attr_map`` | string | Configures the attribute map for IPv6 BGP aggregate address | os10 | +| ``aggregate_addr.suppress_map`` | string | Configures the suppress map for IPv6 BGP aggregate address | os10 | +| ``aggregate_addr.summary_only`` | boolean | Sets address to summary-only if true | os10 | +| ``aggregate_addr.state`` | string: absent,present\* | Deletes an IPv6 BGP aggregate entry if set to absent | os10 | +| ``address_family_ipv6.dampening`` | dictionary | Configures route-flap dampening (see ``dampening.*``) | os10 | +| ``dampening.value`` | dictionary | Configures dampening values (<half-life time> <start value to reuse> <start value to suppress> <max duration> format; default 15 750 2000 60) | os10 | +| ``dampening.route_map`` | string | Configures the route-map to specify criteria for dampening | os10 | +| ``dampening.state`` | string: absent,present\* | Deletes dampening if set to absent | os10 | +| ``address_family_ipv6.ibgp_redist_internal`` | dictionary | Configures iBGP reditribution (see ``ibgp_redist_internal.*``) | os10 | +| ``ibgp_redist_internal.state`` | boolean | Configures the iBGP redistribution for a IPv6 address family | os10 | +| ``address_family_ipv6.default_metric`` | integer | Configures the metric of redistributed routes for IPv6 address family | os10 | +| ``address_family_ipv6.distance_bgp`` | dictionary | Configures BGP distances (see ``distance_bgp.*``) | os10 | +| ``distance_bgp.value`` | dictionary | Configures the BGP administrative distance for IPv6 address family (<routes external to AS> <routes internal to AS> <local routes> format; distance bgp 2 3 4) | os10 | +| ``distance_bgp.state`` | string: absent,present\* | Deletes distance BGP if set to absent | os10 | +| ``vrf.best_path`` | list | Configures the default best-path selection in VRF (see ``best_path.*``) | os10 | +| ``best_path.as_path`` | string (required): ignore,multipath-relax | Configures the AS path used for the best-path computation | os10 | +| ``best_path.as_path_state`` | string: absent,present\* | Deletes the AS path configuration if set to absent | os10 | +| ``best_path.ignore_router_id`` | boolean: true,false | Ignores the router identifier in best-path computation if set to true | os10 | +| ``best_path.med`` | list | Configures the MED attribute (see ``med.*``) | os10 | +| ``med.attribute`` | string (required): confed,missing-as-best | Configures the MED attribute used for the best-path computation | os10 | +| ``med.state`` | string: absent,present\* | Deletes the MED attribute if set to absent | os10 | +| ``vrf.ipv4_network`` | list | Configures an IPv4 BGP networks (see ``ipv4_network.*``) | os10 | +| ``ipv4_network.address`` | string (required) | Configures the IPv4 address of the BGP network (A.B.C.D/E format) | os10 | +| ``ipv4_network.state`` | string: absent,present\* | Deletes an IPv4 BGP network if set to absent | os10 | +| ``vrf.ipv6_network`` | list | Configures an IPv6 BGP network (see ``ipv6_network.*``) | os10 | +| ``ipv6_network.address`` | string (required) | Configures the IPv6 address of the BGP network (2001:4898:5808:ffa2::1/126 format) | os10 | +| ``ipv6_network.state`` | string: absent,present\* | Deletes an IPv6 BGP network if set to absent | os10 | +| ``vrf.neighbor`` | list | Configures IPv4 BGP neighbors in VRF (see ``neighbor.*``) | os10 | +| ``neighbor.ip`` | string (required) | Configures the IPv4 address of the BGP neighbor (10.1.1.1) | os10 | +| ``neighbor.interface`` | string | Configures the BGP neighbor interface details | os10 | +| ``neighbor.name`` | string (required) | Configures the BGP peer-group with this name; supported only when the neighbor is a peer group; mutually exclusive with *neighbor.ip* | os10 | +| ``neighbor.type`` | string (required): ipv4,ipv6,peergroup | Specifies the BGP neighbor type | os10 | +| ``neighbor.auto_peer`` |string: unnumbered-auto | Enable auto-discovery of neighbors | os10 | +| ``neighbor.password`` | string | Configures the BGP neighbor password | os10 | +| ``neighbor.peergroup_type`` | string (ibgp, ebgp) | Configures the BGP neighbor peer-group type| os10 | +| ``neighbor.ebgp_peergroup`` | string | Configures the peer-group to all auto-discovered external neighbors | os10 | +| ``neighbor.ebgp_peergroup_state`` | string: present,absent | Removes the peer-group from all auto-discovered external neighbors | os10 | +| ``neighbor.ibgp_peergroup`` | string | Configures the peer-group to all auto-discovered internal neighbors | os10 | +| ``neighbor.ibgp_peergroup_state`` | string: present,absent | Removes the peer-group from all auto-discovered internal neighbors | os10 | +| ``neighbor.route_reflector_client`` | boolean | Configures router reflector client on the BGP neighbor | os10 | +| ``neighbor.local_as`` | integer | Configures the local AS for the BGP peer | os10 | +| ``neighbor.weight`` | integer | Configures the default weight for routes from the neighbor interface | os10 | +| ``neighbor.send_community`` | list | Configures the send community attribute to the BGP neighbor (see ``send_community.*``) | os10 | +| ``send_community.type`` | string (required) | Configures the send community attribute to the BGP neighbor | os10 | +| ``send_community.state`` | string: absent,present\* | Deletes the send community attribute of the BGP neighbor if set to absent | os10 | +| ``neighbor.address_family`` | list | Configures address family commands on the BGP neighbor (see ``address_family.*``)| os10 | +| ``address_family.type`` | string (required): ipv4,ipv6,l2vpn | Configures IPv4/IPv6 EVPN address family command mode on the BGP neighbor | os10 | +| ``address_family.activate`` | boolean | Configures activation or deactivation of IPv4/IPv6 address family command mode on the BGP neighbor | os10 | +| ``address_family.sender_loop_detect`` | boolean | Enables or disables the sender-side loop detection process for a BGP neighbor of IPv4/IPv6 l2vpn address family | os10 | +| ``address_family.allow_as_in`` | integer | Configures the local AS number in the as-path | os10 | +| ``address_family.next_hop_self`` | boolean | Configures disabling the next-hop calculation for the neighbor | os10 | +| ``address_family.soft_reconf`` | boolean | Configures per neighbor soft reconfiguration | os10 | +| ``address_family.add_path`` | string | Configures send or receive multiple paths (value can be 'both <no of paths>', 'send <no of paths>', 'receive')| os10 | +| ``address_family.route_map`` | list | Configures the route-map on the BGP neighbor (see ``route_map.*``) | os10 | +| ``route_map.name`` | string | Configures the name of the route-map for the BGP neighbor | os10 | +| ``route_map.filter`` | string | Configures the filter for routing updates | os10 | +| ``route_map.state`` | string, choices: absent,present* | Deletes the route-map of the BGP neighbor if set to absent | os10 | +| ``address_family.max_prefix`` | dictionary | Configures maximum-prefix parameters (see ``max_prefix.*``) | os10 | +| ``max_prefix.count`` | integer | Configures maximum number of prefix accepted from the peer | os10 | +| ``max_prefix.state`` | string: absent,present | Deletes maximum prefix configured for the peer | os10 | +| ``max_prefix.threshold`` | integer | Configures threshold percentage at which warning log is thrown | os10 | +| ``max_prefix.warning``| boolean | Configures a warning without dropping session when maximum limit exceeds if set to true | os10| +| ``address_family.default_originate`` | dictionary | Configures default-originate parameters (see ``default_originate.\*``) | os10 | +| ``default_originate.route_map`` | string | Configures the name of the route-map to specify criteria to originate default | os10 | +| ``default_originate.state`` | string, choices: absent,present\* | Deletes the default-originate if set to absent | os10 | +| ``address_family.distribute_list`` | list | Configures the distribute list to filter networks from routing updates (see ``distribute_list.*``) | os10 | +| ``distribute_list.in`` | string | Configures the name of the prefix-list to filter incoming packets | os10 | +| ``distribute_list.in_state`` | string: absent,present\* | Deletes the filter at incoming packets if set to absent | os10 | +| ``distribute_list.out`` | string | Configures the name of the prefix-list to filter outgoing packets | os10 | +| ``distribute_list.out_state`` | string: absent,present\* | Deletes the filter at outgoing packets if set to absent | os10 | +| ``address_family.state`` | string: absent,present\* | Deletes the address family command mode of the BGP neighbor if set to absent | os10 | +| ``neighbor.remote_asn`` | string (required) | Configures the remote AS number of the BGP neighbor | os10 | +| ``neighbor.remote_asn_state`` | string: absent,present\* | Deletes the remote AS number from the peer-group if set to absent; supported only when *neighbor.type* is "peergroup" | os10 | +| ``neighbor.timer`` | string | Configures neighbor timers; 5 10, where 5 is the keepalive interval and 10 is the holdtime | os10 | +| ``neighbor.peergroup`` | string | Configures neighbor to BGP peer-group (configured peer-group name) | os10 | +| ``neighbor.peergroup_state`` | string: absent,present\* | Deletes the IPv4 BGP neighbor from the peer-group if set to absent | os10 | +| ``neighbor.distribute_list`` | list | Configures the distribute list to filter networks from routing updates (see ``distribute_list.*``) | os10 | +| ``distribute_list.in`` | string | Configures the name of the prefix-list to filter incoming packets | os10 | +| ``distribute_list.in_state`` | string: absent,present\* | Deletes the filter at incoming packets if set to absent | os10 | +| ``distribute_list.out`` | string | Configures the name of the prefix-list to filter outgoing packets | os10 | +| ``distribute_list.out_state`` | string: absent,present\* | Deletes the filter at outgoing packets if set to absent | os10 | +| ``neighbor.admin`` | string: up,down | Configures the administrative state of the neighbor | os10 | +| ``neighbor.adv_interval`` | integer | Configures the advertisement interval of the neighbor | os10 | +| ``neighbor.adv_start`` | integer | Set the advertisement start of the neighbor | os10 | +| ``neighbor.adv_start_state`` | string: absent,present\* | Configures or unconfigures the advertisement start of the neighbor | os10 | +| ``neighbor.conn_retry_timer`` | integer | Configures the peer connection retry timer | os10 | +| ``neighbor.remove_pri_as`` | string: absent,present | Removes private AS number from outbound updates | os10 | +| ``neighbor.fall_over`` | string: absent,present | Configures the session fall on peer-route loss | os10 | +| ``neighbor.sender_loop_detect`` | boolean: true,false | Enables or disables the sender-side loop detect for neighbors | os10 | +| ``neighbor.src_loopback`` | integer | Configures the source loopback interface for routing packets | os10 | +| ``neighbor.ebgp_multihop`` | integer | Configures the maximum-hop count value allowed in eBGP neighbors that are not directly connected (default 255) | os10 | +| ``neighbor.listen`` | list | Configures listen commands on the BGP template (see ``listen.*``)| os10 | +| ``listen.subnet`` | string (required) | Configures the passive BGP neighbor IPv4/IPv6 to this subnet | os10 | +| ``listen.subnet_state`` | string: absent,present\* | Deletes the subnet range set for dynamic IPv4/IPv6 BGP neighbor if set to absent | os10 | +| ``listen.limit`` | integer | Configures maximum dynamic peers count (key is required together with ``neighbor.subnet``) | os10 | +| ``neighbor.bfd`` | boolean | Enables BFD for neighbor | os10 | +| ``neighbor.description`` | string | Configures neighbor description | os10 | +| ``neighbor.state`` | string: absent,present\* | Deletes the IPv4 BGP neighbor if set to absent | os10 | +| ``vrf.redistribute`` | list | Configures the redistribute list to get information from other routing protocols in VRF (see ``redistribute.*``) | os10 | +| ``redistribute.route_type`` | string (required): static,connected,imported_bgp | Configures the name of the routing protocol to redistribute | os10 | +| ``redistribute.route_map_name`` | string | Configures the route-map to redistribute | os10 | +| ``redistribute.imported_bgp_vrf_name`` | string | Configures the redistribute imported BGP VRF name | os10 | +| ``redistribute.ospf_id`` | string | Configures the redistribute ospf | os10 | +| ``redistribute.address_type`` | string (required): ipv4,ipv6 | Configures the address type of IPv4 or IPv6 routes | os10 | +| ``redistribute.state`` | string: absent,present\* | Deletes the redistribution information if set to absent | os10 | +| ``vrf.bfd_all_neighbors`` | dictionary | Enables BFD for all BGP neighbors in VRF ((see ``bfd_all_neighbors.*``))| os10 | +| ``bfd_all_neighbors.interval`` | integer: 100 to 1000 | Configures time interval for sending control packets to BFD peers in ms| os10 | +| ``bfd_all_neighbors.min_rx`` | integer: 100 to 1000 | Configures maximum waiting time for receiving control packets from BFD peers in ms| os10 | +| ``bfd_all_neighbors.multiplier`` | integer: 3 to 50 | Configures maximum number of consecutive packets that are not received from BFD peers before session state changes to Down| os10 | +| ``bfd_all_neighbors.role``| string: active, passive | Configures BFD role | os10 | +| ``bfd_all_neighbors.state`` |string: absent,present\* | Deletes BFD for all neighbors if set to absent | os10 | +| ``vrf.state`` | string: absent,present\* | Deletes the VRF instance under router BGP if set to absent | os10 | +| ``state`` | string: absent,present\* | Deletes the local router BGP instance if set to absent | os10 | + +> **NOTE**: Asterisk (\*) denotes the default value if none is specified. + +Connection variables +-------------------- + +Ansible Dell EMC network roles require connection information to establish communication with the nodes in your inventory. This information can exist in the Ansible *group_vars* or *host_vars* directories or inventory, or in the playbook itself. + +| Key | Required | Choices | Description | +|-------------|----------|------------|-----------------------------------------------------| +| ``ansible_host`` | yes | | Specifies the hostname or address for connecting to the remote device over the specified transport | +| ``ansible_port`` | no | | Specifies the port used to build the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_PORT` option is used; it defaults to 22 | +| ``ansible_ssh_user`` | no | | Specifies the username that authenticates the CLI login for the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_USER` environment variable value is used | +| ``ansible_ssh_pass`` | no | | Specifies the password that authenticates the connection to the remote device | +| ``ansible_become`` | no | yes, no\* | Instructs the module to enter privileged mode on the remote device before sending any commands; if value is unspecified, the `ANSIBLE_BECOME` environment variable value is used, and the device attempts to execute all commands in non-privileged mode | +| ``ansible_become_method`` | no | enable, sudo\* | Instructs the module to allow the become method to be specified for handling privilege escalation; if value is unspecified, the `ANSIBLE_BECOME_METHOD` environment variable value is used | +| ``ansible_become_pass`` | no | | Specifies the password to use if required to enter privileged mode on the remote device; if ``ansible_become`` is set to no this key is not applicable | +| ``ansible_network_os`` | yes | os10, null\* | Loads the correct terminal and cliconf plugins to communicate with the remote device | + +> **NOTE**: Asterisk (\*) denotes the default value if none is specified. + + +Example playbook +---------------- + +This example uses the *os10_bgp* role to configure the BGP network and neighbors. It creates a *hosts* file with the switch details, a *host_vars* file with connection variables and the corresponding role variables. The hosts file should define the `ansible_network_os` variable with the corresponding Dell EMC OS10 name. + +When `os10_cfg_generate` is set to true, the variable generates the configuration commands as a .part file in *build_dir* path. By default, the variable is set to false. This example writes a simple playbook that only references the *os10_bgp* role. + +**Sample hosts file** + + leaf1 ansible_host= <ip_address> + +**Sample host_vars/leaf1** + + hostname: leaf1 + ansible_become: yes + ansible_become_method: xxxxx + ansible_become_pass: xxxxx + ansible_ssh_user: xxxxx + ansible_ssh_pass: xxxxx + ansible_network_os: dellemc.os10.os10 + build_dir: ../temp/temp_os10 + + os10_bgp: + asn: 12 + router_id: 90.1.1.4 + maxpath_ibgp: 2 + maxpath_ebgp: 2 + graceful_restart: true + log_neighbor_changes: true + fast_ext_fallover: false + always_compare_med: true + default_loc_pref: 1000 + as_notation: asdot + enforce_first_as: false + non_deterministic_med: true + outbound_optimization: true + confederation: + identifier: 25 + peers: 23 24 + peers_state: present + route_reflector: + client_to_client: false + cluster_id: 4294967295 + address_family_ipv4: + aggregate_address: + - ip_and_mask: 1.1.1.1/16 + state: present + summary_only: true + dampening: + value: 15 750 2000 60 + route_map: qq + state: present + ibgp_redist_internal: + state: present + default_metric: 10 + distance_bgp: + value: 3 4 6 + state: present + address_family_ipv6: + aggregate_address: + - ip_and_mask: 2001:4898:5808:ffa0::/126 + state: present + summary_only: true + ibgp_redist_internal: + state: present + best_path: + as_path: ignore + as_path_state: present + ignore_router_id: true + med: + - attribute: confed + state: present + ipv4_network: + - address: 101.1.1.0/30 + state: present + ipv6_network: + - address: "2001:4898:5808:ffa0::/126" + state: present + neighbor: + - name: ebgp_pg + type: peergroup + bfd: yes + state: present + address_family: + - type: ipv4 + activate: false + state: present + max_prefix: + count: 20 + threshold: 90 + warning: true + state: present + listen: + - subnet: 4.4.4.4/32 + limit: 4 + subnet_state: present + - subnet: 20::/64 + limit: 4 + subnet_state: present + - name: ibgp_pg + type: peergroup + weight: 10 + state: present + - type: ipv4 + interface: vlan20 + send_community: + - type: extended + state: present + address_family: + - type: l2vpn + activate: true + state: present + admin: up + state: present + - type: ipv4 + description: "U_site2-spine1" + remote_asn: 11 + ip: 192.168.10.1 + peergroup: peer1 + peergroup_state: present + peergroup_type: ibgp + adv_interval: 40 + fall_over: present + password: bgppassword + route_reflector_client: true + adv_start: 100 + adv_start_state: present + conn_retry_timer: 20 + remove_pri_as: present + src_loopback: 0 + address_family: + - type: ipv4 + activate: true + state: present + max_prefix: + count: 10 + threshold: 40 + warning: true + state: present + default_originate: + route_map: aa + state: present + distribute_list: + in: XX + in_state: present + out: YY + out_state: present + send_community: + - type: standard + state: present + state: present + - type: ipv4 + remote_asn: 13 + local_as: 10 + weight: 10 + ip: 192.168.12.3 + address_family: + - type: ipv4 + activate: true + allow_as_in: 5 + next_hop_self: true + soft_reconf: true + add_path: both 3 + route_map: + - name: qq + filter: in + state: present + state: present + state: present + - type: ipv6 + remote_asn: 14 + ip: 2001:4898:5808:ffa2::1 + state: present + - type: ipv6 + description: "U_site2-spine1-Auto Discovered peers" + auto_peer: unnumbered-auto + ebgp_peergroup: ebgp_pg + ebgp_peergroup_state: absent + ibgp_peergroup: ibgp_pg + ibgp_peergroup_state: present + sender_loop_detect: true + password: bgppassword + address_family: + - type: ipv4 + activate: true + sender_loop_detect: true + state: present + allow_as_in: 5 + next_hop_self: true + soft_reconf: true + - type: l2vpn + activate: true + sender_loop_detect: false + state: present + send_community: + - type: standard + state: present + admin: up + state: present + redistribute: + - route_type: static + route_map_name: aa + address_type: ipv4 + state: present + bfd_all_neighbors: + interval: 200 + min_rx: 200 + multiplier: 3 + role: active + state: present + vrfs: + - name: "GREEN" + router_id: 50.1.1.1 + maxpath_ibgp: 2 + maxpath_ebgp: 2 + graceful_restart: true + log_neighbor_changes: false + fast_ext_fallover: false + always_compare_med: true + default_loc_pref: 1000 + route_reflector: + client_to_client: false + cluster_id: 1 + address_family_ipv4: + aggregate_address: + - ip_and_mask: 1.1.1.1/16 + state: present + dampening: + value: 15 750 2000 60 + route_map: qq + state: present + ibgp_redist_internal: + state: present + address_family_ipv6: + aggregate_address: + - ip_and_mask: 2001:4898:5808:ffa0::/126 + state: present + summary_only: true + ibgp_redist_internal: + state: present + best_path: + as_path: ignore + as_path_state: present + ignore_router_id: true + med: + - attribute: confed + state: present + - attribute: missing-as-worst + state: present + ipv4_network: + - address: 101.1.1.0/30 + state: present + ipv6_network: + - address: "2001:4898:5808:ffa0::/126" + state: present + neighbor: + - name: peer1 + type: peergroup + bfd: yes + state: present + - name: ebgp_pg + type: peergroup + bfd: yes + state: present + - name: ibgp_pg + type: peergroup + weight: 10 + state: present + - type: ipv4 + interface: vlan10 + description: U_site2 vlan + send_community: + - type: extended + state: present + admin: up + state: present + - type: ipv4 + description: "U_site2 spine1" + remote_asn: 11 + ip: 192.168.20.1 + name: peer1 + peergroup: peer1 + peergroup_state: present + peergroup_type: ibgp + adv_interval: 40 + fall_over: present + route_reflector_client: true + src_loopback: 0 + address_family: + - type: ipv4 + activate: false + state: present + send_community: + - type: standard + state: present + state: present + - type: ipv4 + description: "U_site2 spine1" + remote_asn: 13 + local_as: 10 + weight: 10 + ip: 192.168.15.3 + address_family: + - type: ipv4 + activate: false + allow_as_in: 5 + next_hop_self: true + soft_reconf: true + add_path: both 3 + route_map: + - name: qq + filter: in + state: present + state: present + state: present + - type: ipv6 + remote_asn: 14 + ip: 2001:4898:5808:ffa2::1 + state: present + - type: ipv6 + description: "U_site2-spine1-Auto Discovered peers" + auto_peer: unnumbered-auto + ebgp_peergroup: ebgp_pg + ebgp_peergroup_state: present + ibgp_peergroup: ibgp_pg + ibgp_peergroup_state: present + address_family: + - type: ipv4 + activate: false + sender_loop_detect: false + state: present + allow_as_in: 5 + next_hop_self: true + soft_reconf: true + send_community: + - type: standard + state: present + admin: up + state: present + redistribute: + - route_type: static + route_map_name: aa + address_type: ipv4 + state: present + - route_type: connected + route_map_name: bb + address_type: ipv4 + state: present + - route_type: l2vpn + route_map_name: cc + address_type: ipv4 + state: present + - route_type: imported_bgp + imported_bgp_vrf_name: test6 + route_map_name: dd + address_type: ipv4 + state: present + - route_type: ospf + ospf_id: 12 + address_type: ipv4 + state: present + bfd_all_neighbors: + interval: 200 + min_rx: 200 + multiplier: 3 + role: active + state: present + state: present + state: present + + +**Simple playbook to configure BGP — leaf.yaml** + + - hosts: leaf1 + roles: + - dellemc.os10.os10_bgp + +**Run** + + ansible-playbook -i hosts leaf.yaml + +(c) 2017-2020 Dell Inc. or its subsidiaries. All rights reserved. diff --git a/ansible_collections/dellemc/os10/roles/os10_bgp/defaults/main.yml b/ansible_collections/dellemc/os10/roles/os10_bgp/defaults/main.yml new file mode 100644 index 00000000..0b8cbfc8 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_bgp/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for dellemc.os10.os10_bgp diff --git a/ansible_collections/dellemc/os10/roles/os10_bgp/handlers/main.yml b/ansible_collections/dellemc/os10/roles/os10_bgp/handlers/main.yml new file mode 100644 index 00000000..b0141ca3 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_bgp/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for dellemc.os10.os10_bgp diff --git a/ansible_collections/dellemc/os10/roles/os10_bgp/meta/main.yml b/ansible_collections/dellemc/os10/roles/os10_bgp/meta/main.yml new file mode 100644 index 00000000..047c70dc --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_bgp/meta/main.yml @@ -0,0 +1,18 @@ +# Copyright (c) 2017-2020 Dell Inc. or its subsidiaries. All Rights Reserved. +--- +galaxy_info: + author: Dell EMC Networking Engineering + description: The os10_bgp role facilitates the configuration of BGP attributes in devices running Dell EMC SmartFabric OS10. + company: Dell Technologies + license: GPLv3 + min_ansible_version: 2.9.6 + + platforms: + - name: os10 + + galaxy_tags: + - networking + - dell + - emc + - dellemc + - os10 diff --git a/ansible_collections/dellemc/os10/roles/os10_bgp/tasks/main.yml b/ansible_collections/dellemc/os10/roles/os10_bgp/tasks/main.yml new file mode 100644 index 00000000..05c44354 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_bgp/tasks/main.yml @@ -0,0 +1,16 @@ +--- +# tasks file for os10 + - name: "Generating BGP configuration for os10" + template: + src: os10_bgp.j2 + dest: "{{ build_dir }}/bgp10_{{ hostname }}.conf.part" + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") and ((os10_cfg_generate | default('False')) | bool) +# notify: save config os10 + register: generate_output + + - name: "Provisioning BGP configuration for os10" + os10_config: + src: os10_bgp.j2 + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") +# notify: save config os10 + register: output diff --git a/ansible_collections/dellemc/os10/roles/os10_bgp/templates/os10_bgp.j2 b/ansible_collections/dellemc/os10/roles/os10_bgp/templates/os10_bgp.j2 new file mode 100644 index 00000000..d4859eba --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_bgp/templates/os10_bgp.j2 @@ -0,0 +1,1244 @@ +#jinja2: trim_blocks: True, lstrip_blocks: True +{########################################### +Purpose: +Configure BGP commands for os10 Devices +os10_bgp: + asn: 12 + router_id: 90.1.1.4 + maxpath_ibgp: 2 + maxpath_ebgp: 2 + graceful_restart: true + log_neighbor_changes: true + fast_ext_fallover: false + always_compare_med: true + default_loc_pref: 1000 + confederation: + identifier: 25 + peers: 23 24 + peers_state: present + route_reflector: + client_to_client: false + cluster_id: 4294967295 + address_family_ipv4: + aggregate_address: + - ip_and_mask: 1.1.1.1/16 + state: present + summary_only: true + dampening: + value: 15 750 2000 60 + route_map: qq + state: present + ibgp_redist_internal: + state: present + address_family_ipv6: + aggregate_address: + - ip_and_mask: 2001:4898:5808:ffa0::/126 + state: present + summary_only: true + ibgp_redist_internal: + state: present + best_path: + as_path: ignore + as_path_state: present + ignore_router_id: true + med: + - attribute: confed + state: present + ipv4_network: + - address: 101.1.1.0/30 + state: present + ipv6_network: + - address: "2001:4898:5808:ffa0::/126" + state: present + neighbor: + - name: ebgp_pg + type: peergroup + bfd: yes + state: present + - name: ibgp_pg + type: peergroup + weight: 10 + state: present + - type: ipv4 + interface: vlan20 + send_community: + - type: extended + state: present + address_family: + - type: l2vpn + activate: true + state: present + admin: up + state: present + - type: ipv4 + description: "U_site2-spine1" + remote_asn: 11 + ip: 192.168.10.1 + peergroup: peer1 + peergroup_state: present + peergroup_type: ibgp + adv_interval: 40 + fall_over: present + password: bgppassword + route_reflector_client: true + src_loopback: 0 + address_family: + - type: ipv4 + activate: true + state: present + send_community: + - type: standard + state: present + state: present + - type: ipv4 + remote_asn: 13 + local_as: 10 + weight: 10 + ip: 192.168.12.3 + address_family: + - type: ipv4 + activate: true + allow_as_in: 5 + next_hop_self: true + soft_reconf: true + add_path: both 3 + route_map: + - name: qq + filter: in + state: present + max_prefix: + - count: 10 + threshold: 80 + warning: true + state: present + state: present + state: present + - type: ipv6 + remote_asn: 14 + ip: 2001:4898:5808:ffa2::1 + state: present + - type: ipv6 + description: "U_site2-spine1-Auto Discovered peers" + auto_peer: unnumbered-auto + ebgp_peergroup: ebgp_pg + ebgp_peergroup_state: absent + ibgp_peergroup: ibgp_pg + ibgp_peergroup_state: present + sender_loop_detect: true + password: bgppassword + address_family: + - type: ipv4 + activate: true + sender_loop_detect: true + state: present + allow_as_in: 5 + next_hop_self: true + soft_reconf: true + - type: l2vpn + activate: true + sender_loop_detect: false + state: present + send_community: + - type: standard + state: present + admin: up + state: present + redistribute: + - route_type: static + route_map_name: aa + address_type: ipv4 + state: present + bfd_all_neighbors: + interval: 200 + min_rx: 200 + multiplier: 3 + role: active + state: present + vrfs : + - name: "GREEN" + router_id: 1.1.1.1 + address_family_ipv4: + aggregate_address: + - ip_and_mask: 1.1.1.1/16 + state: present + summary_only: true + state: present + neighbor: + - name: ebgp_pg + type: peergroup + bfd: yes + state: present + - name: ibgp_pg + type: peergroup + weight: 10 + state: present + - type: ipv4 + interface: vlan20 + send_community: + - type: extended + state: present + address_family: + - type: l2vpn + activate: true + state: present + admin: up + state: present + - type: ipv4 + description: "U_site2-spine1" + remote_asn: 11 + ip: 192.168.10.1 + peergroup: peer1 + peergroup_state: present + peergroup_type: ibgp + adv_interval: 40 + fall_over: present + password: bgppassword + route_reflector_client: true + src_loopback: 0 + address_family: + - type: ipv4 + activate: true + state: present + send_community: + - type: standard + state: present + state: present + - type: ipv4 + remote_asn: 13 + local_as: 10 + weight: 10 + ip: 192.168.12.3 + address_family: + - type: ipv4 + activate: true + allow_as_in: 5 + next_hop_self: true + soft_reconf: true + add_path: both 3 + route_map: + - name: qq + filter: in + state: present + state: present + state: present + - type: ipv6 + remote_asn: 14 + ip: 2001:4898:5808:ffa2::1 + state: present + - type: ipv6 + description: "U_site2-spine1-Auto Discovered peers" + auto_peer: unnumbered-auto + ebgp_peergroup: ebgp_pg + ebgp_peergroup_state: absent + ibgp_peergroup: ibgp_pg + ibgp_peergroup_state: present + sender_loop_detect: true + password: bgppassword + address_family: + - type: ipv4 + activate: true + sender_loop_detect: true + state: present + allow_as_in: 5 + next_hop_self: true + soft_reconf: true + - type: l2vpn + activate: true + sender_loop_detect: false + state: present + send_community: + - type: standard + state: present + admin: up + state: present + state: present + state: present +################################} +{% macro render_default_metric_configs(af_vars) %} + {% if af_vars.default_metric is defined %} + {% if af_vars.default_metric %} + default-metric {{ af_vars.default_metric }} + {% else %} + no default-metric + {% endif %} + {% endif %} +{% endmacro %} + +{% macro render_outbound_optimization_configs(out_opt_vars) %} + {% if out_opt_vars %} + outbound-optimization + {% else %} + outbound-optimization + {% endif %} +{% endmacro %} + +{% macro render_non_deterministic_med_configs(non_deter_med_vars) %} + {% if non_deter_med_vars %} + non-deterministic-med + {% else %} + no non-deterministic-med + {% endif %} +{% endmacro %} + +{% macro render_enforce_first_as_configs(enforce_first_as_vars) %} + {% if enforce_first_as_vars %} + enforce-first-as + {% else %} + no enforce-first-as + {% endif %} +{% endmacro %} + +{% macro render_as_notation_configs(as_vars) %} + {% if as_vars %} + as-notation {{ as_vars }} + {% endif %} +{% endmacro %} + +{% macro render_neigh_configs(neigh_vars,indent_space) %} + {% if neigh_vars is defined and neigh_vars %} + {% for neighbor in neigh_vars %} + {% if neighbor.type is defined %} + {% if neighbor.type == "ipv4" or neighbor.type =="ipv6" %} + {% if neighbor.ip is defined and neighbor.ip %} + {% set tag_or_ip = neighbor.ip %} + {% if neighbor.state is defined and neighbor.state == "absent" %} + {{ indent_space }}no neighbor {{ tag_or_ip }} + {% else %} + {{ indent_space }}neighbor {{ tag_or_ip }} + {% if neighbor.description is defined %} + {% if neighbor.description %} + {{ indent_space }}description "{{ neighbor.description }}" + {% else %} + {{ indent_space }}no description + {% endif %} + {% endif %} + {% if neighbor.peergroup is defined and neighbor.peergroup %} + {% if neighbor.peergroup_state is defined and neighbor.peergroup_state == "absent" %} + {{ indent_space }}no inherit template {{ neighbor.peergroup }} + {% else %} + {{ indent_space }}inherit template {{ neighbor.peergroup }} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% if neighbor.interface is defined and neighbor.interface %} + {% set tag_or_ip = neighbor.interface %} + {% if neighbor.state is defined and neighbor.state == "absent" %} + {{ indent_space }}no neighbor interface {{ neighbor.interface }} + {% else %} + {{ indent_space }}neighbor interface {{ neighbor.interface }} + {% if neighbor.description is defined %} + {% if neighbor.description %} + {{ indent_space }}description "{{ neighbor.description }}" + {% else %} + {{ indent_space }}no description + {% endif %} + {% endif %} + {% if neighbor.admin is defined %} + {% if neighbor.admin == "up" %} + {{ indent_space }}no shutdown + {% else %} + {{ indent_space }}shutdown + {% endif %} + {% endif %} + {% if neighbor.peergroup is defined and neighbor.peergroup %} + {% if neighbor.peergroup_state is defined and neighbor.peergroup_state == "absent" %} + {{ indent_space }}no inherit template {{ neighbor.peergroup }} + {% elif neighbor.peergroup_type is defined %} + {{ indent_space }}inherit template {{ neighbor.peergroup }} inherit-type {{ neighbor.peergroup_type }} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% if neighbor.auto_peer is defined and neighbor.auto_peer %} + {% set tag_or_ip = neighbor.auto_peer %} + {% if neighbor.state is defined and neighbor.state == "absent" %} + {{ indent_space }}no neighbor {{ neighbor.auto_peer }} + {% else %} + {{ indent_space }}neighbor {{ neighbor.auto_peer }} + {% if neighbor.description is defined %} + {% if neighbor.description %} + {{ indent_space }}description "{{ neighbor.description }}" + {% else %} + {{ indent_space }}no description + {% endif %} + {% endif %} + {% if neighbor.admin is defined %} + {% if neighbor.admin == "up" %} + {{ indent_space }}no shutdown + {% else %} + {{ indent_space }}shutdown + {% endif %} + {% endif %} + {% if neighbor.ebgp_peergroup is defined and neighbor.ebgp_peergroup %} + {% if neighbor.ebgp_peergroup_state is defined and neighbor.ebgp_peergroup_state == "absent" %} + {{ indent_space }}no inherit ebgp-template {{ neighbor.ebgp_peergroup }} + {% else %} + {{ indent_space }}inherit ebgp-template {{ neighbor.ebgp_peergroup }} + {% endif %} + {% endif %} + {% if neighbor.ibgp_peergroup is defined and neighbor.ibgp_peergroup %} + {% if neighbor.ibgp_peergroup_state is defined and neighbor.ibgp_peergroup_state == "absent" %} + {{ indent_space }}no inherit ibgp-template {{ neighbor.ibgp_peergroup }} + {% else %} + {{ indent_space }}inherit ibgp-template {{ neighbor.ibgp_peergroup }} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% elif neighbor.type == "peergroup" %} + {% if neighbor.name is defined and neighbor.name %} + {% set tag_or_ip = neighbor.name %} + {% if neighbor.state is defined and neighbor.state == "absent" %} + {{ indent_space }}no template {{ tag_or_ip }} + {% else %} + {{ indent_space }}template {{ tag_or_ip }} + {% if neighbor.description is defined %} + {% if neighbor.description %} + {{ indent_space }}description "{{ neighbor.description }}" + {% else %} + {{ indent_space }}no description + {% endif %} + {% endif %} + {% if neighbor.listen is defined and neighbor.listen %} + {% for item in neighbor.listen %} + {% if item.subnet is defined and item.subnet %} + {% if item.subnet_state is defined and item.subnet_state =="absent" %} + {{ indent_space }}no listen {{ item.subnet }} + {% else %} + {% set listen_str = item.subnet %} + {% if item.limit is defined and item.limit %} + {% set listen_str = listen_str ~ " limit " ~ item.limit %} + {% endif %} + {{ indent_space }}listen {{ listen_str }} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + + {% endif %} + {% endif %} + {% endif %} + {% if tag_or_ip is defined and tag_or_ip %} + {% if (neighbor.state is defined and not neighbor.state == "absent" ) or neighbor.state is not defined %} + {% if neighbor.remote_asn is defined and neighbor.remote_asn %} + {% if neighbor.remote_asn_state is defined and neighbor.remote_asn_state == "absent" %} + {{ indent_space }}no remote-as {{ neighbor.remote_asn }} + {% else %} + {{ indent_space }}remote-as {{ neighbor.remote_asn }} + {% endif %} + {% endif %} + {% if neighbor.local_as is defined %} + {% if neighbor.local_as %} + {{ indent_space }}local-as {{ neighbor.local_as }} + {% else %} + {{ indent_space }}no local-as + {% endif %} + {% endif %} + {% if neighbor.weight is defined %} + {% if neighbor.weight %} + {{ indent_space }}weight {{ neighbor.weight }} + {% else %} + {{ indent_space }}no weight + {% endif %} + {% endif %} + {% if neighbor.src_loopback is defined %} + {% if neighbor.src_loopback|int(-1) != -1 %} + {{ indent_space }}update-source loopback{{ neighbor.src_loopback }} + {% else %} + {{ indent_space }}no update-source loopback + {% endif %} + {% endif %} + + {% if neighbor.ebgp_multihop is defined %} + {% if neighbor.ebgp_multihop %} + {{ indent_space }}ebgp-multihop {{ neighbor.ebgp_multihop }} + {% else %} + {{ indent_space }}no ebgp-multihop + {% endif %} + {% endif %} + {% if neighbor.route_reflector_client is defined %} + {% if neighbor.route_reflector_client %} + {{ indent_space }}route-reflector-client + {% else %} + {{ indent_space }}no route-reflector-client + {% endif %} + {% endif %} + {% if neighbor.password is defined %} + {% if neighbor.password %} + {{ indent_space }}password {{ neighbor.password }} + {% else %} + {{ indent_space }}no password a + {% endif %} + {% endif %} + {% if neighbor.send_community is defined and neighbor.send_community %} + {% for comm in neighbor.send_community %} + {% if comm.type is defined and comm.type %} + {% if comm.state is defined and comm.state == "absent" %} + {{ indent_space }}no send-community {{ comm.type }} + {% else %} + {{ indent_space }}send-community {{ comm.type }} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% if neighbor.address_family is defined and neighbor.address_family %} + {% for af in neighbor.address_family %} + {% if af.type is defined and af.type %} + {% if af.state is defined and af.state == "absent" %} + {% if af.type == "l2vpn" %} + {{ indent_space }}no address-family {{ af.type }} evpn + {% else %} + {{ indent_space }}no address-family {{ af.type }} unicast + {% endif %} + {% else %} + {% if af.type == "l2vpn" %} + {{ indent_space }}address-family {{ af.type }} evpn + {% else %} + {{ indent_space }}address-family {{ af.type }} unicast + {% endif %} + {% if af.activate is defined %} + {% if af.activate %} + {{ indent_space }}activate + {% else %} + {{ indent_space }}no activate + {% endif %} + {% endif %} + {% if af.sender_loop_detect is defined %} + {% if af.sender_loop_detect %} + {{ indent_space }}sender-side-loop-detection + {% else %} + {{ indent_space }}no sender-side-loop-detection + {% endif %} + {% endif %} + {% if af.allow_as_in is defined %} + {% if af.allow_as_in %} + {{ indent_space }}allowas-in {{ af.allow_as_in }} + {% else %} + {{ indent_space }}no allowas-in + {% endif %} + {% endif %} + {% if af.route_map is defined and af.route_map %} + {% for item in af.route_map %} + {% if item.name is defined and item.name %} + {% if item.filter is defined and item.filter %} + {% if item.state is defined and item.state == "absent" %} + {{ indent_space }}no route-map {{ item.name }} {{ item.filter }} + {% else %} + {{ indent_space }}route-map {{ item.name }} {{ item.filter }} + {% endif%} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% if af.next_hop_self is defined %} + {% if af.next_hop_self %} + {{ indent_space }}next-hop-self + {% else %} + {{ indent_space }}no next-hop-self + {% endif %} + {% endif %} + {% if af.soft_reconf is defined %} + {% if af.soft_reconf %} + {{ indent_space }}soft-reconfiguration inbound + {% else %} + {{ indent_space }}no soft-reconfiguration inbound + {% endif %} + {% endif %} + {% if af.add_path is defined %} + {% if af.add_path %} + {{ indent_space }}add-path {{ af.add_path }} + {% else %} + {{ indent_space }}no add-path + {% endif %} + {% endif %} + {% if af.max_prefix is defined %} + {% if af.max_prefix.count is defined and af.max_prefix.count %} + {% if af.max_prefix.state is defined and af.max_prefix.state == "absent" %} + {{ indent_space }}no maximum-prefix {{ af.max_prefix.count }} + {% else %} + {% set max_pfrx_str = af.max_prefix.count %} + {% if af.max_prefix.threshold is defined and af.max_prefix.threshold %} + {% set max_pfrx_str = max_pfrx_str ~ " " ~ af.max_prefix.threshold %} + {% endif %} + {% if af.max_prefix.warning is defined and af.max_prefix.warning %} + {% set max_pfrx_str = max_pfrx_str ~ " warning-only" %} + {% endif %} + {{ indent_space }}maximum-prefix {{ max_pfrx_str }} + {% endif %} + {% endif %} + {% endif %} + {% if af.default_originate is defined %} + {% if af.default_originate.state is defined and af.default_originate.state == "absent" %} + {{ indent_space }}no default-originate + {% else %} + {% set def_origin_str = " " %} + {% if af.default_originate.route_map is defined and af.default_originate.route_map %} + {% set def_origin_str = "route-map " ~ af.default_originate.route_map %} + {% endif %} + {{ indent_space }}default-originate {{ def_origin_str }} + {% endif %} + {% endif %} + {% if af.distribute_list is defined and af.distribute_list %} + {% if af.distribute_list.in is defined and af.distribute_list.in %} + {% if af.distribute_list.in_state is defined and af.distribute_list.in_state == "absent" %} + {{ indent_space }}no distribute-list {{ af.distribute_list.in }} in + {% else %} + {{ indent_space }}distribute-list {{ af.distribute_list.in }} in + {% endif %} + {% endif %} + {% if af.distribute_list.out is defined and af.distribute_list.out %} + {% if af.distribute_list.out_state is defined and af.distribute_list.out_state == "absent" %} + {{ indent_space }}no distribute-list {{ af.distribute_list.out }} out + {% else %} + {{ indent_space }}distribute-list {{ af.distribute_list.out }} out + {% endif %} + {% endif %} + {% endif %} + + + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% if neighbor.adv_interval is defined %} + {% if neighbor.adv_interval %} + {{ indent_space }}advertisement-interval {{ neighbor.adv_interval }} + {% else %} + {{ indent_space }}no advertisement-interval + {% endif %} + {% endif %} + {% if neighbor.adv_start is defined and neighbor.adv_start >= 0 %} + {% if neighbor.adv_start_state is defined and neighbor.adv_start_state == "absent" %} + {{ indent_space }}no advertisement-start + {% else %} + {{ indent_space }}advertisement-start {{ neighbor.adv_start }} + {% endif %} + {% endif %} + {% if neighbor.conn_retry_timer is defined %} + {% if neighbor.conn_retry_timer %} + {{ indent_space }}connection-retry-timer {{ neighbor.conn_retry_timer }} + {% else %} + {{ indent_space }}no connection-retry-timer + {% endif %} + {% endif %} + {% if neighbor.remove_pri_as is defined and neighbor.remove_pri_as == "present" %} + {{ indent_space }}remove-private-as + {% elif neighbor.remove_pri_as is defined and neighbor.remove_pri_as == "absent" %} + {{ indent_space }}no remove-private-as + {% endif %} + {% if neighbor.fall_over is defined and neighbor.fall_over == "present" %} + {{ indent_space }}fall-over + {% elif neighbor.fall_over is defined and neighbor.fall_over == "absent" %} + {{ indent_space }}no fall-over + {% endif %} + {% if neighbor.bfd is defined and neighbor.bfd %} + {{ indent_space }}bfd + {% elif neighbor.bfd is defined and not neighbor.bfd %} + {{ indent_space }}no bfd + {% endif %} + {% if neighbor.timer is defined %} + {% if neighbor.timer %} + {{ indent_space }}timers {{ neighbor.timer }} + {% else %} + {{ indent_space }}no timers + {% endif %} + {% endif %} + {% if neighbor.admin is defined %} + {% if neighbor.admin == "up" %} + {{ indent_space }}no shutdown + {% else %} + {{ indent_space }}shutdown + {% endif %} + {% endif %} + {% if neighbor.distribute_list is defined and neighbor.distribute_list %} + {{ indent_space }}address-family ipv4 unicast + {% if neighbor.distribute_list.in is defined and neighbor.distribute_list.in %} + {% if neighbor.distribute_list.in_state is defined and neighbor.distribute_list.in_state == "absent" %} + {{ indent_space }}no distribute-list {{ neighbor.distribute_list.in }} in + {% else %} + {{ indent_space }}distribute-list {{ neighbor.distribute_list.in }} in + {% endif %} + {% endif %} + {% if neighbor.distribute_list.out is defined and neighbor.distribute_list.out %} + {% if neighbor.distribute_list.out_state is defined and neighbor.distribute_list.out_state == "absent" %} + {{ indent_space }}no distribute-list {{ neighbor.distribute_list.out }} out + {% else %} + {{ indent_space }}distribute-list {{ neighbor.distribute_list.out }} out + {% endif %} + {% endif %} + {% endif %} + {% if neighbor.sender_loop_detect is defined %} + {{ indent_space }}address-family ipv4 unicast + {% if neighbor.sender_loop_detect %} + {{ indent_space }}sender-side-loop-detection + {% else %} + {{ indent_space }}no sender-side-loop-detection + {% endif %} + {% endif %} + + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} +{% endmacro %} + +{% macro render_ibgp_redist_internal_configs(af_vars) %} + {% if af_vars.ibgp_redist_internal is defined and af_vars.ibgp_redist_internal%} + {% if af_vars.ibgp_redist_internal.state is defined and af_vars.ibgp_redist_internal.state == "absent" %} + no bgp redistribute-internal + {% else %} + bgp redistribute-internal + {% endif %} + {% endif %} +{% endmacro %} + +{% macro render_distance_bgp_configs(af_vars) %} + {% if af_vars.distance_bgp is defined and af_vars.distance_bgp %} + {% if af_vars.distance_bgp.state is defined and af_vars.distance_bgp.state == "absent" %} + no distance bgp + {% else %} + {% if af_vars.distance_bgp.value is defined and af_vars.distance_bgp.value %} + distance bgp {{ af_vars.distance_bgp.value }} + {% endif %} + {% endif %} + {% endif %} +{% endmacro %} + + +{% macro render_dampening_configs(af_vars) %} + {% if af_vars.dampening is defined and af_vars.dampening %} + {% if af_vars.dampening.state is defined and af_vars.dampening.state == "absent" %} + no dampening + {% else %} + {% if af_vars.dampening.value is defined and af_vars.dampening.value %} + {% if af_vars.dampening.route_map is defined and af_vars.dampening.route_map %} + dampening {{ af_vars.dampening.value }} route-map {{ af_vars.dampening.route_map }} + {% else %} + dampening {{ af_vars.dampening.value }} + {% endif %} + {% else %} + {% if af_vars.dampening.route_map is defined and af_vars.dampening.route_map %} + dampening 15 750 2000 60 route-map {{ af_vars.dampening.route_map }} + {% endif %} + {% endif %} + {% endif %} + {% endif %} +{% endmacro %} + +{% macro render_af_configs(af_vars) %} + {% if af_vars is defined and af_vars %} + {% if af_vars.aggregate_address is defined and af_vars.aggregate_address %} + {% for addr in af_vars.aggregate_address %} + {% if addr.ip_and_mask is defined and addr.ip_and_mask %} + {% if addr.state is defined and addr.state == "absent" %} + no aggregate-address {{ addr.ip_and_mask }} + {% else %} + {% set aggr_str = addr.ip_and_mask %} + {% if addr.adv_map is defined and addr.adv_map %} + {% set aggr_str = aggr_str ~ " advertise-map " ~ addr.adv_map %} + {% endif %} + {% if addr.as_set is defined and addr.as_set %} + {% set aggr_str = aggr_str ~ " as-set " %} + {% endif %} + {% if addr.attr_map is defined and addr.attr_map %} + {% set aggr_str = aggr_str ~ " attribute-map " ~ addr.attr_map %} + {% endif %} + {% if addr.summary is defined and addr.summary %} + {% set aggr_str = aggr_str ~ " summary-only" %} + {% endif %} + {% if addr.suppress_map is defined and addr.suppress_map %} + {% set aggr_str = aggr_str ~ " suppress-map " ~ addr.suppress_map %} + {% endif %} + aggregate-address {{ aggr_str }} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% endif %} +{% endmacro %} + +{% macro render_rtid_configs(routerid_vars) %} + {% if routerid_vars %} + router-id {{ routerid_vars }} + {% else %} + no router-id + {% endif %} +{% endmacro %} + +{% macro render_bfd_all_neigh_configs(bfd_all_neigh_vars) %} + {% if bfd_all_neigh_vars.state is defined and bfd_all_neigh_vars.state == "absent"%} + no bfd all-neighbors + {% else %} + {% set bfd_vars = bfd_all_neigh_vars %} + {% if bfd_vars.interval is defined and bfd_vars.min_rx is defined and bfd_vars.multiplier is defined %} + bfd all-neighbors interval {{ bfd_vars.interval }} min_rx {{ bfd_vars.min_rx }} multiplier {{ bfd_vars.multiplier }} role {{ bfd_vars.role }} + {% else %} + bfd all-neighbors + {% endif %} + {% endif %} +{% endmacro %} + +{% macro render_log_neigh_change_configs(log_neigh_change_vars) %} + {% if log_neigh_change_vars %} + log-neighbor-changes + {% else %} + no log-neighbor-changes + {% endif %} +{% endmacro %} + +{% macro render_maxpath_ebgp_configs(maxpath_ebgp_vars) %} + {% if maxpath_ebgp_vars %} + maximum-paths ebgp {{ maxpath_ebgp_vars }} + {% else %} + no maximum-paths ebgp + {% endif %} +{% endmacro %} + +{% macro render_maxpath_ibgp_configs(maxpath_ibgp_vars) %} + {% if maxpath_ibgp_vars %} + maximum-paths ibgp {{ maxpath_ibgp_vars }} + {% else %} + no maximum-paths ibgp + {% endif %} +{% endmacro %} + +{% macro render_graceful_restart_configs(graceful_restart_vars) %} + {% if graceful_restart_vars %} + graceful-restart role receiver-only + {% else %} + no graceful-restart role receiver-only + {% endif %} +{% endmacro %} + +{% macro render_always_compare_med_configs(always_compare_med_vars) %} + {% if always_compare_med_vars %} + always-compare-med + {% else %} + no always-compare-med + {% endif %} +{% endmacro %} + +{% macro render_default_loc_pref_configs(default_loc_pref_vars) %} + {% if default_loc_pref_vars %} + default local-preference {{ default_loc_pref_vars }} + {% else %} + no default local-preference + {% endif %} +{% endmacro %} + +{% macro render_fast_ext_fallover_configs(fast_ext_fallover_vars) %} + {% if fast_ext_fallover_vars %} + fast-external-fallover + {% else %} + no fast-external-fallover + {% endif %} +{% endmacro %} + +{% macro render_confederation_configs(confederation_vars) %} + {% if confederation_vars.identifier is defined %} + {% if confederation_vars.identifier %} + confederation identifier {{ confederation_vars.identifier }} + {% else %} + no confederation identifier 1 + {% endif %} + {% endif %} + {% if confederation_vars.peers is defined and confederation_vars.peers %} + {% if confederation_vars.peers_state is defined and confederation_vars.peers_state == "absent" %} + no confederation peers {{ confederation_vars.peers }} + {% else %} + confederation peers {{ confederation_vars.peers }} + {% endif %} + {% endif %} +{% endmacro %} + +{% macro render_route_reflector_client_configs(route_reflector_vars) %} + {% if route_reflector_vars.client_to_client is defined %} + {% if route_reflector_vars.client_to_client %} + client-to-client reflection + {% else %} + no client-to-client reflection + {% endif %} + {% endif %} +{% endmacro %} +{% macro render_route_reflector_cluster_configs(route_reflector_vars) %} + {% if route_reflector_vars.cluster_id is defined %} + {% if route_reflector_vars.cluster_id %} + cluster-id {{ route_reflector_vars.cluster_id }} + {% else %} + no cluster-id 1 + {% endif %} + {% endif %} +{% endmacro %} + +{% macro render_best_path_as_configs(best_path_vars) %} + {% if best_path_vars.as_path is defined and best_path_vars.as_path %} + {% if best_path_vars.as_path_state is defined and best_path_vars.as_path_state == "absent" %} + no bestpath as-path {{ best_path_vars.as_path }} + {% else %} + bestpath as-path {{ best_path_vars.as_path }} + {% endif %} + {% endif %} +{% endmacro %} +{% macro render_best_path_routerid_configs(best_path_vars) %} + {% if best_path_vars.ignore_router_id is defined %} + {% if best_path_vars.ignore_router_id %} + bestpath router-id ignore + {% else %} + no bestpath router-id ignore + {% endif %} + {% endif %} +{% endmacro %} +{% macro render_best_path_med_configs(best_path_vars,indent_space) %} + {% if best_path_vars.med is defined and best_path_vars.med %} + {% for med in best_path_vars.med %} + {% if med.attribute is defined and med.attribute %} + {% if med.state is defined and med.state == "absent" %} + {{ indent_space }}no bestpath med {{ med.attribute }} + {% else %} + {{ indent_space }}bestpath med {{ med.attribute }} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} +{% endmacro %} + +{% macro render_ipv4_network_configs(ipv4_network_vars) %} + {% for net in ipv4_network_vars %} + {% if net.address is defined and net.address %} + {% if net.state is defined and net.state == "absent"%} + no network {{ net.address }} + {% else %} + network {{ net.address }} + {% endif %} + {% endif %} + {% endfor %} +{% endmacro %} + +{% macro render_ipv6_network_configs(ipv6_network_vars) %} + {% for net in ipv6_network_vars %} + {% if net.address is defined and net.address %} + {% if net.state is defined and net.state == "absent"%} + no network {{ net.address }} + {% else %} + network {{ net.address }} + {% endif %} + {% endif %} + {% endfor %} +{% endmacro %} + +{% macro render_redistribute_configs(redistribute_vars,indent_space) %} + {% for route in redistribute_vars %} + {% if route.route_type is defined and route.route_type %} + {% if route.address_type is defined and route.address_type %} + {{ indent_space }}address-family {{ route.address_type }} unicast + {% if route.state is defined and route.state == "absent" %} + {% if route.route_type == "imported_bgp" %} + {% set redist_str = "imported-bgp-routes vrf " ~ route.imported_bgp_vrf_name %} + {% elif route.route_type == "ospf" and route.ospf_id %} + {% set redist_str = route.route_type ~ " " ~ route.ospf_id %} + {% elif route.route_type == "l2vpn" %} + {% set redist_str = route.route_type ~ " evpn" %} + {% else %} + {% set redist_str = route.route_type %} + {% endif %} + {{ indent_space }}no redistribute {{ redist_str }} + {% else %} + {% if route.route_map_name is defined and route.route_map_name %} + {% if route.route_type == "imported_bgp" %} + {% set redist_str = "imported-bgp-routes vrf " ~ route.imported_bgp_vrf_name ~ " route-map " ~ route.route_map_name %} + {% elif route.route_type == "ospf" and route.ospf_id %} + {% set redist_str = route.route_type ~ " " ~ route.ospf_id ~ " route-map " ~ route.route_map_name %} + {% elif route.route_type == "l2vpn" %} + {% set redist_str = route.route_type ~ " evpn route-map " ~ route.route_map_name %} + {% else %} + {% set redist_str = route.route_type ~ " route-map " ~ route.route_map_name %} + {% endif %} + {{ indent_space }}redistribute {{ redist_str }} + {% else %} + {% if route.route_type == "imported_bgp" %} + {% set redist_str = "imported-bgp-routes vrf " ~ route.imported_bgp_vrf_name %} + {% elif route.route_type == "ospf" and route.ospf_id %} + {% set redist_str = route.route_type ~ " " ~ route.ospf_id %} + {% elif route.route_type == "l2vpn" %} + {% set redist_str = route.route_type ~ " evpn" %} + {% else %} + {% set redist_str = route.route_type %} + {% endif %} + {{ indent_space }}redistribute {{ redist_str }} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endfor %} +{% endmacro %} + +{% if os10_bgp is defined and os10_bgp %} +{% set bgp_vars = os10_bgp %} +{% if bgp_vars.state is defined and bgp_vars.state == "absent" %} +no router bgp +{% else %} + {# Add Feature to the switch #} + {% if bgp_vars.asn is defined and bgp_vars.asn %} +router bgp {{ bgp_vars.asn }} + {% set indent_space = "" %} + {% if bgp_vars.router_id is defined %} + {% set routerid_vars = bgp_vars.router_id %} +{{ render_rtid_configs(routerid_vars) }} + {% endif %} + + {% if bgp_vars.as_notation is defined %} + {% set as_vars = bgp_vars.as_notation %} +{{ render_as_notation_configs(as_vars) }} + {% endif %} + + {% if bgp_vars.enforce_first_as is defined %} + {% set enforce_first_as_vars = bgp_vars.enforce_first_as %} +{{ render_enforce_first_as_configs(enforce_first_as_vars) }} + {% endif %} + + {% if bgp_vars.non_deterministic_med is defined %} + {% set non_deter_med_vars = bgp_vars.non_deterministic_med %} +{{ render_non_deterministic_med_configs(non_deter_med_vars) }} + {% endif %} + + {% if bgp_vars.outbound_optimization is defined %} + {% set out_opt_vars = bgp_vars.outbound_optimization %} +{{ render_outbound_optimization_configs(out_opt_vars) }} + {% endif %} + + {% if bgp_vars.bfd_all_neighbors is defined and bgp_vars.bfd_all_neighbors is defined %} + {% set bfd_all_neigh_vars = bgp_vars.bfd_all_neighbors %} +{{ render_bfd_all_neigh_configs(bfd_all_neigh_vars) }} + {% endif %} + + {% if bgp_vars.log_neighbor_changes is defined %} + {% set log_neigh_change_vars = bgp_vars.log_neighbor_changes %} +{{ render_log_neigh_change_configs(log_neigh_change_vars) }} + {% endif %} + + {% if bgp_vars.maxpath_ebgp is defined %} + {% set maxpath_ebgp_vars = bgp_vars.maxpath_ebgp %} +{{ render_maxpath_ebgp_configs(maxpath_ebgp_vars) }} + {% endif %} + + {% if bgp_vars.maxpath_ibgp is defined %} + {% set maxpath_ibgp_vars = bgp_vars.maxpath_ibgp %} +{{ render_maxpath_ibgp_configs(maxpath_ibgp_vars) }} + {% endif %} + + {% if bgp_vars.graceful_restart is defined %} + {% set graceful_restart_vars = bgp_vars.graceful_restart %} +{{ render_graceful_restart_configs(graceful_restart_vars) }} + {% endif %} + + {% if bgp_vars.always_compare_med is defined %} + {% set always_compare_med_vars = bgp_vars.always_compare_med %} +{{ render_always_compare_med_configs(always_compare_med_vars) }} + {% endif %} + + {% if bgp_vars.default_loc_pref is defined %} + {% set default_loc_pref_vars = bgp_vars.default_loc_pref %} +{{ render_default_loc_pref_configs(default_loc_pref_vars) }} + {% endif %} + + {% if bgp_vars.fast_ext_fallover is defined %} + {% set fast_ext_fallover_vars = bgp_vars.fast_ext_fallover %} +{{ render_fast_ext_fallover_configs(fast_ext_fallover_vars) }} + {% endif %} + + {% if bgp_vars.confederation is defined and bgp_vars.confederation %} + {% set confederation_vars = bgp_vars.confederation %} +{{ render_confederation_configs(confederation_vars) }} + {% endif %} + + {% if bgp_vars.route_reflector is defined and bgp_vars.route_reflector %} + {% set route_reflector_vars = bgp_vars.route_reflector %} +{{ render_route_reflector_client_configs(route_reflector_vars) }} +{{ render_route_reflector_cluster_configs(route_reflector_vars) }} + {% endif %} + + {% if bgp_vars.best_path is defined and bgp_vars.best_path %} + {% set best_path_vars = bgp_vars.best_path %} +{{ render_best_path_as_configs(best_path_vars) }} +{{ render_best_path_routerid_configs(best_path_vars) }} +{{ render_best_path_med_configs(best_path_vars,indent_space) }} + {% endif %} + + {% if bgp_vars.address_family_ipv4 is defined and bgp_vars.address_family_ipv4 %} + {% set af_vars = bgp_vars.address_family_ipv4 %} + address-family ipv4 unicast +{{ render_af_configs(af_vars) }} +{{ render_ibgp_redist_internal_configs(af_vars) }} +{{ render_dampening_configs(af_vars) }} +{{ render_default_metric_configs(af_vars) }} +{{ render_distance_bgp_configs(af_vars) }} + {% endif %} + + {% if bgp_vars.address_family_ipv6 is defined and bgp_vars.address_family_ipv6 %} + {% set af_vars = bgp_vars.address_family_ipv6 %} + address-family ipv6 unicast +{{ render_af_configs(af_vars) }} +{{ render_ibgp_redist_internal_configs(af_vars) }} +{{ render_dampening_configs(af_vars) }} +{{ render_default_metric_configs(af_vars) }} +{{ render_distance_bgp_configs(af_vars) }} + {% endif %} + + {% if bgp_vars.ipv4_network is defined and bgp_vars.ipv4_network %} + {% set ipv4_network_vars = bgp_vars.ipv4_network %} + address-family ipv4 unicast +{{ render_ipv4_network_configs(ipv4_network_vars) }} + {% endif %} + + {% if bgp_vars.ipv6_network is defined and bgp_vars.ipv6_network %} + {% set ipv6_network_vars = bgp_vars.ipv6_network %} + address-family ipv6 unicast +{{ render_ipv6_network_configs(ipv6_network_vars) }} + {% endif %} + + {% if bgp_vars.redistribute is defined and bgp_vars.redistribute %} + {% set redistribute_vars = bgp_vars.redistribute %} +{{ render_redistribute_configs(redistribute_vars,indent_space) }} + {% endif %} + + {% if bgp_vars.neighbor is defined and bgp_vars.neighbor %} + {% set neigh_vars = bgp_vars.neighbor %} +{{ render_neigh_configs(neigh_vars,indent_space) }} + {% endif %} + + {% if bgp_vars.vrfs is defined %} + {% set indent_space = " " %} + {% for vrf in bgp_vars.vrfs %} + {% if vrf.state is defined and vrf.state == "absent" %} + no vrf {{ vrf.name }} + {% else %} + vrf {{ vrf.name }} + + {% if vrf.router_id is defined %} + {% set routerid_vars = vrf.router_id %} + {{ render_rtid_configs(routerid_vars) }} + {% endif %} + + {% if vrf.as_notation is defined %} + {% set as_vars = vrf.as_notation %} + {{ render_as_notation_configs(as_vars) }} + {% endif %} + + {% if vrf.enforce_first_as is defined %} + {% set enforce_first_as_vars = vrf.enforce_first_as %} + {{ render_enforce_first_as_configs(enforce_first_as_vars) }} + {% endif %} + + {% if vrf.non_deterministic_med is defined %} + {% set non_deter_med_vars = vrf.non_deterministic_med %} + {{ render_non_deterministic_med_configs(non_deter_med_vars) }} + {% endif %} + + {% if vrf.outbound_optimization is defined %} + {% set out_opt_vars = vrf.outbound_optimization %} + {{ render_outbound_optimization_configs(out_opt_vars) }} + {% endif %} + + {% if vrf.bfd_all_neighbors is defined and vrf.bfd_all_neighbors is defined %} + {% set bfd_all_neigh_vars = vrf.bfd_all_neighbors %} + {{ render_bfd_all_neigh_configs(bfd_all_neigh_vars) }} + {% endif %} + + {% if vrf.log_neighbor_changes is defined %} + {% set log_neigh_change_vars = vrf.log_neighbor_changes %} + {{ render_log_neigh_change_configs(log_neigh_change_vars) }} + {% endif %} + + {% if vrf.maxpath_ebgp is defined %} + {% set maxpath_ebgp_vars = vrf.maxpath_ebgp %} + {{ render_maxpath_ebgp_configs(maxpath_ebgp_vars) }} + {% endif %} + + {% if vrf.maxpath_ibgp is defined %} + {% set maxpath_ibgp_vars = vrf.maxpath_ibgp %} + {{ render_maxpath_ibgp_configs(maxpath_ibgp_vars) }} + {% endif %} + + {% if vrf.graceful_restart is defined %} + {% set graceful_restart_vars = vrf.graceful_restart %} + {{ render_graceful_restart_configs(graceful_restart_vars) }} + {% endif %} + + {% if vrf.always_compare_med is defined %} + {% set always_compare_med_vars = vrf.always_compare_med %} + {{ render_always_compare_med_configs(always_compare_med_vars) }} + {% endif %} + + {% if vrf.default_loc_pref is defined %} + {% set default_loc_pref_vars = vrf.default_loc_pref %} + {{ render_default_loc_pref_configs(default_loc_pref_vars) }} + {% endif %} + + {% if vrf.fast_ext_fallover is defined %} + {% set fast_ext_fallover_vars = vrf.fast_ext_fallover %} + {{ render_fast_ext_fallover_configs(fast_ext_fallover_vars) }} + {% endif %} + + {% if vrf.route_reflector is defined and vrf.route_reflector %} + {% set route_reflector_vars = vrf.route_reflector %} + {{ render_route_reflector_client_configs(route_reflector_vars) }} + {{ render_route_reflector_cluster_configs(route_reflector_vars) }} + {% endif %} + + {% if vrf.best_path is defined and vrf.best_path %} + {% set best_path_vars = vrf.best_path %} + {{ render_best_path_as_configs(best_path_vars) }} + {{ render_best_path_routerid_configs(best_path_vars) }} +{{ render_best_path_med_configs(best_path_vars,indent_space) }} + {% endif %} + + {% if vrf.address_family_ipv4 is defined and vrf.address_family_ipv4 %} + {% set af_vars = vrf.address_family_ipv4 %} + address-family ipv4 unicast + {{ render_af_configs(af_vars) }} + {{ render_dampening_configs(af_vars) }} + {{ render_ibgp_redist_internal_configs(af_vars) }} + {{ render_default_metric_configs(af_vars) }} + {{ render_distance_bgp_configs(af_vars) }} + {% endif %} + + {% if vrf.address_family_ipv6 is defined and vrf.address_family_ipv6 %} + {% set af_vars = vrf.address_family_ipv6 %} + address-family ipv6 unicast + {{ render_af_configs(af_vars) }} + {{ render_dampening_configs(af_vars) }} + {{ render_ibgp_redist_internal_configs(af_vars) }} + {{ render_default_metric_configs(af_vars) }} + {{ render_distance_bgp_configs(af_vars) }} + {% endif %} + + {% if vrf.ipv4_network is defined and vrf.ipv4_network %} + {% set ipv4_network_vars = vrf.ipv4_network %} + address-family ipv4 unicast + {{ render_ipv4_network_configs(ipv4_network_vars) }} + {% endif %} + + {% if vrf.ipv6_network is defined and vrf.ipv6_network %} + {% set ipv6_network_vars = vrf.ipv6_network %} + address-family ipv6 unicast + {{ render_ipv6_network_configs(ipv6_network_vars) }} + {% endif %} + + {% if vrf.redistribute is defined and vrf.redistribute %} + {% set redistribute_vars = vrf.redistribute %} +{{ render_redistribute_configs(redistribute_vars,indent_space) }} + {% endif %} + + {% if vrf.neighbor is defined and vrf.neighbor %} + {% set neigh_vars = vrf.neighbor %} +{{ render_neigh_configs(neigh_vars,indent_space) }} + {% endif %} + + {% endif %} + {% endfor %} + {% endif %} + {% endif %} +{% endif %} +{% endif %} diff --git a/ansible_collections/dellemc/os10/roles/os10_bgp/tests/inventory.yaml b/ansible_collections/dellemc/os10/roles/os10_bgp/tests/inventory.yaml new file mode 100644 index 00000000..b1ff63e6 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_bgp/tests/inventory.yaml @@ -0,0 +1,22 @@ +--- +spine1 ansible_host=10.11.182.25 ansible_network_os="dellemc.os10.os10" +spine2 ansible_host=10.16.151.220 ansible_network_os="dellemc.os10.os10" + +leaf1 ansible_host=10.11.182.23 ansible_network_os="dellemc.os10.os10" +leaf2 ansible_host=10.11.182.16 ansible_network_os="dellemc.os10.os10" +leaf3 ansible_host=10.11.182.17 ansible_network_os="dellemc.os10.os10" +leaf4 ansible_host=10.16.148.79 ansible_network_os="dellemc.os10.os10" + +[spine] +spine1 +spine2 + +[leaf] +leaf1 +leaf2 +leaf3 +leaf4 + +[datacenter:children] +spine +leaf diff --git a/ansible_collections/dellemc/os10/roles/os10_bgp/tests/main.os10.yaml b/ansible_collections/dellemc/os10/roles/os10_bgp/tests/main.os10.yaml new file mode 100644 index 00000000..e556186d --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_bgp/tests/main.os10.yaml @@ -0,0 +1,384 @@ +--- +# vars file for dellemc.os10.os10_bgp, +# below gives a sample configuration +# Sample variables for OS10 device +os10_bgp: + asn: 12 + router_id: 90.1.1.4 + as_notation: asdot + enforce_first_as: false + non_deterministic_med: true + outbound_optimization: true + maxpath_ibgp: 2 + maxpath_ebgp: 2 + graceful_restart: true + log_neighbor_changes: true + fast_ext_fallover: false + always_compare_med: true + default_loc_pref: 1000 + confederation: + identifier: 25 + peers: 23 24 + peers_state: present + route_reflector: + client_to_client: false + cluster_id: 4294967295 + address_family_ipv4: + aggregate_address: + - ip_and_mask: 1.1.1.1/16 + state: present + dampening: + value: 15 750 2000 60 + route_map: qq + state: present + ibgp_redist_internal: + state: present + default_metric: 10 + distance_bgp: + value: 3 4 6 + state: present + address_family_ipv6: + aggregate_address: + - ip_and_mask: 2001:4898:5808:ffa0::/126 + state: present + summary_only: true + ibgp_redist_internal: + state: present + best_path: + as_path: ignore + as_path_state: present + ignore_router_id: true + med: + - attribute: confed + state: present + ipv4_network: + - address: 101.1.1.0/30 + state: present + ipv6_network: + - address: "2001:4898:5808:ffa0::/126" + state: present + neighbor: + - name: peer1 + type: peergroup + state: present + - name: ebgp_pg + type: peergroup + bfd: yes + state: present + address_family: + - type: ipv4 + activate: false + state: present + max_prefix: + count: 20 + threshold: 90 + warning: true + state: present + listen: + - subnet: 4.4.4.4/32 + limit: 4 + subnet_state: present + - subnet: 6.6.6.6/32 + limit: 3 + subnet_state: present + - subnet: 23::/64 + limit: + subnet_state: present + - name: ibgp_pg + type: peergroup + weight: 10 + state: present + - type: ipv4 + interface: vlan20 + send_community: + - type: extended + state: present + address_family: + - type: l2vpn + activate: true + state: present + admin: up + state: present + - type: ipv4 + description: "U_site2-spine1" + remote_asn: 11 + ip: 192.168.10.1 + peergroup: peer1 + peergroup_state: present + peergroup_type: ibgp + adv_interval: 40 + fall_over: present + password: bgppassword + route_reflector_client: true + adv_start: 100 + adv_start_state: present + conn_retry_timer: 20 + remove_pri_as: present + src_loopback: 0 + address_family: + - type: ipv4 + activate: true + state: present + max_prefix: + count: 30 + threshold: 50 + state: present + default_originate: + route_map: aa + state: present + send_community: + - type: standard + state: present + state: present + - type: ipv4 + remote_asn: 13 + local_as: 10 + weight: 10 + ip: 192.168.12.3 + address_family: + - type: ipv4 + activate: true + allow_as_in: 5 + next_hop_self: true + soft_reconf: true + add_path: both 3 + route_map: + - name: qq + filter: in + state: present + state: present + state: present + - type: ipv6 + remote_asn: 14 + ip: 2001:4898:5808:ffa2::1 + state: present + - type: ipv6 + description: "U_site2-spine1-Auto Discovered peers" + auto_peer: unnumbered-auto + ebgp_peergroup: ebgp_pg + ebgp_peergroup_state: absent + ibgp_peergroup: ibgp_pg + ibgp_peergroup_state: present + sender_loop_detect: true + password: bgppassword + address_family: + - type: ipv4 + activate: true + sender_loop_detect: true + state: present + allow_as_in: 5 + next_hop_self: true + soft_reconf: true + - type: l2vpn + activate: true + sender_loop_detect: false + state: present + send_community: + - type: standard + state: present + admin: up + state: present + redistribute: + - route_type: static + route_map_name: aa + address_type: ipv4 + state: present + bfd_all_neighbors: + interval: 200 + min_rx: 200 + multiplier: 3 + role: active + state: present + vrfs: + - name: "test1" + router_id: 70.1.1.4 + maxpath_ibgp: 2 + maxpath_ebgp: 2 + graceful_restart: true + log_neighbor_changes: false + enforce_first_as: false + non_deterministic_med: true + outbound_optimization: true + fast_ext_fallover: false + always_compare_med: true + default_loc_pref: 1000 + route_reflector: + client_to_client: false + cluster_id: 2000 + address_family_ipv4: + aggregate_address: + - ip_and_mask: 1.1.1.1/16 + state: present + dampening: + value: 15 750 2000 60 + route_map: qq + state: present + distance_bgp: + value: 3 4 6 + state: present + ibgp_redist_internal: + state: present + default_metric: 10 + address_family_ipv6: + aggregate_address: + - ip_and_mask: 2001:4898:5808:ffa0::/126 + state: present + summary_only: true + ibgp_redist_internal: + state: present + best_path: + as_path: ignore + as_path_state: present + ignore_router_id: true + med: + - attribute: confed + state: present + - attribute: missing-as-worst + state: present + ipv4_network: + - address: 101.1.1.0/30 + state: present + ipv6_network: + - address: "2001:4898:5808:ffa0::/126" + state: present + neighbor: + - name: peer1 + type: peergroup + description: "template peer1" + adv_interval: 50 + adv_start: 100 + adv_start_state: present + ebgp_multihop: 20 + fall_over: present + conn_retry_timer: 20 + remove_pri_as: present + bfd: yes + address_family: + - type: ipv4 + state: present + state: present + - name: ebgp_pg + type: peergroup + bfd: yes + state: present + - name: ibgp_pg + type: peergroup + weight: 10 + state: present + - type: ipv4 + interface: vlan10 + send_community: + - type: extended + state: present + admin: up + state: present + - type: ipv4 + description: "U_site2 spine1" + remote_asn: 11 + ip: 192.168.10.1 + name: peer1 + peergroup: peer1 + peergroup_state: present + peergroup_type: ibgp + adv_interval: 40 + fall_over: present + route_reflector_client: true + src_loopback: 0 + address_family: + - type: ipv4 + activate: false + distribute_list: + in: dd + in_state: present + out: dd + out_state: present + state: present + send_community: + - type: standard + state: present + state: present + - type: ipv4 + remote_asn: 13 + local_as: 10 + weight: 10 + ip: 192.168.12.3 + address_family: + - type: ipv4 + activate: false + allow_as_in: 5 + next_hop_self: true + soft_reconf: true + add_path: both 3 + default_originate: + route_map: aa + state: present + route_map: + - name: qq + filter: in + state: present + state: present + state: present + - type: ipv6 + remote_asn: 14 + ip: 2001:4898:5808:ffa2::1 + state: present + - type: ipv6 + description: "U_site2-spine1-Auto Discovered peers" + auto_peer: unnumbered-auto + ebgp_peergroup: ebgp_pg + ebgp_peergroup_state: present + ibgp_peergroup: ibgp_pg + ibgp_peergroup_state: present + address_family: + - type: ipv4 + activate: false + sender_loop_detect: false + state: present + allow_as_in: 5 + next_hop_self: true + soft_reconf: true + default_originate: + route_map: dd + state: present + send_community: + - type: standard + state: present + admin: up + state: present + redistribute: + - route_type: static + route_map_name: aa + address_type: ipv4 + state: present + - route_type: connected + route_map_name: bb + address_type: ipv4 + state: present + - route_type: l2vpn + route_map_name: cc + address_type: ipv4 + state: present + - route_type: imported_bgp + imported_bgp_vrf_name: test2 + route_map_name: dd + address_type: ipv4 + state: present + - route_type: ospf + ospf_id: 12 + address_type: ipv4 + state: present + bfd_all_neighbors: + interval: 200 + min_rx: 200 + multiplier: 3 + role: active + state: present + as_notation: asdot + state: present + - name: "test2" + router_id: 80.1.1.4 + maxpath_ibgp: 2 + maxpath_ebgp: 2 + as_notation: asdot + state: present + state: present diff --git a/ansible_collections/dellemc/os10/roles/os10_bgp/tests/test.yaml b/ansible_collections/dellemc/os10/roles/os10_bgp/tests/test.yaml new file mode 100644 index 00000000..fd5211f4 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_bgp/tests/test.yaml @@ -0,0 +1,5 @@ +--- +- hosts: datacenter + connection: network_cli + roles: + - dellemc.os10.os10_bgp diff --git a/ansible_collections/dellemc/os10/roles/os10_bgp/vars/main.yml b/ansible_collections/dellemc/os10/roles/os10_bgp/vars/main.yml new file mode 100644 index 00000000..de9999bd --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_bgp/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for dellemc.os10.os10_bgp diff --git a/ansible_collections/dellemc/os10/roles/os10_copy_config/LICENSE b/ansible_collections/dellemc/os10/roles/os10_copy_config/LICENSE new file mode 100644 index 00000000..2c9b8e1f --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_copy_config/LICENSE @@ -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) 2020, Dell Inc. All rights reserved. + + 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) 2020, Dell Inc. All rights reserved. + 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>. diff --git a/ansible_collections/dellemc/os10/roles/os10_copy_config/README.md b/ansible_collections/dellemc/os10/roles/os10_copy_config/README.md new file mode 100644 index 00000000..eadefecb --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_copy_config/README.md @@ -0,0 +1,131 @@ +Copy-config role +================ + +This role is used to push the backup running configuration into a Dell EMC PowerSwitch platform running Dell EMC SmartFabric OS10, and merges the configuration in the template file with the running configuration of the device. + +The copy-config role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. + +Role variables +-------------- + +- No predefined variables are part of this role +- Use *host_vars* or *group_vars* as part of the template file +- Configuration file is host-specific +- Copy the host-specific configuration to the respective file under the template directory in *<host_name>.j2* format +- Variables and values are case-sensitive + +Connection variables +-------------------- + +Ansible Dell EMC network roles require connection information to establish communication with the nodes in your inventory. This information can exist in the Ansible *group_vars* or *host_vars* directories, or in the playbook itself. + +| Key | Required | Choices | Description | +|-------------|----------|------------|-----------------------------------------------------| +| ``ansible_host`` | yes | | Specifies the hostname or address for connecting to the remote device over the specified transport | +| ``ansible_port`` | no | | Specifies the port used to build the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_PORT` option is used; it defaults to 22 | +| ``ansible_ssh_user`` | no | | Specifies the username that authenticates the CLI login for the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_USER` environment variable value is used | +| ``ansible_ssh_pass`` | no | | Specifies the password that authenticates the connection to the remote device | +| ``ansible_become`` | no | yes, no\* | Instructs the module to enter privileged mode on the remote device before sending any commands; if value is unspecified, the `ANSIBLE_BECOME` environment variable value is used, and the device attempts to execute all commands in non-privileged mode | +| ``ansible_become_method`` | no | enable, sudo\* | Instructs the module to allow the become method to be specified for handling privilege escalation; if value is unspecified, the `ANSIBLE_BECOME_METHOD` environment variable value is used | +| ``ansible_become_pass`` | no | | Specifies the password to use if required to enter privileged mode on the remote device; if ``ansible_become`` is set to no this key is not applicable | +| ``ansible_network_os`` | yes | os10, null\* | Loads the correct terminal and cliconf plugins to communicate with the remote device | + +> **NOTE**: Asterisk (\*) denotes the default value if none is specified. + + +Example playbook +---------------- + +This example uses the *os10_copy_config* role to push the configuration file into the device. It creates a *hosts* file with the switch details and corresponding variables. It writes a simple playbook that only references the *os10_copy_config* role. By including the role, you automatically get access to all of the tasks to push configuration file. + +**Sample hosts file** + + leaf1 ansible_host= <ip_address> + +**Sample host_vars/leaf1** + + hostname: leaf1 + ansible_become: yes + ansible_become_method: xxxxx + ansible_become_pass: xxxxx + ansible_ssh_user: xxxxx + ansible_ssh_pass: xxxxx + ansible_network_os: dellemc.os10.os10 + + # This variable shall be applied in the below jinja template for each host by defining here + os10_bgp + asn: 64801 + +**Sample roles/os10_copy_config/templates/leaf1.j2** + + ! Leaf1 BGP profile on Dell OS10 switch + snmp-server community public ro + hash-algorithm ecmp crc + ! + interface ethernet1/1/1:1 + no switchport + ip address 100.1.1.2/24 + ipv6 address 2001:100:1:1::2/64 + mtu 9216 + no shutdown + ! + interface ethernet1/1/9:1 + no switchport + ip address 100.2.1.2/24 + ipv6 address 2001:100:2:1::2/64 + mtu 9216 + no shutdown + ! + router bgp {{ os10_bgp.asn }} + bestpath as-path multipath-relax + bestpath med missing-as-worst + router-id 100.0.2.1 + ! + address-family ipv4 unicast + ! + address-family ipv6 unicast + ! + neighbor 100.1.1.1 + remote-as 64901 + no shutdown + ! + neighbor 100.2.1.1 + remote-as 64901 + no shutdown + ! + neighbor 2001:100:1:1::1 + remote-as 64901 + no shutdown + ! + address-family ipv4 unicast + no activate + exit + ! + address-family ipv6 unicast + activate + exit + ! + neighbor 2001:100:2:1::1 + remote-as 64901 + no shutdown + ! + address-family ipv4 unicast + no activate + exit + ! + address-family ipv6 unicast + activate + exit + ! + +**Simple playbook to setup to push configuration file into device — leaf.yaml** + + - hosts: leaf1 + roles: + - dellemc.os10.os10_copy_config + +**Run** + + ansible-playbook -i hosts leaf.yaml + +(c) 2017-2020 Dell Inc. or its subsidiaries. All rights reserved.
\ No newline at end of file diff --git a/ansible_collections/dellemc/os10/roles/os10_copy_config/defaults/main.yml b/ansible_collections/dellemc/os10/roles/os10_copy_config/defaults/main.yml new file mode 100644 index 00000000..de0edc0c --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_copy_config/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for dellemc.os10.os10_copy_config diff --git a/ansible_collections/dellemc/os10/roles/os10_copy_config/handlers/main.yml b/ansible_collections/dellemc/os10/roles/os10_copy_config/handlers/main.yml new file mode 100644 index 00000000..e11a8805 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_copy_config/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for dellemc.os10.os10_copy_config diff --git a/ansible_collections/dellemc/os10/roles/os10_copy_config/meta/main.yml b/ansible_collections/dellemc/os10/roles/os10_copy_config/meta/main.yml new file mode 100644 index 00000000..16658939 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_copy_config/meta/main.yml @@ -0,0 +1,19 @@ +# Copyright (c) 2020 Dell Inc. +--- +galaxy_info: + author: Dell EMC Networking Engineering + description: > + This role shall be used to push the backup running configuration into the device. + This role shall merge the configuration in the template file with the running configuration of the device + license: GPLv3 + min_ansible_version: 2.9.6 + + platforms: + - name: os10 + + galaxy_tags: + - networking + - dell + - emc + - dellemc + - os10 diff --git a/ansible_collections/dellemc/os10/roles/os10_copy_config/tasks/main.yml b/ansible_collections/dellemc/os10/roles/os10_copy_config/tasks/main.yml new file mode 100644 index 00000000..dd62a63f --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_copy_config/tasks/main.yml @@ -0,0 +1,7 @@ +--- +# tasks file for dellemc.os10.os10_copy_config + - name: "Merge the config file to running configuration for OS10" + os10_config: + src: "{{ hostname }}.j2" + when: (ansible_network_os is defined and ansible_network_os== "dellemc.os10.os10") +# notify: save config os10 diff --git a/ansible_collections/dellemc/os10/roles/os10_copy_config/templates/leaf1.j2 b/ansible_collections/dellemc/os10/roles/os10_copy_config/templates/leaf1.j2 new file mode 100644 index 00000000..b02686f5 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_copy_config/templates/leaf1.j2 @@ -0,0 +1,3 @@ +! Version 10.3.0E +! Last configuration change at March 09 21:47:35 2020 +! diff --git a/ansible_collections/dellemc/os10/roles/os10_copy_config/tests/inventory b/ansible_collections/dellemc/os10/roles/os10_copy_config/tests/inventory new file mode 100644 index 00000000..85a255f9 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_copy_config/tests/inventory @@ -0,0 +1,2 @@ +--- +localhost diff --git a/ansible_collections/dellemc/os10/roles/os10_copy_config/tests/main.yml b/ansible_collections/dellemc/os10/roles/os10_copy_config/tests/main.yml new file mode 100644 index 00000000..ed97d539 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_copy_config/tests/main.yml @@ -0,0 +1 @@ +--- diff --git a/ansible_collections/dellemc/os10/roles/os10_copy_config/tests/test.yml b/ansible_collections/dellemc/os10/roles/os10_copy_config/tests/test.yml new file mode 100644 index 00000000..6c7b8039 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_copy_config/tests/test.yml @@ -0,0 +1,5 @@ +--- +- hosts: localhost + connection: network_cli + roles: + - dellemc.os10.os10_copy_config diff --git a/ansible_collections/dellemc/os10/roles/os10_copy_config/vars/main.yml b/ansible_collections/dellemc/os10/roles/os10_copy_config/vars/main.yml new file mode 100644 index 00000000..9f021ecf --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_copy_config/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for dellemc.os10.os10_copy_config diff --git a/ansible_collections/dellemc/os10/roles/os10_dns/LICENSE b/ansible_collections/dellemc/os10/roles/os10_dns/LICENSE new file mode 100644 index 00000000..2c9b8e1f --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_dns/LICENSE @@ -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) 2020, Dell Inc. All rights reserved. + + 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) 2020, Dell Inc. All rights reserved. + 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>. diff --git a/ansible_collections/dellemc/os10/roles/os10_dns/README.md b/ansible_collections/dellemc/os10/roles/os10_dns/README.md new file mode 100644 index 00000000..b65d7622 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_dns/README.md @@ -0,0 +1,125 @@ +DNS role +======== + +This role facilitates the configuration of the domain name service (DNS). This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. + +The DNS role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. + +Role variables +-------------- + +- Role is abstracted using the `ansible_network_os` variable that can take `dellemc.os10.os10` as the value +- If `os10_cfg_generate` set to true, the variable generates the role configuration commands in a file +- Any role variable with a corresponding state variable set to absent negates the configuration of that variable +- Setting an empty value for any variable negates the corresponding configuration +- Variables and values are case-sensitive + +**os10_dns keys** + +| Key | Type | Description | Support | +|------------|---------------------------|---------------------------------------------------------|-----------------------| +| ``name_server`` | list | Configures DNS (see ``name_server.*``) | os10 | +| ``name_server.ip`` | list | Configures the name server IP | os10 | +| ``name_server.vrf`` | list | Configures VRF for each IP | os10 | +| ``name_server.state`` | string: absent,present\* | Deletes the name server IP if set to absent | os10 | +| ``domain_list`` | list | Configures domain-list (see ``domain_list.*``) | os10 | +| ``domain_list.name`` | list | Configures the domain-list name | os10 | +| ``domain_list.vrf`` | list | Configures VRF for each domain-list name | os10 | +| ``domain_list.state`` | string: absent,present\* | Deletes the domain-list if set to absent | os10 | + + +> **NOTE**: Asterisk (\*) denotes the default value if none is specified. + +Connection variables +-------------------- + +Ansible Dell EMC network roles require connection information to establish communication with the nodes in your inventory. This information can exist in the Ansible *group_vars* or *host_vars* directories or inventory, or in the playbook itself. + +| Key | Required | Choices | Description | +|-------------|----------|------------|-----------------------------------------------------| +| ``ansible_host`` | yes | | Specifies the hostname or address for connecting to the remote device over the specified transport | +| ``ansible_port`` | no | | Specifies the port used to build the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_PORT` option is used; it defaults to 22 | +| ``ansible_ssh_user`` | no | | Specifies the username that authenticates the CLI login for the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_USER` environment variable value is used | +| ``ansible_ssh_pass`` | no | | Specifies the password that authenticates the connection to the remote device | +| ``ansible_become`` | no | yes, no\* | Instructs the module to enter privileged mode on the remote device before sending any commands; if value is unspecified, the `ANSIBLE_BECOME` environment variable value is used, and the device attempts to execute all commands in non-privileged mode | +| ``ansible_become_method`` | no | enable, sudo\* | Instructs the module to allow the become method to be specified for handling privilege escalation; if value is unspecified, the `ANSIBLE_BECOME_METHOD` environment variable value is used | +| ``ansible_become_pass`` | no | | Specifies the password to use if required to enter privileged mode on the remote device; if ``ansible_become`` is set to no this key is not applicable | +| ``ansible_network_os`` | yes | os10, null\* | Loads the correct terminal and cliconf plugins to communicate with the remote device | + +> **NOTE**: Asterisk (\*) denotes the default value if none is specified. + + +Example playbook +---------------- + +This example uses the *os10_dns* role to completely set up the DNS server configuration. The example creates a *hosts* file with the switch details and corresponding variables. The hosts file should define the `ansible_network_os` variable with corresponding Dell EMC OS10 name. + +When `os10_cfg_generate` is set to true, generates the configuration commands as a .part file in *build_dir* path. By default it is set to false. It writes a simple playbook that only references the *os10_dns* role. By including the role, you automatically get access to all of the tasks to configure DNS. + +**Sample hosts file** + + leaf1 ansible_host= <ip_address> + +**Sample host_vars/leaf1** + + hostname: leaf1 + ansible_become: yes + ansible_become_method: xxxxx + ansible_become_pass: xxxxx + ansible_ssh_user: xxxxx + ansible_ssh_pass: xxxxx + ansible_network_os: dellemc.os10.os10 + build_dir: ../temp/temp_os10 + os10_dns: + domain_lookup: true + name_server: + - ip: + - 3.1.1.1 + - 3.1.1.2 + vrf: + - test + - test1 + - ip: + - 3.1.1.2 + vrf: + - test1 + state: absent + - ip: + - 2.2.2.2 + - ip: + - 3.3.2.2 + state: absent + domain_list: + - name: + - dname7 + - dname8 + vrf: + - test + - test1 + - name: + - dname7 + vrf: + - test + - test1 + state: absent + - name: + - dname3 + - dname4 + - name: + - dname5 + - dname6 + state: absent + +> **NOTE**: vrf should be present which can be configured using os10_vrf role + +**Simple playbook to setup DNS — leaf.yaml** + + - hosts: leaf1 + roles: + - dellemc.os10.os10_dns + +**Run** + + ansible-playbook -i hosts leaf.yaml + +(c) 2017-2020 Dell Inc. or its subsidiaries. All rights reserved.
\ No newline at end of file diff --git a/ansible_collections/dellemc/os10/roles/os10_dns/defaults/main.yml b/ansible_collections/dellemc/os10/roles/os10_dns/defaults/main.yml new file mode 100644 index 00000000..d826575e --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_dns/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for dellemc.os10.os10_dns diff --git a/ansible_collections/dellemc/os10/roles/os10_dns/handlers/main.yml b/ansible_collections/dellemc/os10/roles/os10_dns/handlers/main.yml new file mode 100644 index 00000000..a6cd5e69 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_dns/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for dellemc.os10.os10_dns diff --git a/ansible_collections/dellemc/os10/roles/os10_dns/meta/main.yml b/ansible_collections/dellemc/os10/roles/os10_dns/meta/main.yml new file mode 100644 index 00000000..1f0baa16 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_dns/meta/main.yml @@ -0,0 +1,17 @@ +# Copyright (c) 2020 Dell Inc. +--- +galaxy_info: + author: Dell EMC Networking Engineering + description: The os10_dns role facilitates the configuration DNS attributes in devices running Dell EMC SmartFabric OS10. + license: GPLv3 + min_ansible_version: 2.9.6 + + platforms: + - name: os10 + + galaxy_tags: + - networking + - dell + - emc + - dellemc + - os10 diff --git a/ansible_collections/dellemc/os10/roles/os10_dns/tasks/main.yml b/ansible_collections/dellemc/os10/roles/os10_dns/tasks/main.yml new file mode 100644 index 00000000..417ebacf --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_dns/tasks/main.yml @@ -0,0 +1,17 @@ +--- +# tasks file for Dellos10 + + - name: "Generating DNS configuration for os10" + template: + src: os10_dns.j2 + dest: "{{ build_dir }}/dns10_{{ hostname }}.conf.part" + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") and ((os10_cfg_generate | default('False')) | bool) +# notify: save config os10 + register: generate_output + + - name: "Provisioning DNS configuration for os10" + os10_config: + src: os10_dns.j2 + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") +# notify: save config os10 + register: output diff --git a/ansible_collections/dellemc/os10/roles/os10_dns/templates/os10_dns.j2 b/ansible_collections/dellemc/os10/roles/os10_dns/templates/os10_dns.j2 new file mode 100644 index 00000000..f381b3d0 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_dns/templates/os10_dns.j2 @@ -0,0 +1,101 @@ +#jinja2: trim_blocks: True,lstrip_blocks: True +{#################################### +Purpose: +Configure DNS commands for OS10 devices +os10_dns: +os10_dns: + domain_lookup: true + name_server: + - ip: + - 3.1.1.1 + - 3.1.1.2 + vrf: + - test + - test1 + - ip: + - 3.1.1.2 + vrf: + - test1 + state: absent + - ip: + - 2.2.2.2 + - ip: + - 3.3.2.2 + state: absent + domain_list: + - name: + - dname7 + - dname8 + vrf: + - test + - test1 + - name: + - dname7 + vrf: + - test + - test1 + state: absent + - name: + - dname3 + - dname4 + - name: + - dname5 + - dname6 + state: absent +#####################################} +{% if (os10_dns is defined and os10_dns) %} + {% if (os10_dns.name_server is defined and os10_dns.name_server) %} + {% for name_server in os10_dns.name_server %} + {% set absent = "" %} + {% if name_server.state is defined and name_server.state == "absent" %} + {% set absent = "no " %} + {% endif %} + + {% set vrf_name_list = name_server.vrf %} + {% if (vrf_name_list is defined and vrf_name_list ) %} + {% for vrf_name in vrf_name_list %} + {% set ip_list = name_server.ip %} + {% if (ip_list is defined and ip_list ) %} + {% for ip_val in ip_list %} + {{ absent }}ip name-server vrf {{ vrf_name }} {{ ip_val }} + {% endfor %} + {% elif name_server.state is defined and name_server.state == "absent"%} + {{ absent }}ip name-server vrf {{ vrf_name }} + {% endif %} + {% endfor %} + {% else %} + {% set ip_list = name_server.ip %} + {% if (ip_list is defined and ip_list ) %} + {{ absent }}ip name-server {{ ip_list|join(' ') }} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% if (os10_dns.domain_list is defined and os10_dns.domain_list) %} + {% for domain in os10_dns.domain_list %} + {% set absent = "" %} + {% if domain.state is defined and domain.state == "absent" %} + {% set absent = "no " %} + {% endif %} + + {% set vrf_name_list = domain.vrf %} + {% if (vrf_name_list is defined and vrf_name_list ) %} + {% for vrf_name in vrf_name_list %} + {% set name_list = domain.name %} + {% if (name_list is defined and name_list ) %} + {% for name_val in name_list %} + {{ absent }}ip domain-list vrf {{ vrf_name }} {{ name_val }} + {% endfor %} + {% elif domain.state is defined and domain.state == "absent"%} + {{ absent }}ip domain-list vrf {{ vrf_name }} + {% endif %} + {% endfor %} + {% else %} + {% set name_list = domain.name %} + {% if (name_list is defined and name_list ) %} + {{ absent }}ip domain-list {{ name_list|join(' ') }} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} +{% endif %} diff --git a/ansible_collections/dellemc/os10/roles/os10_dns/tests/inventory.yaml b/ansible_collections/dellemc/os10/roles/os10_dns/tests/inventory.yaml new file mode 100644 index 00000000..b1ff63e6 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_dns/tests/inventory.yaml @@ -0,0 +1,22 @@ +--- +spine1 ansible_host=10.11.182.25 ansible_network_os="dellemc.os10.os10" +spine2 ansible_host=10.16.151.220 ansible_network_os="dellemc.os10.os10" + +leaf1 ansible_host=10.11.182.23 ansible_network_os="dellemc.os10.os10" +leaf2 ansible_host=10.11.182.16 ansible_network_os="dellemc.os10.os10" +leaf3 ansible_host=10.11.182.17 ansible_network_os="dellemc.os10.os10" +leaf4 ansible_host=10.16.148.79 ansible_network_os="dellemc.os10.os10" + +[spine] +spine1 +spine2 + +[leaf] +leaf1 +leaf2 +leaf3 +leaf4 + +[datacenter:children] +spine +leaf diff --git a/ansible_collections/dellemc/os10/roles/os10_dns/tests/main.yaml b/ansible_collections/dellemc/os10/roles/os10_dns/tests/main.yaml new file mode 100644 index 00000000..6305318d --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_dns/tests/main.yaml @@ -0,0 +1,43 @@ +--- +# vars file for dellemc.os10.os10_dns, +# below gives a sample configuration +# Sample variables for OS10 device +os10_dns: + domain_lookup: true + name_server: + - ip: + - 3.1.1.1 + - 3.1.1.2 + vrf: + - test + - test1 + - ip: + - 3.1.1.2 + vrf: + - test1 + state: absent + - ip: + - 2.2.2.2 + - ip: + - 3.3.2.2 + state: absent + domain_list: + - name: + - dname7 + - dname8 + vrf: + - test + - test1 + - name: + - dname7 + vrf: + - test + - test1 + state: absent + - name: + - dname3 + - dname4 + - name: + - dname5 + - dname6 + state: absent diff --git a/ansible_collections/dellemc/os10/roles/os10_dns/tests/test.yaml b/ansible_collections/dellemc/os10/roles/os10_dns/tests/test.yaml new file mode 100644 index 00000000..ab6aaca5 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_dns/tests/test.yaml @@ -0,0 +1,5 @@ +--- +- hosts: datacenter + connection: network_cli + roles: + - dellemc.os10.os10_dns diff --git a/ansible_collections/dellemc/os10/roles/os10_dns/vars/main.yml b/ansible_collections/dellemc/os10/roles/os10_dns/vars/main.yml new file mode 100644 index 00000000..19959956 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_dns/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for dellemc.os10.os10_dns diff --git a/ansible_collections/dellemc/os10/roles/os10_ecmp/LICENSE b/ansible_collections/dellemc/os10/roles/os10_ecmp/LICENSE new file mode 100644 index 00000000..2c9b8e1f --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_ecmp/LICENSE @@ -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) 2020, Dell Inc. All rights reserved. + + 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) 2020, Dell Inc. All rights reserved. + 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>. diff --git a/ansible_collections/dellemc/os10/roles/os10_ecmp/README.md b/ansible_collections/dellemc/os10/roles/os10_ecmp/README.md new file mode 100644 index 00000000..6932fdf6 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_ecmp/README.md @@ -0,0 +1,78 @@ +ECMP role +========= + +This role facilitates the configuration of equal cost multi-path (ECMP), and it supports the configuration of ECMP for IPv4. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. + +The ECMP role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. + +Role variables +-------------- + +- Role is abstracted using the `ansible_network_os` variable that can take `dellemc.os10.os10` as the value +- If `os10_cfg_generate` is set to true, the variable generates the role configuration commands in a file +- Any role variable with a corresponding state variable set to absent negates the configuration of that variable +- Setting an empty value for any variable negates the corresponding configuration +- Variables and values are case-sensitive + +**os10_ecmp keys** + +| Key | Type | Description | Support | +|------------|---------------------------|---------------------------------------------------------|-----------------------| +| ``ecmp_group_max_paths`` | integer | Configures the number of maximum paths per ECMP group | os10 | +| ``trigger_threshold`` | integer | Configures the number of link bundle utilization trigger threshold | os10 | + +Connection variables +-------------------- + +Ansible Dell EMC network roles require connection information to establish communication with the nodes in your inventory. This information can exist in the Ansible *group_vars* or *host_vars* directories or inventory, or in the playbook itself. + +| Key | Required | Choices | Description | +|-------------|----------|------------|-----------------------------------------------------| +| ``ansible_host`` | yes | | Specifies the hostname or address for connecting to the remote device over the specified transport | +| ``ansible_port`` | no | | Specifies the port used to build the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_PORT` option is used; it defaults to 22 | +| ``ansible_ssh_user`` | no | | Specifies the username that authenticates the CLI login for the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_USER` environment variable value is used | +| ``ansible_ssh_pass`` | no | | Specifies the password that authenticates the connection to the remote device | +| ``ansible_become`` | no | yes, no\* | Instructs the module to enter privileged mode on the remote device before sending any commands; if value is unspecified, the `ANSIBLE_BECOME` environment variable value is used, and the device attempts to execute all commands in non-privileged mode | +| ``ansible_become_method`` | no | enable, sudo\* | Instructs the module to allow the become method to be specified for handling privilege escalation; if value is unspecified, the `ANSIBLE_BECOME_METHOD` environment variable value is used | +| ``ansible_become_pass`` | no | | Specifies the password to use if required to enter privileged mode on the remote device; if ``ansible_become`` is set to no this key is not applicable | +| ``ansible_network_os`` | yes | os10, null\* | Loads the correct terminal and cliconf plugins to communicate with the remote device | + +> **NOTE**: Asterisk (\*) denotes the default value if none is specified. + + +Example playbook +---------------- + +This example uses the *os10_ecmp* role to configure ECMP for IPv4. The example creates a *hosts* file with the switch details and corresponding variables. The hosts file should define the `ansible_network_os` variable with the corresponding Dell EMC OS10 name. + +When `os10_cfg_generate` is set to true, the variable generates the configuration commands as a .part file in *build_dir* path. By default, the variable is set to false. The example writes a simple playbook that only references the *os10_ecmp* role. + +**Sample hosts file** + + leaf1 ansible_host= <ip_address> + +**Sample host_vars/leaf1** + + hostname: leaf1 + ansible_become: yes + ansible_become_method: xxxxx + ansible_become_pass: xxxxx + ansible_ssh_user: xxxxx + ansible_ssh_pass: xxxxx + ansible_network_os: dellemc.os10.os10 + build_dir: ../temp/temp_os10 + os10_ecmp: + ecmp_group_max_paths: 3 + trigger_threshold: 50 + +**Simple playbook to setup system — leaf.yaml** + + - hosts: leaf1 + roles: + - dellemc.os10.os10_ecmp + +**Run** + + ansible-playbook -i hosts leaf.yaml + +(c) 2017-2020 Dell Inc. or its subsidiaries. All rights reserved.
\ No newline at end of file diff --git a/ansible_collections/dellemc/os10/roles/os10_ecmp/defaults/main.yml b/ansible_collections/dellemc/os10/roles/os10_ecmp/defaults/main.yml new file mode 100644 index 00000000..406d1cfc --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_ecmp/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for dellemc.os10.os10_ecmp diff --git a/ansible_collections/dellemc/os10/roles/os10_ecmp/handlers/main.yml b/ansible_collections/dellemc/os10/roles/os10_ecmp/handlers/main.yml new file mode 100644 index 00000000..24ccf4de --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_ecmp/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for dellemc.os10.os10_ecmp diff --git a/ansible_collections/dellemc/os10/roles/os10_ecmp/meta/main.yml b/ansible_collections/dellemc/os10/roles/os10_ecmp/meta/main.yml new file mode 100644 index 00000000..f6448d4c --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_ecmp/meta/main.yml @@ -0,0 +1,17 @@ +# Copyright (c) 2020 Dell Inc. +--- +galaxy_info: + author: Dell EMC Networking Engineering + description: The os10_ecmp role facilitates the configuration of ECMP group attributes in devices running Dell EMC SmartFabric OS10. + license: GPLv3 + min_ansible_version: 2.9.6 + + platforms: + - name: os10 + + galaxy_tags: + - networking + - dell + - emc + - dellemc + - os10 diff --git a/ansible_collections/dellemc/os10/roles/os10_ecmp/tasks/main.yml b/ansible_collections/dellemc/os10/roles/os10_ecmp/tasks/main.yml new file mode 100644 index 00000000..012d4119 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_ecmp/tasks/main.yml @@ -0,0 +1,17 @@ +--- +# tasks file for os10 + + - name: "Generating ECMP configuration for os10" + template: + src: os10_ecmp.j2 + dest: "{{ build_dir }}/ecmp10_{{ hostname }}.conf.part" + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") and ((os10_cfg_generate | default('False')) | bool) +# notify: save config os10 + register: generate_output + + - name: "Provisioning ECMP configuration for os10" + os10_config: + src: os10_ecmp.j2 + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") +# notify: save config os10 + register: output diff --git a/ansible_collections/dellemc/os10/roles/os10_ecmp/templates/os10_ecmp.j2 b/ansible_collections/dellemc/os10/roles/os10_ecmp/templates/os10_ecmp.j2 new file mode 100644 index 00000000..6a0b04dd --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_ecmp/templates/os10_ecmp.j2 @@ -0,0 +1,25 @@ +#jinja2: trim_blocks: True,lstrip_blocks: True +{#################################### +Purpose: +Configure ECMP commands for OS10 devices +os10_ecmp: + ecmp_group_max_paths: 3 + trigger_threshold: 50 +#####################################} +{% if os10_ecmp is defined and os10_ecmp %} + {% if os10_ecmp.ecmp_group_max_paths is defined %} + {% if os10_ecmp.ecmp_group_max_paths %} +ip ecmp-group maximum-paths {{ os10_ecmp.ecmp_group_max_paths }} + {% else %} +no ip ecmp-group maximum-paths + {% endif %} + {% endif %} + {% if os10_ecmp.trigger_threshold is defined %} + {% if os10_ecmp.trigger_threshold %} +link-bundle-utilization trigger-threshold {{ os10_ecmp.trigger_threshold }} + {% else %} +no link-bundle-utilization trigger-threshold + {% endif %} + {% endif %} + +{% endif %} diff --git a/ansible_collections/dellemc/os10/roles/os10_ecmp/tests/inventory.yaml b/ansible_collections/dellemc/os10/roles/os10_ecmp/tests/inventory.yaml new file mode 100644 index 00000000..b1ff63e6 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_ecmp/tests/inventory.yaml @@ -0,0 +1,22 @@ +--- +spine1 ansible_host=10.11.182.25 ansible_network_os="dellemc.os10.os10" +spine2 ansible_host=10.16.151.220 ansible_network_os="dellemc.os10.os10" + +leaf1 ansible_host=10.11.182.23 ansible_network_os="dellemc.os10.os10" +leaf2 ansible_host=10.11.182.16 ansible_network_os="dellemc.os10.os10" +leaf3 ansible_host=10.11.182.17 ansible_network_os="dellemc.os10.os10" +leaf4 ansible_host=10.16.148.79 ansible_network_os="dellemc.os10.os10" + +[spine] +spine1 +spine2 + +[leaf] +leaf1 +leaf2 +leaf3 +leaf4 + +[datacenter:children] +spine +leaf diff --git a/ansible_collections/dellemc/os10/roles/os10_ecmp/tests/main.os10.yaml b/ansible_collections/dellemc/os10/roles/os10_ecmp/tests/main.os10.yaml new file mode 100644 index 00000000..ff00dfd4 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_ecmp/tests/main.os10.yaml @@ -0,0 +1,7 @@ +--- +# vars file for dellemc.os10.os10_ecmp, +# below gives a sample configuration +# Sample variables for OS10 device +os10_ecmp: + ecmp_group_max_paths: 3 + trigger_threshold: 50 diff --git a/ansible_collections/dellemc/os10/roles/os10_ecmp/tests/test.yaml b/ansible_collections/dellemc/os10/roles/os10_ecmp/tests/test.yaml new file mode 100644 index 00000000..2df95ee6 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_ecmp/tests/test.yaml @@ -0,0 +1,5 @@ +--- +- hosts: datacenter + connection: network_cli + roles: + - dellemc.os10.os10_ecmp diff --git a/ansible_collections/dellemc/os10/roles/os10_ecmp/vars/main.yml b/ansible_collections/dellemc/os10/roles/os10_ecmp/vars/main.yml new file mode 100644 index 00000000..cfd6a141 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_ecmp/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for dellemc.os10.os10_ecmp diff --git a/ansible_collections/dellemc/os10/roles/os10_fabric_summary/LICENSE b/ansible_collections/dellemc/os10/roles/os10_fabric_summary/LICENSE new file mode 100644 index 00000000..2c9b8e1f --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_fabric_summary/LICENSE @@ -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) 2020, Dell Inc. All rights reserved. + + 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) 2020, Dell Inc. All rights reserved. + 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>. diff --git a/ansible_collections/dellemc/os10/roles/os10_fabric_summary/README.md b/ansible_collections/dellemc/os10/roles/os10_fabric_summary/README.md new file mode 100644 index 00000000..0ff99bf2 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_fabric_summary/README.md @@ -0,0 +1,119 @@ +os10_fabric_summary +===================================== +This role is used to get show system information of all devices in the fabric. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. + +The Fabric summary role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. + +Connection variables +-------------------- + +Ansible Dell EMC network roles require connection information to establish communication with the nodes in your inventory. This information can exist in the Ansible *group_vars* or *host_vars* directories or inventory, or in the playbook itself. + +| Key | Required | Choices | Description | +|-------------|----------|------------|-----------------------------------------------------| +| ``ansible_host`` | yes | | Specifies the hostname or address for connecting to the remote device over the specified transport | +| ``ansible_port`` | no | | Specifies the port used to build the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_PORT` option is used; it defaults to 22 | +| ``os10_cli_user`` | no | | Specifies the username that authenticates the CLI login for the connection to the remote device; if value is unspecified, the default value is used | +| ``os10_cli_pass`` | no | | Specifies the password that authenticates the connection to the remote device | +| ``ansible_become`` | no | yes, no\* | Instructs the module to enter privileged mode on the remote device before sending any commands; if value is unspecified, the `ANSIBLE_BECOME` environment variable value is used, and the device attempts to execute all commands in non-privileged mode | +| ``ansible_become_method`` | no | enable, sudo\* | Instructs the module to allow the become method to be specified for handling privilege escalation; if value is unspecified, the `ANSIBLE_BECOME_METHOD` environment variable value is used | +| ``ansible_become_pass`` | no | | Specifies the password to use if required to enter privileged mode on the remote device; if ``ansible_become`` is set to no this key is not applicable | +| ``ansible_network_os`` | yes | os10, null\* | Loads the correct terminal and cliconf plugins to communicate with the remote device | + +> **NOTE**: Asterisk (*) denotes the default value if none is specified. + +Dependencies +------------ + +- *xmltodict* library should be installed to get show command output in dict format from XML +- To install the package use the *pip install xmltodict* command + +Example playbook +---------------- + +This example uses the *os10_fabric_summary* role to completely get the show attributes. It creates a *hosts* file with the switch details and corresponding variables. The hosts file should define the ansible_network_os variable with the corresponding Dell EMC OS10 name. + +The *os10_fabric_summary* role has a simple playbook that only references the *os10_fabric_summary* role. + +**Sample hosts file** + + site1-spine1 ansible_host=10.11.180.21 os10_cli_user=admin os10_cli_pass=admin ansible_network_os=dellemc.os10.os10 + site1-spine2 ansible_host=10.11.180.22 os10_cli_user=admin os10_cli_pass=admin ansible_network_os=dellemc.os10.os10 + site2-spine1 ansible_host=10.11.180.23 os10_cli_user=admin os10_cli_pass=admin ansible_network_os=dellemc.os10.os10 + site2-spine2 ansible_host=10.11.180.24 os10_cli_user=admin os10_cli_pass=admin ansible_network_os=dellemc.os10.os10 + [spine] + site1-spine1 + site1-spine2 + site2-spine1 + site2-spine2 + [LeafAndSpineSwitch:children] + spine + +**Sample host_vars/site1-spine1** + + + cli: + host: "{{ ansible_host }}" + username: "{{ os10_cli_user | default('admin') }}" + password: "{{ os10_cli_pass | default('admin') }}" + timeout: 300 + os10_cli_user: xxxx + os10_cli_pass: xxxx + ansible_network_os: dellemc.os10.os10 + +**Simple playbook to setup fabric summary — provision.yaml** + + --- + - name: show system summary command + hosts: localhost + gather_facts: False + connection: local + roles: + - os10_fabric_summary + +**Run** + + ansible-playbook -i hosts provision.yaml + +**Samaple Output** + + "results": [ + { + "device type": "S6010-ON", + "host": "10.11.180.21", + "hostname": "host3", + "inv_name": "site1-spine1", + "node-mac": "e4:f0:04:9b:e5:dc", + "service-tag": "D33FXC2", + "software-version": "10.4.9999EX" + }, + { + "device type": "S6010-ON", + "host": "10.11.180.22", + "hostname": "host22", + "inv_name": "site1-spine2", + "node-mac": "e4:f0:04:9b:eb:dc", + "service-tag": "J33FXC2", + "software-version": "10.4.9999EX" + }, + { + "device type": "S6010-ON", + "host": "10.11.180.24", + "hostname": "site2-spine1", + "inv_name": "site2-spine1", + "node-mac": "e4:f0:04:9b:ee:dc", + "service-tag": "343FXC2", + "software-version": "10.4.9999EX" + }, + { + "device type": "S6010-ON", + "host": "10.11.180.23", + "hostname": "site2-spine2", + "inv_name": "site2-spine2", + "node-mac": "e4:f0:04:9b:f1:dc", + "service-tag": "543FXC2", + "software-version": "10.4.9999EX" + } + ] + +(c) 2017-2020 Dell Inc. or its subsidiaries. All rights reserved.
\ No newline at end of file diff --git a/ansible_collections/dellemc/os10/roles/os10_fabric_summary/meta/main.yml b/ansible_collections/dellemc/os10/roles/os10_fabric_summary/meta/main.yml new file mode 100644 index 00000000..428d79f6 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_fabric_summary/meta/main.yml @@ -0,0 +1,18 @@ +# Copyright (c) 2020 Dell Inc. or its subsidiaries. All Rights Reserved. +--- +galaxy_info: + role_name: os10_fabric_summary + author: Dell EMC Networking Engineering + description: This role provides the system network information of all the switches in the fabric Dell EMC SmartFabric OS10. + license: GPLv3 + min_ansible_version: 2.9.6 + + platforms: + - name: os10 + + galaxy_tags: + - networking + - dell + - emc + - dellemc + - os10 diff --git a/ansible_collections/dellemc/os10/roles/os10_fabric_summary/tasks/main.yml b/ansible_collections/dellemc/os10/roles/os10_fabric_summary/tasks/main.yml new file mode 100644 index 00000000..784d6642 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_fabric_summary/tasks/main.yml @@ -0,0 +1,20 @@ +--- +- name: "Get Dell EMC OS10 Show system summary" + os10_command: + commands: ['show system | display-xml'] + provider: "{{ hostvars[item].cli }}" + with_items: "{{ groups['all'] }}" + register: show_system +- name: "set fact to form database" + set_fact: + output: "{{ output|default([])+ [{'inv_name': item.item, 'host': item.invocation.module_args.provider.host, 'stdout_show_system': item.stdout}] }}" + loop: "{{ show_system.results }}" +- name: "debug the output of system summary DB" + debug: var=output +- name: "show system network call to lib " + show_system_network_summary: + cli_responses: "{{ output }}" + output_type: "{{ output_method if output_method is defined else 'json' }}" + register: show_system_network_summary +- name: "debug the output of system summary DB" + debug: var=show_system_network_summary diff --git a/ansible_collections/dellemc/os10/roles/os10_fabric_summary/tests/host_vars/site1-spine1 b/ansible_collections/dellemc/os10/roles/os10_fabric_summary/tests/host_vars/site1-spine1 new file mode 100644 index 00000000..36a99cdb --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_fabric_summary/tests/host_vars/site1-spine1 @@ -0,0 +1,12 @@ +--- +# Sample variables for OS10 device +cli: + host: "{{ ansible_host }}" + username: "{{ os10_cli_user | default('admin') }}" + password: "{{ os10_cli_pass | default('admin') }}" + timeout: 300 + +os10_cli_user: xxxx +os10_cli_pass: xxxx +ansible_network_os: dellemc.os10.os10 + diff --git a/ansible_collections/dellemc/os10/roles/os10_fabric_summary/tests/host_vars/site1-spine2 b/ansible_collections/dellemc/os10/roles/os10_fabric_summary/tests/host_vars/site1-spine2 new file mode 100644 index 00000000..36a99cdb --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_fabric_summary/tests/host_vars/site1-spine2 @@ -0,0 +1,12 @@ +--- +# Sample variables for OS10 device +cli: + host: "{{ ansible_host }}" + username: "{{ os10_cli_user | default('admin') }}" + password: "{{ os10_cli_pass | default('admin') }}" + timeout: 300 + +os10_cli_user: xxxx +os10_cli_pass: xxxx +ansible_network_os: dellemc.os10.os10 + diff --git a/ansible_collections/dellemc/os10/roles/os10_fabric_summary/tests/host_vars/site2-spine1 b/ansible_collections/dellemc/os10/roles/os10_fabric_summary/tests/host_vars/site2-spine1 new file mode 100644 index 00000000..36a99cdb --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_fabric_summary/tests/host_vars/site2-spine1 @@ -0,0 +1,12 @@ +--- +# Sample variables for OS10 device +cli: + host: "{{ ansible_host }}" + username: "{{ os10_cli_user | default('admin') }}" + password: "{{ os10_cli_pass | default('admin') }}" + timeout: 300 + +os10_cli_user: xxxx +os10_cli_pass: xxxx +ansible_network_os: dellemc.os10.os10 + diff --git a/ansible_collections/dellemc/os10/roles/os10_fabric_summary/tests/host_vars/site2-spine2 b/ansible_collections/dellemc/os10/roles/os10_fabric_summary/tests/host_vars/site2-spine2 new file mode 100644 index 00000000..36a99cdb --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_fabric_summary/tests/host_vars/site2-spine2 @@ -0,0 +1,12 @@ +--- +# Sample variables for OS10 device +cli: + host: "{{ ansible_host }}" + username: "{{ os10_cli_user | default('admin') }}" + password: "{{ os10_cli_pass | default('admin') }}" + timeout: 300 + +os10_cli_user: xxxx +os10_cli_pass: xxxx +ansible_network_os: dellemc.os10.os10 + diff --git a/ansible_collections/dellemc/os10/roles/os10_fabric_summary/tests/inventory.yaml b/ansible_collections/dellemc/os10/roles/os10_fabric_summary/tests/inventory.yaml new file mode 100644 index 00000000..ff511df5 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_fabric_summary/tests/inventory.yaml @@ -0,0 +1,14 @@ +--- +site1-spine1 ansible_host=10.11.180.21 os10_cli_user=admin os10_cli_pass=admin ansible_network_os=dellemc.os10.os10 +site1-spine2 ansible_host=10.11.180.22 os10_cli_user=admin os10_cli_pass=admin ansible_network_os=dellemc.os10.os10 +site2-spine1 ansible_host=10.11.180.23 os10_cli_user=admin os10_cli_pass=admin ansible_network_os=dellemc.os10.os10 +site2-spine2 ansible_host=10.11.180.24 os10_cli_user=admin os10_cli_pass=admin ansible_network_os=dellemc.os10.os10 + +[spine] +site1-spine1 +site1-spine2 +site2-spine1 +site2-spine2 + +[LeafAndSpineSwitch:children] +spine diff --git a/ansible_collections/dellemc/os10/roles/os10_fabric_summary/tests/main.yaml b/ansible_collections/dellemc/os10/roles/os10_fabric_summary/tests/main.yaml new file mode 100644 index 00000000..1f450079 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_fabric_summary/tests/main.yaml @@ -0,0 +1,11 @@ +--- +# Sample variables for OS10 device +cli: + host: "{{ ansible_host }}" + username: "{{ os10_cli_user | default('admin') }}" + password: "{{ os10_cli_pass | default('admin') }}" + timeout: 300 + +os10_cli_user: xxxx +os10_cli_pass: xxxx +ansible_network_os: dellemc.os10.os10 diff --git a/ansible_collections/dellemc/os10/roles/os10_fabric_summary/tests/test.yml b/ansible_collections/dellemc/os10/roles/os10_fabric_summary/tests/test.yml new file mode 100644 index 00000000..e865c790 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_fabric_summary/tests/test.yml @@ -0,0 +1,7 @@ +--- +- name: setup for os10 fabric summary + hosts: localhost + gather_facts: False + connection: local + roles: + - dellemc.os10.os10_fabric_summary diff --git a/ansible_collections/dellemc/os10/roles/os10_flow_monitor/LICENSE b/ansible_collections/dellemc/os10/roles/os10_flow_monitor/LICENSE new file mode 100644 index 00000000..2c9b8e1f --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_flow_monitor/LICENSE @@ -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) 2020, Dell Inc. All rights reserved. + + 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) 2020, Dell Inc. All rights reserved. + 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>. diff --git a/ansible_collections/dellemc/os10/roles/os10_flow_monitor/README.md b/ansible_collections/dellemc/os10/roles/os10_flow_monitor/README.md new file mode 100644 index 00000000..dd98aa95 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_flow_monitor/README.md @@ -0,0 +1,152 @@ +ACL flow-based monitor role +=========================== + +This role facilitates configuring ACL flow-based monitoring attributes. Flow-based mirroring is a mirroring session in which traffic matches specified policies that are mirrored to a destination port. Port-based mirroring maintains a database that contains all monitoring sessions (including port monitor sessions). This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. + +The ACL flow-based role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. + +Role variables +-------------- + +- Role is abstracted using the `ansible_network_os` variable that can take the `dellemc.os10.os10` as the value +- If `os10_cfg_generate` is set to true, the variable generates the role configuration commands in a file +- Any role variable with a corresponding state variable set to absent negates the configuration of that variable +- Setting an empty value for any variable negates the corresponding configuration +- `os10_flow_monitor` (dictionary) with session ID key (in *session <ID>* format; 1 to 18) +- Variables and values are case-sensitive + +**session ID keys** + +| Key | Type | Description | Support | +|------------|---------------------------|---------------------------------------------------------|-----------------------| +| ``session_type`` | string: local_*_,rspan-source,erspan-source | Configures the monitoring session type | os10 | +| ``description`` | string | Configures the monitor session description | os10 | +| ``port_match`` | list | Displays a list of interfaces with location source and destination | os10 | +| ``port_match.interface_name`` | string | Configures the interface | os10 | +| ``port_match.location`` | string: source,destination | Configures the source/destination of an interface | os10 | +| ``port_match.state`` | string: absent,present\* | Deletes the interface if set to absent | os10 | +| ``flow_based`` | boolean | Enables flow-based monitoring | os10 | +| ``shutdown`` | string: up,down\* | Enable/disables the monitoring session | os10 | +| ``state`` | string: absent,present\* | Deletes the monitoring session corresponding to the session ID if set to absent | os10 | + +> **NOTE**: Asterisk (\*) denotes the default value if none is specified. + +Connection variables +-------------------- + +Ansible Dell EMC network roles require connection information to establish communication with the nodes in your inventory. This information can exist in the Ansible *group_vars* or *host_vars* directories or inventory or in the playbook itself. + +| Key | Required | Choices | Description | +|-------------|----------|------------|-----------------------------------------------------| +| ``ansible_host`` | yes | | Specifies the hostname or address for connecting to the remote device over the specified transport | +| ``ansible_port`` | no | | Specifies the port used to build the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_PORT` option is used; it defaults to 22 | +| ``ansible_ssh_user`` | no | | Specifies the username that authenticates the CLI login for the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_USER` environment variable value is used | +| ``ansible_ssh_pass`` | no | | Specifies the password that authenticates the connection to the remote device | +| ``ansible_become`` | no | yes, no\* | Instructs the module to enter privileged mode on the remote device before sending any commands; if value is unspecified, the `ANSIBLE_BECOME` environment variable value is used, and the device attempts to execute all commands in non-privileged mode | +| ``ansible_become_method`` | no | enable, sudo\* | Instructs the module to allow the become method to be specified for handling privilege escalation; if value is unspecified, the `ANSIBLE_BECOME_METHOD` environment variable value is used | +| ``ansible_become_pass`` | no | | Specifies the password to use if required to enter privileged mode on the remote device; if ``ansible_become`` is set to no this key is not applicable | +| ``ansible_network_os`` | yes | os10, null\* | Loads the correct terminal and cliconf plugins to communicate with the remote device | + +> **NOTE**: Asterisk (\*) denotes the default value if none is specified. + + +Example playbook +---------------- + +This example uses the *os10_flow_monitor* role to configure session monitor configuration. It creates a *hosts* file with the switch details and corresponding variables. The hosts file defines the `anisble_network_os` variable with corresponding Dell EMC OS10 name. + +When `os10_cfg_generate` is set to true, the variable generates the configuration commands as a .part file in the *build_dir* path. By default, the variable is set to false. +It writes a simple playbook that only references the *os10_flow_monitor* role. + +**Sample hosts file** + + leaf1 ansible_host= <ip_address> + +**Sample host_vars/leaf1** + + hostname: leaf1 + ansible_ssh_user: xxxxx + ansible_ssh_pass: xxxxx + ansible_network_os: dellemc.os10.os10 + build_dir: ../temp/os10 + os10_flow_monitor: + session 1: + session_type: local + description: "Discription goes here" + port_match: + - interface_name: ethernet 1/1/4 + location: source + state: present + - interface_name: ethernet 1/1/3 + location: destination + state: present + flow_based: true + shutdown: up + state: present + session 2: + session_type: local + description: "Discription of session goes here" + port_match: + - interface_name: ethernet 1/1/6 + location: source + state: present + - interface_name: ethernet 1/1/7 + location: destination + state: present + flow_based: true + shutdown: up + state: present + session 3: + state: absent + os10_acl: + - name: testflow + type: ipv4 + description: testflow description + extended: true + entries: + - number: 5 + permit: true + protocol: icmp + source: any + destination: any + other_options: capture session 1 count + state: present + - number: 10 + permit: true + protocol: ip + source: 102.1.1.0/24 + destination: any + other_option: capture session 1 count byte + state: present + - number: 15 + permit: false + protocol: udp + source: any + destination: any + other_options: capture session 2 count byte + state: present + - number: 20 + permit: false + protocol: tcp + source: any + destination: any + other_options: capture session 2 count byte + state: present + stage_ingress: + - name: ethernet 1/1/1 + state: present + +> **NOTE**: Destination port should not be an L2/L3 port which can be configured using the *os10_interface* role. + +**Simple playbook to setup system — leaf.yaml** + + - hosts: leaf1 + roles: + - dellemc.os10.os10_flow_monitor + - dellemc.os10.os10_acl + +**Run** + + ansible-playbook -i hosts leaf.yaml + +(c) 2017-2020 Dell Inc. or its subsidiaries. All rights reserved.
\ No newline at end of file diff --git a/ansible_collections/dellemc/os10/roles/os10_flow_monitor/defaults/main.yml b/ansible_collections/dellemc/os10/roles/os10_flow_monitor/defaults/main.yml new file mode 100644 index 00000000..3cc17642 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_flow_monitor/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for dellemc.os10.os10_flow_monitor diff --git a/ansible_collections/dellemc/os10/roles/os10_flow_monitor/handlers/main.yml b/ansible_collections/dellemc/os10/roles/os10_flow_monitor/handlers/main.yml new file mode 100644 index 00000000..91b1038e --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_flow_monitor/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for dellemc.os10.os10_flow_moitor diff --git a/ansible_collections/dellemc/os10/roles/os10_flow_monitor/meta/main.yml b/ansible_collections/dellemc/os10/roles/os10_flow_monitor/meta/main.yml new file mode 100644 index 00000000..c81fad54 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_flow_monitor/meta/main.yml @@ -0,0 +1,18 @@ +# Copyright (c) 2020 Dell Inc. +--- +galaxy_info: + author: Dell EMC Networking Engineering + description: The os10_flow_monitor role facilitates the configuration of ACL flow based monitor attributes in devices running Dell EMC SmartFabric OS10. + license: GPLv3 + min_ansible_version: 2.9.6 + + platforms: + - name: os10 + + galaxy_tags: + - networking + - dell + - emc + - os10 + - dellemc + - os10 diff --git a/ansible_collections/dellemc/os10/roles/os10_flow_monitor/tasks/main.yml b/ansible_collections/dellemc/os10/roles/os10_flow_monitor/tasks/main.yml new file mode 100644 index 00000000..b5bf0bc3 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_flow_monitor/tasks/main.yml @@ -0,0 +1,16 @@ +--- +# tasks file for Dellos10 + - name: "Generating Flow monitor configuration for os10" + template: + src: os10_flow_monitor.j2 + dest: "{{ build_dir }}/flow_monitor10_{{ hostname }}.conf.part" + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") and ((os10_cfg_generate | default('False')) | bool) +# notify: save config os10 + register: generate_output + + - name: "Provisioning Flow monitor configuration for os10" + os10_config: + src: os10_flow_monitor.j2 + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") +# notify: save config os10 + register: output diff --git a/ansible_collections/dellemc/os10/roles/os10_flow_monitor/templates/os10_flow_monitor.j2 b/ansible_collections/dellemc/os10/roles/os10_flow_monitor/templates/os10_flow_monitor.j2 new file mode 100644 index 00000000..535c6180 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_flow_monitor/templates/os10_flow_monitor.j2 @@ -0,0 +1,86 @@ +#jinja2: trim_blocks: True, lstrip_blocks: True +{########################################## +Purpose: +Configure Flow monitor commands for os10 Devices +os10_flow_monitor: + session 1: + session_type: local + description: "Discription goes here" + port_match: + - interface_name: ethernet 1/1/4 + location: source + state: present + - interface_name: ethernet 1/1/3 + location: destination + state: present + flow_based: true + shutdown: up + state: present + session 2: + session_type: local + description: "Discription of session goes here" + port_match: + - interface_name: ethernet 1/1/6 + location: source + state: present + - interface_name: ethernet 1/1/7 + location: destination + state: present + flow_based: false + shutdown: up + state: present + session 3: + state: absent +#########################################} +{% if os10_flow_monitor is defined and os10_flow_monitor %} +{% for key in os10_flow_monitor.keys() %} +{% set session_id = key.split(" ") %} +{% set session_vars = os10_flow_monitor[key] %} +{% set session_type = "" %} + +{% if session_vars.session_type is defined and session_vars.session_type != "local" %} +{% set session_type = "type " + session_vars.session_type %} +{% endif %} + + {% if session_vars.state is defined and session_vars.state == "absent" %} +no monitor session {{ session_id[1] }} + {% else %} +monitor session {{ session_id[1] }} {{ session_type }} + + {% if session_vars.description is defined and session_vars.description %} + description "{{ session_vars.description }}" + {% else %} + no description + {% endif %} + + {% if session_vars.port_match is defined and session_vars.port_match %} + {% for match_vars in session_vars.port_match %} + {% set negate = "" %} + {% if match_vars["state"] is defined and match_vars["state"] == "absent" %} + {% set negate = "no " %} + {% endif %} + {% set location = "source" %} + {% if match_vars["location"] is defined and match_vars["location"] == "destination" %} + {% set location = "destination" %} + {% endif %} + {{ negate }}{{ location }} interface {{ match_vars["interface_name"] }} + {% endfor %} + {% endif %} + + {% if session_vars.shutdown is defined and session_vars.shutdown == "up" %} + no shut + {% else %} + shut + {% endif %} + +{% if session_vars.flow_based is defined %} + {% if session_vars.flow_based %} + flow-based enable + {% else %} + no flow-based enable + {% endif %} +{% endif %} + +{% endif %} +{% endfor %} +{% endif %} diff --git a/ansible_collections/dellemc/os10/roles/os10_flow_monitor/tests/inventory.yaml b/ansible_collections/dellemc/os10/roles/os10_flow_monitor/tests/inventory.yaml new file mode 100644 index 00000000..b1ff63e6 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_flow_monitor/tests/inventory.yaml @@ -0,0 +1,22 @@ +--- +spine1 ansible_host=10.11.182.25 ansible_network_os="dellemc.os10.os10" +spine2 ansible_host=10.16.151.220 ansible_network_os="dellemc.os10.os10" + +leaf1 ansible_host=10.11.182.23 ansible_network_os="dellemc.os10.os10" +leaf2 ansible_host=10.11.182.16 ansible_network_os="dellemc.os10.os10" +leaf3 ansible_host=10.11.182.17 ansible_network_os="dellemc.os10.os10" +leaf4 ansible_host=10.16.148.79 ansible_network_os="dellemc.os10.os10" + +[spine] +spine1 +spine2 + +[leaf] +leaf1 +leaf2 +leaf3 +leaf4 + +[datacenter:children] +spine +leaf diff --git a/ansible_collections/dellemc/os10/roles/os10_flow_monitor/tests/main.yaml b/ansible_collections/dellemc/os10/roles/os10_flow_monitor/tests/main.yaml new file mode 100644 index 00000000..750932c8 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_flow_monitor/tests/main.yaml @@ -0,0 +1,33 @@ +--- +# vars file for dellemc.os10.os10_flow_monitor, +# below gives a example configuration +# Sample variables for OS10 device +os10_flow_monitor: + session 1: + session_type: local + description: "Discription goes here" + port_match: + - interface_name: ethernet 1/1/4 + location: source + state: present + - interface_name: ethernet 1/1/3 + location: destination + state: present + flow_based: true + shutdown: up + state: present + session 2: + session_type: local + description: "Discription of session goes here" + port_match: + - interface_name: ethernet 1/1/6 + location: source + state: present + - interface_name: ethernet 1/1/7 + location: destination + state: present + flow_based: false + shutdown: up + state: present + session 3: + state: present diff --git a/ansible_collections/dellemc/os10/roles/os10_flow_monitor/tests/test.yaml b/ansible_collections/dellemc/os10/roles/os10_flow_monitor/tests/test.yaml new file mode 100644 index 00000000..44a56b7e --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_flow_monitor/tests/test.yaml @@ -0,0 +1,5 @@ +--- +- hosts: datacenter + connection: network_cli + roles: + - dellemc.os10.os10_flow_monitor diff --git a/ansible_collections/dellemc/os10/roles/os10_flow_monitor/vars/main.yml b/ansible_collections/dellemc/os10/roles/os10_flow_monitor/vars/main.yml new file mode 100644 index 00000000..0943cd2c --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_flow_monitor/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for dellemc.os10.os10_flow_monitor diff --git a/ansible_collections/dellemc/os10/roles/os10_image_upgrade/LICENSE b/ansible_collections/dellemc/os10/roles/os10_image_upgrade/LICENSE new file mode 100644 index 00000000..2c9b8e1f --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_image_upgrade/LICENSE @@ -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) 2020, Dell Inc. All rights reserved. + + 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) 2020, Dell Inc. All rights reserved. + 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>. diff --git a/ansible_collections/dellemc/os10/roles/os10_image_upgrade/README.md b/ansible_collections/dellemc/os10/roles/os10_image_upgrade/README.md new file mode 100644 index 00000000..9ae8f731 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_image_upgrade/README.md @@ -0,0 +1,73 @@ +Image upgrade role +=================================== + +This role facilitates upgrades or installation of a software image. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. + +The Image upgrade role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. + +Role variables +-------------- + +- Setting an empty value for any variable negates the corresponding configuration +- Variables and values are case-sensitive + +**os10_image_upgrade keys** + +| Key | Type | Description | Support | +|------------|---------------------------|---------------------------------------------------------|-----------------------| +| ``operation_type`` | string: cancel,install | Displays the type of image operation | os10 | +| ``software_image_url`` | string | Configures the URL path to the image file | os10 | +| ``software_version`` | string | Displays the software version of the image file | os10 | +| ``number_of_retries`` | int | Configures the numbe of retries to check the status of image install process | os10 | + +Connection variables +-------------------- + +Ansible Dell EMC network roles require connection information to establish communication with the nodes in your inventory. This information can exist in the Ansible *group_vars* or *host_vars* directories or inventory or in the playbook itself. + +| Key | Required | Choices | Description | +|-------------|----------|------------|-----------------------------------------------------| +| ``ansible_host`` | yes | | Specifies the hostname or address for connecting to the remote device over the specified transport | +| ``ansible_port`` | no | | Specifies the port used to build the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_PORT` option is used; it defaults to 22 | +| ``ansible_ssh_user`` | no | | Specifies the username that authenticates the CLI login for the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_USER` environment variable value is used | +| ``ansible_ssh_pass`` | no | | Specifies the password that authenticates the connection to the remote device | +| ``ansible_become`` | no | yes, no\* | Instructs the module to enter privileged mode on the remote device before sending any commands; if value is unspecified, the `ANSIBLE_BECOME` environment variable value is used, and the device attempts to execute all commands in non-privileged mode | +| ``ansible_become_method`` | no | enable, sudo\* | Instructs the module to allow the become method to be specified for handling privilege escalation; if value is unspecified, the `ANSIBLE_BECOME_METHOD` environment variable value is used | +| ``ansible_become_pass`` | no | | Specifies the password to use if required to enter privileged mode on the remote device; if ``ansible_become`` is set to no this key is not applicable | +| ``ansible_network_os`` | yes | os10, null\* | Loads the correct terminal and cliconf plugins to communicate with the remote device | + +> **NOTE**: Asterisk (\*) denotes the default value if none is specified. + + +Example playbook +---------------- + +This example uses the *os10_image_upgrade* role to upgrade/install software image. It creates a *hosts* file with the switch details, corresponding *host_vars* file, and a simple playbook that references the *os10_image_upgrade* role. + +**Sample hosts file** + + leaf1 ansible_host= <ip_address> + +**Sample host_vars/leaf1** + + hostname: leaf1 + ansible_ssh_user: xxxxx + ansible_ssh_pass: xxxxx + ansible_network_os: dellemc.os10.os10 + os10_image_upgrade: + operation_type: install + software_image_url: tftp://10.16.148.8/PKGS_OS10-Enterprise-10.2.9999E.5790-installer-x86_64.bin + software_version: 10.2.9999E + number_of_retries: 50 + +**Simple playbook to setup system — leaf.yaml** + + - hosts: leaf1 + roles: + - dellemc.os10.os10_image_upgrade + +**Run** + + ansible-playbook -i hosts leaf.yaml + +(c) 2017-2020 Dell Inc. or its subsidiaries. All rights reserved. diff --git a/ansible_collections/dellemc/os10/roles/os10_image_upgrade/defaults/main.yml b/ansible_collections/dellemc/os10/roles/os10_image_upgrade/defaults/main.yml new file mode 100644 index 00000000..809f7a43 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_image_upgrade/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for dellemc.os10.os10_image_upgrade diff --git a/ansible_collections/dellemc/os10/roles/os10_image_upgrade/handlers/main.yml b/ansible_collections/dellemc/os10/roles/os10_image_upgrade/handlers/main.yml new file mode 100644 index 00000000..7bfc6bc7 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_image_upgrade/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for dellemc.os10.os10_image_upgrade diff --git a/ansible_collections/dellemc/os10/roles/os10_image_upgrade/meta/main.yml b/ansible_collections/dellemc/os10/roles/os10_image_upgrade/meta/main.yml new file mode 100644 index 00000000..b35a5382 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_image_upgrade/meta/main.yml @@ -0,0 +1,17 @@ +# Copyright (c) 2020 Dell Inc. +--- +galaxy_info: + author: Dell EMC Networking Engineering + description: The os10_image_upgrade role facilitates install/upgrade software image for OS10 switches + license: GPLv3 + min_ansible_version: 2.9.6 + + platforms: + - name: os10 + + galaxy_tags: + - networking + - dell + - emc + - dellemc + - os10 diff --git a/ansible_collections/dellemc/os10/roles/os10_image_upgrade/tasks/main.yml b/ansible_collections/dellemc/os10/roles/os10_image_upgrade/tasks/main.yml new file mode 100644 index 00000000..ee2d557d --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_image_upgrade/tasks/main.yml @@ -0,0 +1,37 @@ +--- + - block: + - name: "Process image {{ os10_image_upgrade.operation_type }} operation" + vars: + command_postfix: "{{ os10_image_upgrade.operation_type }} {{ '' if os10_image_upgrade.operation_type == 'cancel' else os10_image_upgrade.software_image_url }}" + os10_command: + commands: + - command: "image {{ command_postfix }}" + prompt: "yes/no]:" + answer: "yes" + register: result + - name: "Get image {{ os10_image_upgrade.operation_type }} operation status" + os10_command: + commands: "show image status" + register: image_status + - name: "Validate image status" + fail: msg="Image {{ os10_image_upgrade.operation_type }} operation Failed" + when: image_status.stdout.0.find("Failed") > 1 + - name: "Wait for image {{ os10_image_upgrade.operation_type }} operation" + os10_command: + commands: "show image status" + register: result + until: result.stdout.0.find("In progress") < 1 + retries: "{{ os10_image_upgrade.number_of_retries }}" + delay: 15 + - name: "Wait for image {{ os10_image_upgrade.operation_type }} operation" + os10_command: + commands: "show image status" + register: image_status + - name: "Validate software version" + fail: msg="Image {{ os10_image_upgrade.operation_type }} operation Failed" + when: image_status.stdout.0.find("Failed") > 1 + - name: "Image {{ os10_image_upgrade.operation_type }} status" + debug: msg="Image {{ os10_image_upgrade.operation_type }} successful" + when: image_status.stdout.0.find("Failed") <= -1 + when: + - os10_image_upgrade.operation_type == "install" diff --git a/ansible_collections/dellemc/os10/roles/os10_image_upgrade/tests/inventory b/ansible_collections/dellemc/os10/roles/os10_image_upgrade/tests/inventory new file mode 100644 index 00000000..85a255f9 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_image_upgrade/tests/inventory @@ -0,0 +1,2 @@ +--- +localhost diff --git a/ansible_collections/dellemc/os10/roles/os10_image_upgrade/tests/main.yml b/ansible_collections/dellemc/os10/roles/os10_image_upgrade/tests/main.yml new file mode 100644 index 00000000..66507dc7 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_image_upgrade/tests/main.yml @@ -0,0 +1,9 @@ +--- +# vars file for dellemc.os10.os10_image_upgrade, +# below gives a example configuration + +os10_image_upgrade: + operation_type: install + software_image_url: http://10.16.127.7//tftpboot/NGOS/FMB-ar-rel_10.5.1-release/AmazonInstallers/last_good/PKGS_OS10-Enterprise-10.5.1.0.124stretch-installer-x86_64.bin + software_version: 10.5.1.0 + number_of_retries: 50 diff --git a/ansible_collections/dellemc/os10/roles/os10_image_upgrade/tests/test.yml b/ansible_collections/dellemc/os10/roles/os10_image_upgrade/tests/test.yml new file mode 100644 index 00000000..a2ed1161 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_image_upgrade/tests/test.yml @@ -0,0 +1,5 @@ +--- +- hosts: localhost + connection: network_cli + roles: + - dellemc.os10.os10_image_upgrade diff --git a/ansible_collections/dellemc/os10/roles/os10_image_upgrade/vars/main.yml b/ansible_collections/dellemc/os10/roles/os10_image_upgrade/vars/main.yml new file mode 100644 index 00000000..a9fa1154 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_image_upgrade/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for dellemc.os10.os10_image_upgrade, below gives a example configuration diff --git a/ansible_collections/dellemc/os10/roles/os10_interface/LICENSE b/ansible_collections/dellemc/os10/roles/os10_interface/LICENSE new file mode 100644 index 00000000..2c9b8e1f --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_interface/LICENSE @@ -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) 2020, Dell Inc. All rights reserved. + + 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) 2020, Dell Inc. All rights reserved. + 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>. diff --git a/ansible_collections/dellemc/os10/roles/os10_interface/README.md b/ansible_collections/dellemc/os10/roles/os10_interface/README.md new file mode 100644 index 00000000..bbb4f8ee --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_interface/README.md @@ -0,0 +1,178 @@ +Interface role +============== + +This role facilitates the configuration of interface attributes. It supports the configuration of admin state, description, MTU, IP address, IP helper, suppress_ra, and port mode. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. + +The Interface role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. + +Role variables +-------------- + +- Role is abstracted using the `ansible_network_os` variable that can take `dellemc.os10.os10` as the value +- If `os10_cfg_generate` is set to true, the variable generates the role configuration commands in a file +- Any role variable with a corresponding state variable setting to absent negates the configuration of that variable +- Setting an empty value for any variable negates the corresponding configuration +- `os10_interface` (dictionary) holds a dictionary with the interface name; interface name can correspond to any of the valid OS interfaces with the unique interface identifier name +- For physical interfaces, the interface name must be in *<interfacename> <tuple>* format; for logical interfaces, the interface must be in *<logical_interfacename> <id>* format; physical interface name can be *ethernet 1/1/32* +- For interface ranges, the interface name must be in *range <interface_type> <node/slot/port[:subport]-node/slot/port[:subport]>* format; *range ethernet 1/1/1-1/1/4* +- Logical interface names can be *vlan 1* or *port-channel 1* +- Variables and values are case-sensitive + +> **NOTE**: Only define supported variables for the interface type, and do not define the *switchport* variable for a logical interface. + +**interface name keys** + +| Key | Type | Description | Support | +|------------|---------------------------|---------------------------------------------------------|-----------------------| +| ``desc`` | string | Configures a single line interface description | os10 | +| ``portmode`` | string | Configures port-mode according to the device type | os10 | +| ``switchport`` | boolean: true,false\* | Configures an interface in L2 mode | os10 | +| ``admin`` | string: up,down\* | Configures the administrative state for the interface; configuring the value as administratively "up" enables the interface; configuring the value as administratively "down" disables the interface | os10 | +| ``mtu`` | integer | Configures the MTU size for L2 and L3 interfaces (1280 to 65535) | os10 | +| ``fanout`` | string:dual, single; string:10g-4x, 40g-1x, 25g-4x, 100g-1x, 50g-2x (os10) | Configures fanout to the appropriate value | os10 | +| ``suppress_ra`` | string; present,absent | Configures IPv6 router advertisements if set to present | os10 | +| ``ip_type_dynamic`` | boolean: true,false | Configures IP address DHCP if set to true (*ip_and_mask* is ignored if set to true) | os10 | +| ``ipv6_type_dynamic`` | boolean: true,false | Configures an IPv6 address for DHCP if set to true (*ipv6_and_mask* is ignored if set to true) | os10 | +| ``ipv6_autoconfig`` | boolean: true,false | Configures stateless configuration of IPv6 addresses if set to true (*ipv6_and_mask* is ignored if set to true) | os10 | +| ``vrf`` | string | Configures the specified VRF to be associated to the interface | os10 | +| ``min_ra`` | string | Configures RA minimum interval time period | os10 | +| ``max_ra`` | string | Configures RA maximum interval time period | os10 | +| ``ip_and_mask`` | string | Configures the specified IP address to the interface | os10 | +| ``ipv6_and_mask`` | string | Configures a specified IPv6 address to the interface | os10 | +| ``virtual_gateway_ip`` | string | Configures an anycast gateway IP address for a VxLAN virtual network as well as VLAN interfaces| os10 | +| ``virtual_gateway_ipv6`` | string | Configures an anycast gateway IPv6 address for VLAN interfaces| os10 | +| ``state_ipv6`` | string: absent,present\* | Deletes the IPV6 address if set to absent | os10 | +| ``ip_helper`` | list | Configures DHCP server address objects (see ``ip_helper.*``) | os10 | +| ``ip_helper.ip`` | string (required) | Configures the IPv4 address of the DHCP server (A.B.C.D format) | os10 | +| ``ip_helper.state`` | string: absent,present\* | Deletes the IP helper address if set to absent | os10 | +| ``flowcontrol`` | dictionary | Configures the flowcontrol attribute (see ``flowcontrol.*``) | os10 | +| ``flowcontrol.mode`` | string: receive,transmit | Configures the flowcontrol mode | os10 | +| ``flowcontrol.enable`` | string: on,off | Configures the flowcontrol mode on | os10 | +| ``flowcontrol.state`` | string: absent,present\* | Deletes the flowcontrol if set to absent | os10 | +| ``ipv6_bgp_unnum`` | dictionary | Configures the IPv6 BGP unnum attributes (see ``ipv6_bgp_unnum.*``) below | os10 | +| ``ipv6_bgp_unnum.state`` | string: absent,present\* | Disables auto discovery of BGP unnumbered peer if set to absent | os10 | +| ``ipv6_bgp_unnum.peergroup_type`` | string: ebgp,ibgp | Specifies the type of template to inherit from | os10 | + +| ``stp_rpvst_default_behaviour`` | boolean: false,true | Configures RPVST default behaviour of BPDU's when set to True which is default | os10 | + +> **NOTE**: Asterisk (*) denotes the default value if none is specified. + +Connection variables +-------------------- + +Ansible Dell EMC network roles require connection information to establish communication with the nodes in your inventory. This information can exist in the Ansible *group_vars* or *host_vars* directories or inventory, or in the playbook itself. + +| Key | Required | Choices | Description | +|-------------|----------|------------|-----------------------------------------------------| +| ``ansible_host`` | yes | | Specifies the hostname or address for connecting to the remote device over the specified transport | +| ``ansible_port`` | no | | Specifies the port used to build the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_PORT` option is used; it defaults to 22 | +| ``ansible_ssh_user`` | no | | Specifies the username that authenticates the CLI login for the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_USER` environment variable value is used | +| ``ansible_ssh_pass`` | no | | Specifies the password that authenticates the connection to the remote device | +| ``ansible_become`` | no | yes, no\* | Instructs the module to enter privileged mode on the remote device before sending any commands; if value is unspecified, the `ANSIBLE_BECOME` environment variable value is used, and the device attempts to execute all commands in non-privileged mode | +| ``ansible_become_method`` | no | enable, sudo\* | Instructs the module to allow the become method to be specified for handling privilege escalation; if value is unspecified, the `ANSIBLE_BECOME_METHOD` environment variable value is used | +| ``ansible_become_pass`` | no | | Specifies the password to use if required to enter privileged mode on the remote device; if ``ansible_become`` is set to no this key is not applicable | +| ``ansible_network_os`` | yes | os10, null\* | Loads the correct terminal and cliconf plugins to communicate with the remote device | + +> **NOTE**: Asterisk (*) denotes the default value if none is specified. + + +Example playbook +---------------- + +This example uses the *os10_interface* role to set up description, MTU, admin status, port mode, and switchport details for an interface. The example creates a *hosts* file with the switch details and orresponding variables. The hosts file should define the `ansible_network_os` variable with corresponding Dell EMC OS10 name. + +When `os10_cfg_generate` is set to true, the variable generates the configuration commands as a .part file in *build_dir* path. By default, this variable is set to false. The example writes a simple playbook that only references the *os10_interface* role. + +**Sample hosts file** + + leaf3 ansible_host= <ip_address> + +**Sample host_vars/leaf3** + + hostname: "leaf3" + ansible_become: yes + ansible_become_method: xxxxx + ansible_become_pass: xxxxx + ansible_ssh_user: xxxxx + ansible_ssh_pass: xxxxx + ansible_network_os: dellemc.os10.os10 + build_dir: ../temp/temp_os10 + + os10_interface: + ethernet 1/1/32: + desc: "Connected to Core 2" + mtu: 2500 + stp_rpvst_default_behaviour: False + portmode: + admin: up + switchport: False + ip_and_mask: + ip_type_dynamic: True + ipv6_type_dynamic: True + ethernet 1/1/12: + desc: "ipv6 auto config" + switchport: False + mtu: 2500 + admin: up + ipv6_autoconfig: True + ethernet 1/1/14: + fanout: 10g-4x + ethernet 1/1/13: + desc: "set ipv6 address" + switchport: False + admin: up + ipv6_and_mask: 2001:4898:5809:faa2::10/126 + state_ipv6: present + ethernet 1/1/1: + desc: "Connected to Leaf1" + portmode: "trunk" + switchport: True + suppress_ra: present + admin: up + stp_rpvst_default_behaviour: False + ethernet 1/1/3: + desc: site2-spine2 + ip_and_mask: 10.9.0.4/31 + mtu: 9216 + switchport: False + admin: up + flowcontrol: + mode: "receive" + enable: "on" + state: "present" + + vlan 100: + ip_and_mask: + ipv6_and_mask: 2001:4898:5808:ffaf::1/64 + state_ipv6: present + ip_helper: + - ip: 10.0.0.33 + state: present + admin: up + range ethernet 1/1/1-1/1/32: + mtu: 2500 + port-channel 10: + admin: up + switchport: False + suppress_ra: + stp_rpvst_default_behaviour: True + ipv6_bgp_unnum: + state: present + peergroup_type: ebgp + vlan 10: + ip_and_mask: "10.1.1.1/24" + virtual_gateway_ip: "10.1.1.254" + virtual_gateway_ipv6: "10:1:1::254" + admin: up + +**Simple playbook to setup system — leaf.yaml** + + - hosts: leaf3 + roles: + - dellemc.os10.os10_interface + +**Run** + + ansible-playbook -i hosts leaf.yaml + +(c) 2017-2020 Dell Inc. or its subsidiaries. All rights reserved. diff --git a/ansible_collections/dellemc/os10/roles/os10_interface/defaults/main.yml b/ansible_collections/dellemc/os10/roles/os10_interface/defaults/main.yml new file mode 100644 index 00000000..6f214632 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_interface/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for dellemc.os10.os10_interface diff --git a/ansible_collections/dellemc/os10/roles/os10_interface/handlers/main.yml b/ansible_collections/dellemc/os10/roles/os10_interface/handlers/main.yml new file mode 100644 index 00000000..72e65874 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_interface/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for dellemc.os10.os10_interface diff --git a/ansible_collections/dellemc/os10/roles/os10_interface/meta/main.yml b/ansible_collections/dellemc/os10/roles/os10_interface/meta/main.yml new file mode 100644 index 00000000..8f0bfd3b --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_interface/meta/main.yml @@ -0,0 +1,18 @@ +# Copyright (c) 2017-2020 Dell Inc. or its subsidiaries. All Rights Reserved. +--- +galaxy_info: + author: Dell EMC Networking Engineering + description: The os10_interface role facilitates the configuration of interface attributes in devices running Dell EMC SmartFabric OS10. + company: Dell Technologies + license: GPLv3 + min_ansible_version: 2.9.6 + + platforms: + - name: os10 + + galaxy_tags: + - networking + - dell + - emc + - dellemc + - os10 diff --git a/ansible_collections/dellemc/os10/roles/os10_interface/tasks/main.yml b/ansible_collections/dellemc/os10/roles/os10_interface/tasks/main.yml new file mode 100644 index 00000000..c8656c51 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_interface/tasks/main.yml @@ -0,0 +1,16 @@ +--- +# tasks file for os10 + - name: "Generating interface configuration for os10" + template: + src: os10_interface.j2 + dest: "{{ build_dir }}/intf10_{{ hostname }}.conf.part" + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") and ((os10_cfg_generate | default('False')) | bool) +# notify: save config os10 + register: generate_output + + - name: "Provisioning interface configuration for os10" + os10_config: + src: os10_interface.j2 + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") +# notify: save config os10 + register: output diff --git a/ansible_collections/dellemc/os10/roles/os10_interface/templates/os10_interface.j2 b/ansible_collections/dellemc/os10/roles/os10_interface/templates/os10_interface.j2 new file mode 100644 index 00000000..c4dc61b7 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_interface/templates/os10_interface.j2 @@ -0,0 +1,258 @@ +#jinja2: trim_blocks: True,lstrip_blocks: True +{##################################################### +Purpose: +Configure interface commands for os10 Devices. +os10_interface: + ethernet 1/1/31: + desc: "OS10 intf" + portmode: trunk + mtu: 2000 + switchport: False + admin: up + ip_type_dynamic: True + ip_and_mask: "192.168.11.1/24" + virtual_gateway_ip: "172.17.17.1" + suppress_ra: present + ipv6_autoconfig: True + ipv6_and_mask: 2001:4898:5808:ffa2::5/126 + state_ipv6: present + ip_helper: + - ip: 10.0.0.36 + state: present + flowcontrol: + mode: "receive" + enable: "on" + state: "present" + ethernet 1/1/3: + fanout: 10g-4x + range ethernet 1/1/1-1/1/4: + switchport: True + admin: down + stp_rpvst_default_behaviour: False + virtual-network 100: + vrf: "test" + ip_and_mask: "15.1.1.1/24" + virtual_gateway_ip: "15.1.1.254" + admin: up + port-channel 10: + admin: up + switchport: False + suppress_ra: + ipv6_bgp_unnum: + state: present + peergroup_type: ebgp + port-channel 20: + admin: up + stp_rpvst_default_behaviour: True + vlan 10: + ip_and_mask: "10.1.1.1/24" + virtual_gateway_ip: "10.1.1.254" + virtual_gateway_ipv6: "10:1:1::254" + admin: up + +#####################################################} +{% if os10_interface is defined and os10_interface %} +{% for key in os10_interface.keys() %} + {% set intf_vars = os10_interface[key] %} + {% set port = key.split(" ") %} + {% set interface_key = "" %} + {% if intf_vars.fanout is defined %} + {% if intf_vars.fanout %} +interface breakout {{ port[1] }} map {{ intf_vars.fanout }} + {% else %} +no interface breakout {{ port[1] }} + {% endif %} + {% endif %} +{% endfor %} +{% for key in os10_interface.keys() %} + {% set intf_vars = os10_interface[key] %} + {% set port = key.split(" ") %} + {% set interface_key = "" %} + {% if (intf_vars.fanout is defined and not intf_vars.fanout) or (intf_vars.fanout is not defined) %} + {% if key.startswith('range')%} + {% set interface_key = port[0] + " " + port[1] + port[2] %} + {% else %} + {% set interface_key = port[0] + port[1] %} + {% endif %} +interface {{ interface_key }} + {% if intf_vars.desc is defined %} + {% if intf_vars.desc %} + {% if intf_vars.desc|wordcount > 1 %} + description "{{ intf_vars.desc }}" + {% else %} + description {{ intf_vars.desc }} + {% endif %} + {% else %} + no description + {% endif %} + {% endif %} + + + + {% if intf_vars.switchport is defined %} + {% if intf_vars.switchport %} + {% if intf_vars.portmode is defined and intf_vars.portmode %} + switchport mode {{ intf_vars.portmode }} + {% endif %} + {% else %} + no switchport + {% endif %} + {% else %} + {% if intf_vars.portmode is defined %} + {% if intf_vars.portmode %} + switchport mode {{ intf_vars.portmode }} + {% else %} + no switchport + {% endif %} + {% endif %} + {% endif %} + + {% if intf_vars.mtu is defined %} + {% if intf_vars.mtu %} + mtu {{ intf_vars.mtu }} + {% else %} + no mtu + {% endif %} + {% endif %} + + {% if intf_vars.ip_type_dynamic is defined %} + {% if intf_vars.ip_type_dynamic %} + ip address dhcp + {% else %} + no ip address + {% endif %} + {% else %} + {% if intf_vars.vrf is defined %} + {% if intf_vars.vrf %} + ip vrf forwarding {{ intf_vars.vrf }} + {% else %} + no ip address vrf + {% endif %} + {% endif %} + {% if intf_vars.ip_and_mask is defined %} + {% if intf_vars.ip_and_mask %} + ip address {{ intf_vars.ip_and_mask }} + {% else %} + no ip address + {% endif %} + {% endif %} + {% endif %} + + {% if intf_vars.virtual_gateway_ip is defined %} + {% if intf_vars.virtual_gateway_ip %} + ip virtual-router address {{ intf_vars.virtual_gateway_ip }} + {% else %} + no ip virtual-router address + {% endif %} + {% endif %} + + {% if intf_vars.virtual_gateway_ipv6 is defined %} + {% if intf_vars.virtual_gateway_ipv6 %} + ipv6 virtual-router address {{ intf_vars.virtual_gateway_ipv6 }} + {% else %} + no ipv6 virtual-router address + {% endif %} + {% endif %} + + {% if intf_vars.suppress_ra is defined %} + {% if intf_vars.suppress_ra == "present" %} + no ipv6 nd send-ra + {% else %} + ipv6 nd send-ra + {% endif %} + {% endif %} + + {% if intf_vars.stp_rpvst_default_behaviour is defined %} + {% if intf_vars.stp_rpvst_default_behaviour %} + spanning-tree rapid-pvst default-behavior + {% else %} + no spanning-tree rapid-pvst default-behavior + {% endif %} + {% endif %} + + {% if intf_vars.ipv6_autoconfig is defined %} + {% if intf_vars.ipv6_autoconfig %} + ipv6 address autoconfig + {% else %} + no ipv6 address + {% endif %} + {% elif intf_vars.ipv6_type_dynamic is defined %} + {% if intf_vars.ipv6_type_dynamic %} + ipv6 address dhcp + {% else %} + no ipv6 address + {% endif %} + {% else %} + {% if intf_vars.ipv6_and_mask is defined %} + {% if intf_vars.ipv6_and_mask %} + {% if intf_vars.state_ipv6 is defined and intf_vars.state_ipv6 == "absent" %} + no ipv6 address {{ intf_vars.ipv6_and_mask }} + {% else %} + ipv6 address {{ intf_vars.ipv6_and_mask }} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% if intf_vars.max_ra is defined %} + {% if intf_vars.max_ra %} + ipv6 nd max-ra-interval {{ intf_vars.max_ra }} + {% else %} + no ipv6 nd max-ra-interval + {% endif %} + {% endif %} + {% if intf_vars.min_ra is defined %} + {% if intf_vars.min_ra %} + ipv6 nd min-ra-interval {{ intf_vars.min_ra }} + {% else %} + no ipv6 nd min-ra-interval + {% endif %} + {% endif %} + {% if intf_vars.ip_helper is defined and intf_vars.ip_helper %} + {% for helper in intf_vars.ip_helper %} + {% if helper.ip is defined and helper.ip %} + {% if helper.state is defined and helper.state == "absent" %} + no ip helper-address {{ helper.ip }} + {% else %} + ip helper-address {{ helper.ip }} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + + {% if intf_vars.flowcontrol is defined and intf_vars.flowcontrol %} + {% if intf_vars.flowcontrol.mode is defined %} + {% if intf_vars.flowcontrol.mode %} + {% if intf_vars.flowcontrol.state is defined and intf_vars.flowcontrol.state == "absent" %} + no flowcontrol {{ intf_vars.flowcontrol.mode }} + {% else %} + {% if intf_vars.flowcontrol.enable is defined %} + {% if intf_vars.flowcontrol.enable == "on" %} + flowcontrol {{ intf_vars.flowcontrol.mode }} on + {% else %} + flowcontrol {{ intf_vars.flowcontrol.mode }} off + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + + {% if intf_vars.admin is defined %} + {% if intf_vars.admin == "up" %} + no shutdown + {% elif intf_vars.admin == "down" %} + shutdown + {% endif %} + {% endif %} + {% if intf_vars.ipv6_bgp_unnum is defined and intf_vars.ipv6_bgp_unnum %} + {% if intf_vars.ipv6_bgp_unnum.state == "absent" %} + no ipv6 bgp unnumbered + {% elif intf_vars.ipv6_bgp_unnum.state == "present" and intf_vars.ipv6_bgp_unnum.peergroup_type == "ebgp" %} + ipv6 bgp unnumbered ebgp-template + {% elif intf_vars.ipv6_bgp_unnum.state == "present" and intf_vars.ipv6_bgp_unnum.peergroup_type == "ibgp" %} + ipv6 bgp unnumbered ibgp-template + {% endif %} + {% endif %} + {% endif %} +{% endfor %} +{% endif %} diff --git a/ansible_collections/dellemc/os10/roles/os10_interface/tests/inventory.yaml b/ansible_collections/dellemc/os10/roles/os10_interface/tests/inventory.yaml new file mode 100644 index 00000000..b1ff63e6 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_interface/tests/inventory.yaml @@ -0,0 +1,22 @@ +--- +spine1 ansible_host=10.11.182.25 ansible_network_os="dellemc.os10.os10" +spine2 ansible_host=10.16.151.220 ansible_network_os="dellemc.os10.os10" + +leaf1 ansible_host=10.11.182.23 ansible_network_os="dellemc.os10.os10" +leaf2 ansible_host=10.11.182.16 ansible_network_os="dellemc.os10.os10" +leaf3 ansible_host=10.11.182.17 ansible_network_os="dellemc.os10.os10" +leaf4 ansible_host=10.16.148.79 ansible_network_os="dellemc.os10.os10" + +[spine] +spine1 +spine2 + +[leaf] +leaf1 +leaf2 +leaf3 +leaf4 + +[datacenter:children] +spine +leaf diff --git a/ansible_collections/dellemc/os10/roles/os10_interface/tests/main.os10.yaml b/ansible_collections/dellemc/os10/roles/os10_interface/tests/main.os10.yaml new file mode 100644 index 00000000..d77b7fc6 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_interface/tests/main.os10.yaml @@ -0,0 +1,72 @@ +--- +# vars file for dellemc.os10.os10_interface +# Sample variables for OS10 device +os10_interface: + ethernet 1/1/32: + desc: "Connected to Core 2" + mtu: 2500 + portmode: + admin: up + switchport: False + ip_and_mask: + ip_type_dynamic: True + ipv6_type_dynamic: True + ethernet 1/1/12: + desc: "ipv6 auto config" + switchport: False + mtu: 2500 + admin: up + ipv6_autoconfig: True + ethernet 1/1/14: + fanout: 10g-4x + ethernet 1/1/13: + desc: "set ipv6 address" + switchport: False + admin: up + ipv6_and_mask: 2001:4898:5809:faa2::10/126 + state_ipv6: present + ethernet 1/1/1: + desc: "Connected to Leaf1" + portmode: "trunk" + switchport: True + suppress_ra: present + admin: up + stp_rpvst_default_behaviour: False + ethernet 1/1/3: + desc: site2-spine2 + ip_and_mask: 10.9.0.4/31 + mtu: 9216 + switchport: False + admin: up + flowcontrol: + mode: "receive" + enable: "on" + state: "present" + stp_rpvst_default_behaviour: True + vlan 100: + ip_and_mask: + ipv6_and_mask: 2001:4898:5808:ffaf::1/64 + state_ipv6: present + ip_helper: + - ip: 10.0.0.33 + state: present + admin: up + range ethernet 1/1/1-1/1/32: + mtu: 2500 + admin: up + switchport: False + port-channel 10: + admin: up + switchport: False + suppress_ra: + ipv6_bgp_unnum: + state: present + peergroup_type: ebgp + port-channel 20: + admin: up + stp_rpvst_default_behaviour: False + vlan 10: + ip_and_mask: "10.1.1.1/24" + virtual_gateway_ip: "10.1.1.254" + virtual_gateway_ipv6: "10:1:1::254" + admin: up diff --git a/ansible_collections/dellemc/os10/roles/os10_interface/tests/test.yaml b/ansible_collections/dellemc/os10/roles/os10_interface/tests/test.yaml new file mode 100644 index 00000000..5b1ac094 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_interface/tests/test.yaml @@ -0,0 +1,5 @@ +--- +- hosts: datacenter + connection: network_cli + roles: + - dellemc.os10.os10_interface diff --git a/ansible_collections/dellemc/os10/roles/os10_interface/vars/main.yml b/ansible_collections/dellemc/os10/roles/os10_interface/vars/main.yml new file mode 100644 index 00000000..247ea157 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_interface/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for dellemc.os10.os10_interface diff --git a/ansible_collections/dellemc/os10/roles/os10_lag/LICENSE b/ansible_collections/dellemc/os10/roles/os10_lag/LICENSE new file mode 100644 index 00000000..2c9b8e1f --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_lag/LICENSE @@ -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) 2020, Dell Inc. All rights reserved. + + 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) 2020, Dell Inc. All rights reserved. + 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>. diff --git a/ansible_collections/dellemc/os10/roles/os10_lag/README.md b/ansible_collections/dellemc/os10/roles/os10_lag/README.md new file mode 100644 index 00000000..eb679dcf --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_lag/README.md @@ -0,0 +1,103 @@ +LAG role +======== + +This role facilitates the configuration of link aggregation group (LAG) attributes, and supports the creation and deletion of a LAG and its member ports. It also supports the configuration of an interface type as a static or dynamic LAG and minimum required link. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. + +The LAG role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. + +Role variables +-------------- + +- Role is abstracted using the `ansible_network_os` variable that can take `dellemc.os10.os10` as the value +- If `os10_cfg_generate` is set to true, the variable generates the role configuration commands in a file +- Object drives the tasks in this role +- `os10_lag` (dictionary) contains the hostname (dictionary) +- Hostname is the value of the *hostname* variable that corresponds to the name of the OS device +- Any role variable with a corresponding state variable setting to absent negates the configuration of that variable +- Setting an empty value to any variable negates the corresponding configuration +- `os10_lag` (dictionary) holds a dictionary with the port-channel ID key in `Po <ID>` format (1 to 128) +- Variables and values are case-sensitive + +**port-channel ID keys** + +| Key | Type | Description | Support | +|------------|---------------------------|---------------------------------------------------------|-----------------------| +| ``type`` | string: static,dynamic | Configures the interface either as a static or dynamic LAG | os10 | +| ``min_links`` | integer | Configures the minimum number of links in the LAG that must be in *operup* status (1 to 32) | os10 | +| ``max_bundle_size`` | integer | Configures the maximum bundle size for the port channel | os10 | +| ``lacp_system_priority`` | integer | Configures the LACP system-priority value | os10 | +| ``lacp_fallback_enable`` | boolean | Configures LACP fallback | os10 | +| ``channel_members`` | list | Specifies the list of port members to be associated to the port-channel (see ``channel_members.*``) | os10 | +| ``channel_members.port`` | string | Specifies valid interface names to be configured as port-channel members | os10 | +| ``channel_members.mode`` | string: active,passive,on | Configures mode of channel members | os10 | +| ``channel_members.port_priority`` | integer | Configures port priority on devices for channel members | os10 | +| ``channel_members.lacp_rate_fast`` | boolean | Configures the LACP rate as fast if set to true | os10 | +| ``state`` | string: absent,present\* | Deletes the LAG corresponding to the port-channel ID if set to absent | os10 | + +> **NOTE**: Asterisk (\*) denotes the default value if none is specified. + +Connection variables +-------------------- + +Ansible Dell EMC network roles require connection information to establish communication with the nodes in your inventory. This information can exist in the Ansible *group_vars* or *host_vars* directories or inventory, or in the playbook itself. + +| Key | Required | Choices | Description | +|-------------|----------|------------|-----------------------------------------------------| +| ``ansible_host`` | yes | | Specifies the hostname or address for connecting to the remote device over the specified transport | +| ``ansible_port`` | no | | Specifies the port used to build the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_PORT` option is used; it defaults to 22 | +| ``ansible_ssh_user`` | no | | Specifies the username that authenticates the CLI login for the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_USER` environment variable value is used | +| ``ansible_ssh_pass`` | no | | Specifies the password that authenticates the connection to the remote device | +| ``ansible_become`` | no | yes, no\* | Instructs the module to enter privileged mode on the remote device before sending any commands; if value is unspecified, the `ANSIBLE_BECOME` environment variable value is used, and the device attempts to execute all commands in non-privileged mode | +| ``ansible_become_method`` | no | enable, sudo\* | Instructs the module to allow the become method to be specified for handling privilege escalation; if value is unspecified, the `ANSIBLE_BECOME_METHOD` environment variable value is used | +| ``ansible_become_pass`` | no | | Specifies the password to use if required to enter privileged mode on the remote device; if ``ansible_become`` is set to no this key is not applicable | +| ``ansible_network_os`` | yes | os10, null\* | Loads the correct terminal and cliconf plugins to communicate with the remote device | + +> **NOTE**: Asterisk (\*) denotes the default value if none is specified. + + +Example playbook +---------------- + +This example uses the *os10_lag* role to setup port channel ID and description, and configures hash algorithm and minimum links for the LAG. Channel members can be configured for the port-channel either in static or dynamic mode. You can also delete the LAG with the port-channel ID or delete the members associated to it. This example creates a *hosts* file with the switch details and corresponding variables. The hosts file should define the `ansible_network_os` variable with corresponding Dell EMC OS10 name. + +When `os10_cfg_generate` is set to true, the variable generates the configuration commands as a .part file in *build_dir* path. By default, the variable is set to false. It writes a simple playbook that only references the *os10_lag* role. + +**Sample hosts file** + + leaf1 ansible_host= <ip_address> + +**Sample host_vars/leaf1** + + hostname: leaf1 + ansible_become: yes + ansible_become_method: xxxxx + ansible_become_pass: xxxxx + ansible_ssh_user: xxxxx + ansible_ssh_pass: xxxxx + ansible_network_os: dellemc.os10.os10 + build_dir: ../temp/temp_os10 + + os10_lag: + Po 12: + type: dynamic + min_links: 2 + max_bundle_size: 2 + lacp_system_priority: 2 + channel_members: + - port: ethernet 1/1/31 + mode: "active" + port_priority: 3 + lacp_rate_fast: true + state: present + +**Simple playbook to setup system — leaf.yaml** + + - hosts: leaf1 + roles: + - dellemc.os10.os10_lag + +**Run** + + ansible-playbook -i hosts leaf.yaml + +(c) 2017-2020 Dell Inc. or its subsidiaries. All rights reserved. diff --git a/ansible_collections/dellemc/os10/roles/os10_lag/defaults/main.yml b/ansible_collections/dellemc/os10/roles/os10_lag/defaults/main.yml new file mode 100644 index 00000000..6eaa54ea --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_lag/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for dellemc.os10.os10_lag diff --git a/ansible_collections/dellemc/os10/roles/os10_lag/handlers/main.yml b/ansible_collections/dellemc/os10/roles/os10_lag/handlers/main.yml new file mode 100644 index 00000000..06b4bef8 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_lag/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for dellemc.os10.os10_lag diff --git a/ansible_collections/dellemc/os10/roles/os10_lag/meta/main.yml b/ansible_collections/dellemc/os10/roles/os10_lag/meta/main.yml new file mode 100644 index 00000000..6fcd3c68 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_lag/meta/main.yml @@ -0,0 +1,18 @@ +# Copyright (c) 2020 Dell Inc. +--- +galaxy_info: + author: Dell EMC Networking Engineering + description: The os10_lag role facilitates the configuration of LAG attributes in devices running Dell EMC SmartFabric OS10. + company: Dell Technologies + license: GPLv3 + min_ansible_version: 2.9.6 + + platforms: + - name: os10 + + galaxy_tags: + - networking + - dell + - emc + - dellemc + - os10 diff --git a/ansible_collections/dellemc/os10/roles/os10_lag/tasks/main.yml b/ansible_collections/dellemc/os10/roles/os10_lag/tasks/main.yml new file mode 100644 index 00000000..e103552f --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_lag/tasks/main.yml @@ -0,0 +1,16 @@ +--- +# tasks file for os10 + - name: "Generating LAG configuration for os10" + template: + src: os10_lag.j2 + dest: "{{ build_dir }}/lag10_{{ hostname }}.conf.part" + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") and ((os10_cfg_generate | default('False')) | bool) +# notify: save config os10 + register: generate_output + + - name: "Provisioning LAG configuration for os10" + os10_config: + src: os10_lag.j2 + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") +# notify: save config os10 + register: output diff --git a/ansible_collections/dellemc/os10/roles/os10_lag/templates/os10_lag.j2 b/ansible_collections/dellemc/os10/roles/os10_lag/templates/os10_lag.j2 new file mode 100644 index 00000000..722ff5ff --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_lag/templates/os10_lag.j2 @@ -0,0 +1,89 @@ +#jinja2: trim_blocks: True,lstrip_blocks: True +{################################ +Purpose: +Configure LAG commands for os10 Devices. +os10_lag: + Po 12: + type: dynamic + min_links: 2 + max_bundle_size: 2 + lacp_system_priority: 2 + channel_members: + - port: ethernet 1/1/31 + mode: "active" + port_priority: 3 + lacp_rate_fast: true + state: present +################################} +{% if os10_lag is defined and os10_lag %} +{% for key in os10_lag.keys() %} +{% set channel_id = key.split(" ") %} +{% set lag_vars = os10_lag[key] %} + + {% if lag_vars.lacp_system_priority is defined %} + {% if lag_vars.lacp_system_priority %} +lacp system-priority {{ lag_vars.lacp_system_priority }} + {% else %} +no lacp system-priority + {% endif %} + {% endif %} + + {% if lag_vars.state is defined and lag_vars.state == "absent" %} +no interface port-channel {{ channel_id[1] }} + {% else %} +interface port-channel{{ channel_id[1] }} + {% if lag_vars.min_links is defined %} + {% if lag_vars.min_links %} + minimum-links {{ lag_vars.min_links }} + {% else %} + no minimum-links + {% endif %} + {% endif %} + {% if lag_vars.max_bundle_size is defined %} + {% if lag_vars.max_bundle_size %} + lacp max-bundle {{ lag_vars.max_bundle_size }} + {% else %} + no lacp max-bundle + {% endif %} + {% endif %} + {% if lag_vars.lacp_fallback_enable is defined and lag_vars.lacp_fallback_enable %} + lacp fallback enable + {% endif %} + {% if lag_vars.channel_members is defined %} + {% for ports in lag_vars.channel_members %} + {% if ports.port is defined and ports.port %} +interface {{ ports.port }} + {% if lag_vars.type is defined and lag_vars.type == "static" %} + {% if ports.mode is defined and ports.mode == "on" %} + channel-group {{ channel_id[1] }} mode on + {% else %} + no channel-group + {% endif %} + {% elif lag_vars.type is defined and lag_vars.type == "dynamic" %} + {% if ports.mode is defined and ports.mode == "active" or ports.mode == "passive" %} + channel-group {{ channel_id[1] }} mode {{ ports.mode }} + {% else %} + no channel-group + {% endif %} + {% endif %} + {% if ports.lacp_rate_fast is defined %} + {% if ports.lacp_rate_fast %} + lacp rate fast + {% else %} + no lacp rate fast + {% endif %} + {% endif %} + {% if ports.port_priority is defined %} + {% if ports.port_priority %} + lacp port-priority {{ ports.port_priority }} + {% else %} + no lacp port-priority + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + + {% endif %} +{% endfor %} +{% endif %} diff --git a/ansible_collections/dellemc/os10/roles/os10_lag/tests/inventory.yaml b/ansible_collections/dellemc/os10/roles/os10_lag/tests/inventory.yaml new file mode 100644 index 00000000..b1ff63e6 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_lag/tests/inventory.yaml @@ -0,0 +1,22 @@ +--- +spine1 ansible_host=10.11.182.25 ansible_network_os="dellemc.os10.os10" +spine2 ansible_host=10.16.151.220 ansible_network_os="dellemc.os10.os10" + +leaf1 ansible_host=10.11.182.23 ansible_network_os="dellemc.os10.os10" +leaf2 ansible_host=10.11.182.16 ansible_network_os="dellemc.os10.os10" +leaf3 ansible_host=10.11.182.17 ansible_network_os="dellemc.os10.os10" +leaf4 ansible_host=10.16.148.79 ansible_network_os="dellemc.os10.os10" + +[spine] +spine1 +spine2 + +[leaf] +leaf1 +leaf2 +leaf3 +leaf4 + +[datacenter:children] +spine +leaf diff --git a/ansible_collections/dellemc/os10/roles/os10_lag/tests/main.os10.yaml b/ansible_collections/dellemc/os10/roles/os10_lag/tests/main.os10.yaml new file mode 100644 index 00000000..52518981 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_lag/tests/main.os10.yaml @@ -0,0 +1,15 @@ +--- +# vars file for dellemc.os10.os10_lag +# Sample variables for OS10 device +os10_lag: + Po 12: + type: dynamic + min_links: 2 + max_bundle_size: 2 + lacp_system_priority: 2 + channel_members: + - port: ethernet 1/1/31 + mode: "active" + port_priority: 3 + lacp_rate_fast: true + state: present diff --git a/ansible_collections/dellemc/os10/roles/os10_lag/tests/test.yaml b/ansible_collections/dellemc/os10/roles/os10_lag/tests/test.yaml new file mode 100644 index 00000000..6c130a0e --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_lag/tests/test.yaml @@ -0,0 +1,5 @@ +--- +- hosts: datacenter + connection: network_cli + roles: + - dellemc.os10.os10_lag diff --git a/ansible_collections/dellemc/os10/roles/os10_lag/vars/main.yml b/ansible_collections/dellemc/os10/roles/os10_lag/vars/main.yml new file mode 100644 index 00000000..5b1cd5b1 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_lag/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for dellemc.os10.os10_lag diff --git a/ansible_collections/dellemc/os10/roles/os10_lldp/LICENSE b/ansible_collections/dellemc/os10/roles/os10_lldp/LICENSE new file mode 100644 index 00000000..2c9b8e1f --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_lldp/LICENSE @@ -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) 2020, Dell Inc. All rights reserved. + + 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) 2020, Dell Inc. All rights reserved. + 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>. diff --git a/ansible_collections/dellemc/os10/roles/os10_lldp/README.md b/ansible_collections/dellemc/os10/roles/os10_lldp/README.md new file mode 100644 index 00000000..0c08af4d --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_lldp/README.md @@ -0,0 +1,149 @@ +LLDP role +========= + +This role facilitates the configuration of link layer discovery protocol (LLDP) attributes at a global and interface level. It supports the configuration of hello, mode, multiplier, advertise TLVs, management interface, FCoE, and iSCSI at global and interface level. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. + +The LLDP role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. + +Role variables +-------------- + +- Role is abstracted using the `ansible_network_os` variable that can take `dellemc.os10.os10` as the value +- If `os10_cfg_generate` is set to true, the variable generates the role configuration commands in a file +- Any role variable with a corresponding state variable set to absent negates the configuration of that variable +- Setting an empty value for any variable negates the corresponding configuration +- Variables and values are case-sensitive + +**os10_lldp keys** + +| Key | Type | Description | Support | +|------------|---------------------------|---------------------------------------------------------|-----------------------| +| ``enable`` | boolean | Enables or disables LLDP at a global level | os10 | +| ``multiplier`` | integer | Configures the global LLDP multiplier (2 to 10) | os10 | +| ``reinit`` | integer | Configures the reinit value (1 to 10) | os10 | +| ``timer`` | integer | Configures the timer value (5 to 254) | os10 | +| ``advertise`` | dictionary | Configures LLDP-MED and TLV advertisement at the global level (see ``advertise.*``) | os10 | +| ``advertise.med`` | dictionary | Configures MED TLVs advertisement (see ``med_tlv.*``) | os10 | +| ``med.fast_start_repeat_count`` | integer | Configures med fast start repeat count value (1 to 10) | os10 | +| ``med.application`` | list | Configures global MED TLVs advertisement for an application (see ``application.*``) | os10 | +| ``application.name`` | string | Configures the application name for MED TLVs advertisement | os10 | +| ``application.vlan_id`` | integer | Configures the VLAN ID for the application MED TLVs advertisement (1 to 4094) | os10 | +| ``application.l2_priority`` | integer | Configures the L2 priority for the application MED TLVs advertisement (0 to 7) | os10 | +| ``application.code_point_value`` | integer | Configures differentiated services code point values for MED TLVs advertisement (0 to 63) | os10 | +| ``application.vlan_type`` | string: tag, untag | Configures the VLAN type for the application MED TLvs advertisement | os10 | +| ``application.network_policy_id`` | integer | Configures network policy ID for the application MED TLVs advertisement | os10 | +| ``application.state`` | string: present\*,absent | Deletes the application if set to absent | os10 | +| ``local_interface`` | dictionary | Configures LLDP at the interface level (see ``local_interface.*``) | os10 | +| ``local_interface.<interface name>`` | dictionary | Configures LLDP at the interface level (see ``<interface name>.*``) | os10 | +| ``<interface name>.mode`` | string: rx,tx | Configures LLDP mode configuration at the interface level | os10 | +| ``<interface name>.mode_state`` | string: absent,present | Configures transmit/receive at the interface level| os10 | +| ``<interface name>.advertise`` | dictionary | Configures LLDP-MED TLV advertisement at the interface level (see ``advertise.*``) | os10 | +| ``advertise.med`` | dictionary | Configures MED TLVs advertisement at the interface level (see ``med_tlv.*``) | os10 | +| ``med.enable`` | boolean | Enables interface level MED capabilities | os10 | +| ``med.tlv`` | string | Configures MED TLV advertisement at interface level | os10 | +| ``med.tlv_state`` | string: present\*,absent | Deletes the interface level MED configuration if set to absent | os10 | +| ``med.application`` | list | Configures MED TLVs advertisement for the application at the interface level (see ``application.*``) | os10 | +| ``application.network_policy_id`` | integer | Configures the *network_policy_id* for the application of MED | os10 | +| ``application.state`` | string: present\*,absent | Deletes the associated network policy ID for the application if set to absent.| os10 | +| ``advertise.tlv`` | list | Configures TLVs advertisement at interface level (see `<interface_name>.tlv.*`) | os10 | +| ``tlv.name`` | string: basic-tlv,dcbxp,dcbxp-appln,dot1-tlv,dot3-tlv | Configures corresponding to the TLV name specified at the interface | os10 | +| ``tlv.value`` | string | Specifies corresponding TLV value according to the name as a string | os10 | +| ``tlv.state`` | string: present\*,absent | Deletes the interface level TLVs advertisement if set to absent | os10 | + + +Connection variables +-------------------- + +Ansible Dell EMC network roles require connection information to establish communication with the nodes in your inventory. This information can exist in the Ansible *group_vars* or *host_vars* directories or inventory, or in the playbook itself. + +| Key | Required | Choices | Description | +|-------------|----------|------------|-----------------------------------------------------| +| ``ansible_host`` | yes | | Specifies the hostname or address for connecting to the remote device over the specified transport | +| ``ansible_port`` | no | | Specifies the port used to build the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_PORT` option is used; it defaults to 22 | +| ``ansible_ssh_user`` | no | | Specifies the username that authenticates the CLI login for the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_USER` environment variable value is used | +| ``ansible_ssh_pass`` | no | | Specifies the password that authenticates the connection to the remote device | +| ``ansible_become`` | no | yes, no\* | Instructs the module to enter privileged mode on the remote device before sending any commands; if value is unspecified, the `ANSIBLE_BECOME` environment variable value is used, and the device attempts to execute all commands in non-privileged mode | +| ``ansible_become_method`` | no | enable, sudo\* | Instructs the module to allow the become method to be specified for handling privilege escalation; if value is unspecified, the `ANSIBLE_BECOME_METHOD` environment variable value is used | +| ``ansible_become_pass`` | no | | Specifies the password to use if required to enter privileged mode on the remote device; if ``ansible_become`` is set to no this key is not applicable | +| ``ansible_network_os`` | yes | os10, null\* | Loads the correct terminal and cliconf plugins to communicate with the remote device | + +> **NOTE**: Asterisk (\*) denotes the default value if none is specified. + + +Example playbook +---------------- + +This example uses the *os10_lldp* role to configure protocol lldp. It creates a *hosts* file with the switch details and corresponding variables. The hosts file should define the `ansible_network_os` variable with corresponding Dell EMC OS10 name. + +When `os10_cfg_generate` is set to true, the variable generates the configuration commands as a .part file in *build_dir* path. By default, the variable is set to false. It writes a simple playbook that only references the *os10_lldp* role. + +**Sample hosts file** + + leaf1 ansible_host= <ip_address> + +**Sample host_vars/leaf1** + + hostname: leaf1 + ansible_become: yes + ansible_become_method: xxxxx + ansible_become_pass: xxxxx + ansible_ssh_user: xxxxx + ansible_ssh_pass: xxxxx + ansible_network_os: dellemc.os10.os10 + build_dir: ../temp/temp_os10 + os10_lldp: + enable: false + multiplier: 3 + reinit: 2 + timer: 5 + advertise: + med: + fast_start_repeat_count: 4 + application: + - name: guest-voice + network_policy_id: 0 + vlan_id: 2 + vlan_type: tag + l2_priority: 3 + code_point_value: 4 + state: present + - name: voice + network_policy_id: 1 + vlan_id: 3 + vlan_type: untag + l2_priority: 3 + code_point_value: 4 + state: absent + local_interface: + ethernet 1/1/1: + mode: rx + mode_state: present + advertise: + med: + enable: true + tlv: inventory + tlv_state: present + application: + - network_policy_id: 4 + state: present + tlv: + - name: basic-tlv + value: management-address port-description + state: present + - name: dcbxp-appln + value: iscsi + state: present + - name: dcbxp + state: present + +**Simple playbook to setup system — leaf.yaml** + + - hosts: leaf1 + roles: + - dellemc.os10.os10_lldp + +**Run** + + ansible-playbook -i hosts leaf.yaml + +(c) 2017-2020 Dell Inc. or its subsidiaries. All rights reserved. diff --git a/ansible_collections/dellemc/os10/roles/os10_lldp/defaults/main.yml b/ansible_collections/dellemc/os10/roles/os10_lldp/defaults/main.yml new file mode 100644 index 00000000..464b4d96 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_lldp/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for dellemc.os10.os10_lldp diff --git a/ansible_collections/dellemc/os10/roles/os10_lldp/handlers/main.yml b/ansible_collections/dellemc/os10/roles/os10_lldp/handlers/main.yml new file mode 100644 index 00000000..f49343b1 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_lldp/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for dellemc.os10.os10_lldp diff --git a/ansible_collections/dellemc/os10/roles/os10_lldp/meta/main.yml b/ansible_collections/dellemc/os10/roles/os10_lldp/meta/main.yml new file mode 100644 index 00000000..7d843eed --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_lldp/meta/main.yml @@ -0,0 +1,19 @@ +# Copyright (c) 2017-2020 Dell Inc. or its subsidiaries. All Rights Reserved. +--- +galaxy_info: + author: Dell EMC Networking Engineering + description: > + The os10_lldp role facilitates the configuration of Link Layer Discovery Protocol(LLDP) attributes in devices + running Dell EMC SmartFabric OS10. + license: GPLv3 + min_ansible_version: 2.9.6 + + platforms: + - name: os10 + + galaxy_tags: + - networking + - dell + - emc + - dellemc + - os10 diff --git a/ansible_collections/dellemc/os10/roles/os10_lldp/tasks/main.yml b/ansible_collections/dellemc/os10/roles/os10_lldp/tasks/main.yml new file mode 100644 index 00000000..fc86a9d4 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_lldp/tasks/main.yml @@ -0,0 +1,16 @@ +--- +# tasks file for Dellos10 + - name: "Generating LLDP configuration for os10" + template: + src: os10_lldp.j2 + dest: "{{ build_dir }}/lldp10_{{ hostname }}.conf.part" + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") and ((os10_cfg_generate | default('False')) | bool) +# notify: save config os10 + register: generate_output + + - name: "Provisioning LLDP configuration for os10" + os10_config: + src: os10_lldp.j2 + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") +# notify: save config os10 + register: output diff --git a/ansible_collections/dellemc/os10/roles/os10_lldp/templates/os10_lldp.j2 b/ansible_collections/dellemc/os10/roles/os10_lldp/templates/os10_lldp.j2 new file mode 100644 index 00000000..6d362e21 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_lldp/templates/os10_lldp.j2 @@ -0,0 +1,195 @@ +#jinja2: trim_blocks: True,lstrip_blocks: True +{################################################### +Purpose: +Configure LLDP commands for os10 Devices. + +os10_lldp: + enable: false + multiplier: 3 + reinit: 2 + timer: 5 + advertise: + med: + fast_start_repeat_count: 4 + application: + - name: guest-voice + network_policy_id: 0 + vlan_id: 2 + vlan_type: tag + l2_priority: 3 + code_point_value: 4 + state: present + - name: voice + network_policy_id: 1 + vlan_id: 3 + vlan_type: untag + l2_priority: 3 + code_point_value: 4 + state: absent + local_interface: + ethernet 1/1/1: + mode: rx + mode_state: present + advertise: + med: + enable: true + tlv : inventory + tlv_state: present + application: + - network_policy_id: 4 + state: present + tlv: + - name: basic-tlv + value: management-address port-description + state: present + - name: dcbxp-appln + value: iscsi + state: present + - name: dcbxp + state: present + +{###############################################################################################} +{% if os10_lldp is defined and os10_lldp %} +{% for key,value in os10_lldp.items() %} + {% if key == "enable" %} + {% if value %} +lldp enable + {% else %} +no lldp enable + {% endif %} + {% elif key == "reinit" %} + {% if value %} +lldp reinit {{ value }} + {% else %} +no lldp reinit + {% endif %} + {% elif key == "multiplier" %} + {% if value %} +lldp holdtime-multiplier {{ value }} + {% else %} +no lldp holdtime-multiplier + {% endif %} + {% elif key == "timer" %} + {% if value %} +lldp timer {{ value }} + {% else %} +no lldp timer + {% endif %} + {% elif key == "advertise" %} + {% if value %} + {% for ke,valu in value.items() %} + {% if ke == "med" %} + {% if valu %} + {% for med,val in valu.items() %} + {% if med == "fast_start_repeat_count" %} + {% if val %} +lldp med fast-start-repeat-count {{ val }} + {% else %} +no lldp med fast-start-repeat-count + {% endif %} + {% elif med == "application" %} + {% if val %} + {% for item in val %} + {% if item.network_policy_id is defined and item.network_policy_id %} + {% if item.state is defined and item.state == "absent" %} +no lldp med network-policy {{ item.network_policy_id }} + {% else %} + {% if item.name is defined and item.name %} + {% if item.vlan_id is defined and item.vlan_id %} + {% if item.vlan_type is defined and item.vlan_type %} + {% if item.l2_priority is defined and item.l2_priority %} + {% if item.code_point_value is defined and item.code_point_value %} +lldp med network-policy {{ item.network_policy_id }} app {{ item.name }} vlan {{ item.vlan_id }} vlan-type {{ item.vlan_type }} priority {{ item.l2_priority }} dscp {{ item.code_point_value }} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% endif %} +{% endfor %} +{% endif %} +{% if os10_lldp is defined and os10_lldp %} +{% for key in os10_lldp.keys() %} +{% set lldp_vars = os10_lldp[key] %} +{% if key == "local_interface" %} + {% for intf in lldp_vars.keys() %} + {% set intf_vars = lldp_vars[intf] %} +interface {{ intf }} + {% if intf_vars.mode is defined and intf_vars.mode %} + {% if intf_vars.mode_state is defined and intf_vars.mode_state == "absent" %} + {% if intf_vars.mode == "rx" %} + no lldp receive + {% elif intf_vars.mode == "tx" %} + no lldp transmit + {% endif %} + {% else %} + {% if intf_vars.mode == "rx" %} + lldp receive + {% elif intf_vars.mode == "tx" %} + lldp transmit + {% endif %} + {% endif %} + {% endif %} + + {% if intf_vars.advertise is defined and intf_vars.advertise %} + {% if intf_vars.advertise.med is defined and intf_vars.advertise.med %} + {% if intf_vars.advertise.med.enable is defined %} + {% if intf_vars.advertise.med.enable %} + lldp med enable + {% else %} + lldp med disable + {% endif %} + {% endif %} + {% if intf_vars.advertise.med.tlv is defined and intf_vars.advertise.med.tlv %} + {% if intf_vars.advertise.med.tlv_state is defined and intf_vars.advertise.med.tlv_state == "absent" %} + no lldp med tlv-select {{ intf_vars.advertise.med.tlv }} + {% else %} + lldp med tlv-select {{ intf_vars.advertise.med.tlv }} + {% endif %} + {% endif %} + {% if intf_vars.advertise.med.application is defined and intf_vars.advertise.med.application %} + {% for item in intf_vars.advertise.med.application %} + {% if item.network_policy_id is defined and item.network_policy_id %} + {% if item.state is defined and item.state == "absent" %} + lldp med network-policy remove {{ item.network_policy_id }} + {% else %} + lldp med network-policy add {{ item.network_policy_id }} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% endif %} + {% if intf_vars.advertise.tlv is defined and intf_vars.advertise.tlv %} + {% for it in intf_vars.advertise.tlv %} + {% if it.name is defined and it.name %} + {% if it.state is defined and it.state == "absent" %} + {% if it.value is defined and it.value %} + no lldp tlv-select {{ it.name }} {{ it.value }} + {% else %} + no lldp tlv-select {{ it.name }} + {% endif %} + {% else %} + {% if it.value is defined and it.value %} + lldp tlv-select {{ it.name }} {{ it.value }} + {% else %} + lldp tlv-select {{ it.name }} + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% endif %} + {% endfor %} +{% endif %} +{% endfor %} +{% endif %} diff --git a/ansible_collections/dellemc/os10/roles/os10_lldp/tests/inventory.yaml b/ansible_collections/dellemc/os10/roles/os10_lldp/tests/inventory.yaml new file mode 100644 index 00000000..b1ff63e6 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_lldp/tests/inventory.yaml @@ -0,0 +1,22 @@ +--- +spine1 ansible_host=10.11.182.25 ansible_network_os="dellemc.os10.os10" +spine2 ansible_host=10.16.151.220 ansible_network_os="dellemc.os10.os10" + +leaf1 ansible_host=10.11.182.23 ansible_network_os="dellemc.os10.os10" +leaf2 ansible_host=10.11.182.16 ansible_network_os="dellemc.os10.os10" +leaf3 ansible_host=10.11.182.17 ansible_network_os="dellemc.os10.os10" +leaf4 ansible_host=10.16.148.79 ansible_network_os="dellemc.os10.os10" + +[spine] +spine1 +spine2 + +[leaf] +leaf1 +leaf2 +leaf3 +leaf4 + +[datacenter:children] +spine +leaf diff --git a/ansible_collections/dellemc/os10/roles/os10_lldp/tests/main.os10.yaml b/ansible_collections/dellemc/os10/roles/os10_lldp/tests/main.os10.yaml new file mode 100644 index 00000000..f07408ed --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_lldp/tests/main.os10.yaml @@ -0,0 +1,48 @@ +--- +# vars file for dellemc.os10.os10_lldp, +# below gives a sample configuration +# Sample variables for OS10 device +os10_lldp: + enable: false + multiplier: 3 + reinit: 2 + timer: 5 + advertise: + med: + fast_start_repeat_count: 4 + application: + - name: guest-voice + network_policy_id: 0 + vlan_id: 2 + vlan_type: tag + l2_priority: 3 + code_point_value: 4 + state: present + - name: voice + network_policy_id: 1 + vlan_id: 3 + vlan_type: untag + l2_priority: 3 + code_point_value: 4 + state: absent + local_interface: + ethernet 1/1/1: + mode: rx + mode_state: present + advertise: + med: + enable: true + tlv: inventory + tlv_state: present + application: + - network_policy_id: 4 + state: present + tlv: + - name: basic-tlv + value: management-address port-description + state: present + - name: dcbxp-appln + value: iscsi + state: present + - name: dcbxp + state: present diff --git a/ansible_collections/dellemc/os10/roles/os10_lldp/tests/test.yaml b/ansible_collections/dellemc/os10/roles/os10_lldp/tests/test.yaml new file mode 100644 index 00000000..e928c00f --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_lldp/tests/test.yaml @@ -0,0 +1,5 @@ +--- +- hosts: datacenter + connection: network_cli + roles: + - dellemc.os10.os10_lldp diff --git a/ansible_collections/dellemc/os10/roles/os10_lldp/vars/main.yml b/ansible_collections/dellemc/os10/roles/os10_lldp/vars/main.yml new file mode 100644 index 00000000..8802ce76 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_lldp/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for dellemc.os10.os10_lldp diff --git a/ansible_collections/dellemc/os10/roles/os10_logging/LICENSE b/ansible_collections/dellemc/os10/roles/os10_logging/LICENSE new file mode 100644 index 00000000..2c9b8e1f --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_logging/LICENSE @@ -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) 2020, Dell Inc. All rights reserved. + + 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) 2020, Dell Inc. All rights reserved. + 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>. diff --git a/ansible_collections/dellemc/os10/roles/os10_logging/README.md b/ansible_collections/dellemc/os10/roles/os10_logging/README.md new file mode 100644 index 00000000..c8a2dbf2 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_logging/README.md @@ -0,0 +1,97 @@ +Logging role +============ + +This role facilitates the configuration of global logging attributes, and it supports the configuration of logging servers. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. + +The Logging role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. + +Role variables +-------------- + +- Role is abstracted using the `ansible_network_os` variable that can take `dellemc.os10.os10` as the value +- If `os10_cfg_generate` is set to true, it generates the role configuration commands in a file +- Any role variable with a corresponding state variable set to absent negates the configuration of that variable +- Setting an empty value for any variable negates the corresponding configuration +- Variables and values are case-sensitive + +**os10_logging keys** + +| Key | Type | Description | Support | +|------------|---------------------------|---------------------------------------------------------|-----------------------| +| ``logging`` | list | Configures the logging server (see ``logging.*``) | os10 | +| ``logging.ip`` | string (required) | Configures the IPv4 address for the logging server (A.B.C.D format) | os10 | +| ``logging.state`` | string: absent,present\* | Deletes the logging server if set to absent | os10 | +| ``console`` | dictionary | Configures logging to the console (see ``console.*``) | os10 | +| ``console.enable`` | boolean | Enables/disables logging to the console | os10 | +| ``console.severity`` | string | Configures the minimum severity level for logging to the console | os10 | +| ``log_file`` | dictionary | Configures logging to a log file (see ``log_file.*``) | os10 | +| ``log_file.enable`` | boolean | Enables/disables logging to a log file | os10 | +| ``log_file.severity`` | string | Configures the minimum severity level for logging to a log file | os10 | +| ``source_interface`` | string | Configures the source interface for logging | os10 | + +> **NOTE**: Asterisk (_*_) denotes the default value if none is specified. + +Connection variables +-------------------- + +Ansible Dell EMC network roles require connection information to establish communication with the nodes in your inventory. This information can exist in the Ansible *group_vars* or *host_vars* directories or inventory, or in the playbook itself. + +| Key | Required | Choices | Description | +|-------------|----------|------------|-----------------------------------------------------| +| ``ansible_host`` | yes | | Specifies the hostname or address for connecting to the remote device over the specified transport | +| ``ansible_port`` | no | | Specifies the port used to build the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_PORT` option is used; it defaults to 22 | +| ``ansible_ssh_user`` | no | | Specifies the username that authenticates the CLI login for the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_USER` environment variable value is used | +| ``ansible_ssh_pass`` | no | | Specifies the password that authenticates the connection to the remote device | +| ``ansible_become`` | no | yes, no\* | Instructs the module to enter privileged mode on the remote device before sending any commands; if value is unspecified, the `ANSIBLE_BECOME` environment variable value is used, and the device attempts to execute all commands in non-privileged mode | +| ``ansible_become_method`` | no | enable, sudo\* | Instructs the module to allow the become method to be specified for handling privilege escalation; if value is unspecified, the `ANSIBLE_BECOME_METHOD` environment variable value is used | +| ``ansible_become_pass`` | no | | Specifies the password to use if required to enter privileged mode on the remote device; if ``ansible_become`` is set to no this key is not applicable | +| ``ansible_network_os`` | yes | os10, null\* | Loads the correct terminal and cliconf plugins to communicate with the remote device | + +> **NOTE**: Asterisk (\*) denotes the default value if none is specified. + + +Example playbook +---------------- + +This example uses the *os10_logging* role to completely set up logging servers. It creates a *hosts* file with the switch details and corresponding variables. The hosts file should define the `ansible_network_os` variable with corresponding Dell EMC OS10 name. + +When `os10_cfg_generate` is set to true, the variable generates the configuration commands as a .part file in *build_dir* path. By default, the variable is set to false. + +**Sample hosts file** + + leaf1 ansible_host= <ip_address> + +**Sample host_vars/leaf1** + + hostname: leaf1 + ansible_become: yes + ansible_become_method: xxxxx + ansible_become_pass: xxxxx + ansible_ssh_user: xxxxx + ansible_ssh_pass: xxxxx + ansible_network_os: dellemc.os10.os10 + build_dir: ../temp/temp_os10 + + os10_logging: + logging: + - ip: 1.1.1.1 + state: absent + console: + enable: True + severity: log-err + log_file: + enable: True + severity: log-err + source_interface: "ethernet1/1/30" + +**Simple playbook to setup logging — leaf.yaml** + + - hosts: leaf1 + roles: + - dellemc.os10.os10_logging + +**Run** + + ansible-playbook -i hosts leaf.yaml + +(c) 2017-2020 Dell Inc. or its subsidiaries. All rights reserved. diff --git a/ansible_collections/dellemc/os10/roles/os10_logging/defaults/main.yml b/ansible_collections/dellemc/os10/roles/os10_logging/defaults/main.yml new file mode 100644 index 00000000..2fbccfcd --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_logging/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for dellemc.os10.os10_logging diff --git a/ansible_collections/dellemc/os10/roles/os10_logging/handlers/main.yml b/ansible_collections/dellemc/os10/roles/os10_logging/handlers/main.yml new file mode 100644 index 00000000..b79ed93f --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_logging/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for dellemc.os10.os10_logging diff --git a/ansible_collections/dellemc/os10/roles/os10_logging/meta/main.yml b/ansible_collections/dellemc/os10/roles/os10_logging/meta/main.yml new file mode 100644 index 00000000..a9b06cab --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_logging/meta/main.yml @@ -0,0 +1,18 @@ +# Copyright (c) 2020 Dell Inc. +--- +galaxy_info: + author: Dell EMC Networking Engineering + description: The os10_logging role facilitates the configuration of logging attributes in devices running Dell EMC SmartFabric OS10. + company: Dell Technologies + license: GPLv3 + min_ansible_version: 2.9.6 + + platforms: + - name: os10 + + galaxy_tags: + - networking + - dell + - emc + - dellemc + - os10 diff --git a/ansible_collections/dellemc/os10/roles/os10_logging/tasks/main.yml b/ansible_collections/dellemc/os10/roles/os10_logging/tasks/main.yml new file mode 100644 index 00000000..91ce9e7b --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_logging/tasks/main.yml @@ -0,0 +1,16 @@ +--- +# tasks file for os10 + - name: "Generating logging configuration for os10" + template: + src: os10_logging.j2 + dest: "{{ build_dir }}/logging10_{{ hostname }}.conf.part" + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") and ((os10_cfg_generate | default('False')) | bool) +# notify: save config os10 + register: generate_output + + - name: "Provisioning logging configuration for os10" + os10_config: + src: os10_logging.j2 + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") +# notify: save config os10 + register: output diff --git a/ansible_collections/dellemc/os10/roles/os10_logging/templates/os10_logging.j2 b/ansible_collections/dellemc/os10/roles/os10_logging/templates/os10_logging.j2 new file mode 100644 index 00000000..442376b5 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_logging/templates/os10_logging.j2 @@ -0,0 +1,67 @@ +#jinja2: trim_blocks: True,lstrip_blocks: True +{############################################# +Purpose: +Configure logging commands for os10 Devices +os10_logging: + logging: + - ip: 1.1.1.1 + state: present + console: + enable: True + severity: log-err + log_file: + enable: True + severity: log-err + source_interface: "ethernet1/1/30" +###############################################} +{% if os10_logging is defined and os10_logging %} + {% for key,value in os10_logging.items() %} + {% if key == "logging" %} + {% for item in value %} + {% if item.ip is defined and item.ip %} + {% if item.state is defined and item.state == "absent" %} +no logging server {{ item.ip }} + {% else %} +logging server {{ item.ip }} + {% endif %} + {% endif %} + {% endfor %} + {% elif key == "log_file" %} + {% if value.enable is defined %} + {% if value.enable %} +logging log-file enable + {% else %} +logging log-file disable + {% endif %} + {% endif %} + {% if value.severity is defined %} + {% if value.severity %} +logging log-file severity {{ value.severity }} + {% else %} +no logging log-file severity + {% endif %} + {% endif %} + {% elif key == "console" %} + {% if value.enable is defined %} + {% if value.enable %} +logging console enable + {% else %} +logging console disable + {% endif %} + {% endif %} + {% if value.severity is defined %} + {% if value.severity %} +logging console severity {{ value.severity }} + {% else %} +no logging console severity + {% endif %} + {% endif %} + {% elif key == "source_interface" %} + {% if value %} +logging source-interface {{ value }} + {% else %} +no logging source-interface + {% endif %} + {% endif %} + {% endfor %} +{% endif %} diff --git a/ansible_collections/dellemc/os10/roles/os10_logging/tests/inventory.yaml b/ansible_collections/dellemc/os10/roles/os10_logging/tests/inventory.yaml new file mode 100644 index 00000000..d32792f7 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_logging/tests/inventory.yaml @@ -0,0 +1,22 @@ +--- +spine1 ansible_host=10.11.182.25 ansible_network_os="dellemc.os10.os10" +spine2 ansible_host=10.16.151.220 ansible_network_os="dellemc.os10.os10" + +leaf1 ansible_host=10.11.182.23 ansible_network_os="dellemc.os10.os10" +leaf2 ansible_host=10.11.182.16 ansible_network_os="dellemc.os10.os10" +leaf3 ansible_host=10.16.148.72 ansible_network_os="dellemc.os10.os10" +leaf4 ansible_host=10.16.148.79 ansible_network_os="dellemc.os10.os10" + +[spine] +spine1 +spine2 + +[leaf] +leaf1 +leaf2 +leaf3 +leaf4 + +[datacenter:children] +spine +leaf diff --git a/ansible_collections/dellemc/os10/roles/os10_logging/tests/main.os10.yaml b/ansible_collections/dellemc/os10/roles/os10_logging/tests/main.os10.yaml new file mode 100644 index 00000000..c9255b23 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_logging/tests/main.os10.yaml @@ -0,0 +1,15 @@ +--- +# vars file for dellemc.os10.os10_logging, +# below gives a sample configuration +# Sample variables for OS10 device +os10_logging: + logging: + - ip: 1.1.1.1 + state: absent + console: + enable: True + severity: log-err + log_file: + enable: True + severity: log-err + source_interface: "ethernet1/1/30" diff --git a/ansible_collections/dellemc/os10/roles/os10_logging/tests/test.yaml b/ansible_collections/dellemc/os10/roles/os10_logging/tests/test.yaml new file mode 100644 index 00000000..cb66b3a8 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_logging/tests/test.yaml @@ -0,0 +1,5 @@ +--- +- hosts: datacenter + connection: network_cli + roles: + - dellemc.os10.os10_logging diff --git a/ansible_collections/dellemc/os10/roles/os10_logging/vars/main.yml b/ansible_collections/dellemc/os10/roles/os10_logging/vars/main.yml new file mode 100644 index 00000000..736ff3b8 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_logging/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for dellemc.os10.os10_logging diff --git a/ansible_collections/dellemc/os10/roles/os10_network_validation/LICENSE b/ansible_collections/dellemc/os10/roles/os10_network_validation/LICENSE new file mode 100644 index 00000000..2c9b8e1f --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_network_validation/LICENSE @@ -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) 2020, Dell Inc. All rights reserved. + + 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) 2020, Dell Inc. All rights reserved. + 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>. diff --git a/ansible_collections/dellemc/os10/roles/os10_network_validation/README.md b/ansible_collections/dellemc/os10/roles/os10_network_validation/README.md new file mode 100644 index 00000000..e9014c42 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_network_validation/README.md @@ -0,0 +1,304 @@ +Network validation role +========================= + +This roles is used to verify network validation. It validates network features of a wiring connection, BGP neighbors, MTU between neighbors, and VLT pairing. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. The Network validation role requires an SSH connection for connectivity to a Dell EMC OS10 device. You can use any of the built-in OS connection variables. + +- **Wiring validation** — Based on the LLDP neighbor establishment, the intended neighbor input model is defined by the _group_var/all_ user which is compared with the actual LLDP neighbor; report is generated if there is any mismatch with the intended neighbors + +- **BGP validation** — Based on the BGP neighbor state establishment, report is generated if the BGP neighbor state is not in an established state + +- **MTU validation** — Based on the interface MTU, the report is generated if there is an MTU mismatch between LLDP neighbors + +- **VLT validation** — Based on the VLT information, the report is generated if the backup VLT link is down or not present + +Role variables +-------------- + +- Role is abstracted using the `ansible_network_os` variable that can take `dellemc.os10.os10` as the value +- Variables and values are case-sensitive + +**wiring_validation keys** + +| Key | Type | Description | Support | +|------------|---------------------------|---------------------------------------------------------|-----------------------| +| ``intended_neighbors`` | list | Defines topology details planned | os10 | +| ``source_switch`` | string | Defines the source switch inventory name planned | os10 | +| ``source_port`` | string | Defines the source port planned | os10 | +| ``dest_switch`` | string | Defines the destination switch inventory name planned | os10 | +| ``dest_port`` | string | Defines the destination port planned | os10 | + +**bgp_validation keys** + +| Key | Type | Description | Support | +|------------|---------------------------|---------------------------------------------------------|-----------------------| +| ``intended_bgp_neighbors`` | list | Defines topology details planned | os10 | +| ``source_switch`` | string | Defines the source switch inventory name planned | os10 | + +**vlt_validation keys** + +| Key | Type | Description | Support | +|------------|---------------------------|---------------------------------------------------------|-----------------------| +| ``intended_vlt_pairs`` | list | Defines topology details planned | os10 | +| ``primary`` | string | Defines the primary role of switch inventory name planned | os10 | +| ``secondary`` | string | Defines the secondary role of switch inventory name planned | os10 | + +Connection variables +-------------------- + +Ansible Dell EMC roles require connection information to establish communication with the nodes in your inventory. This information can exist in the Ansible _group_vars_ or _host_vars_ directories or inventory, or in the playbook itself. + +| Key | Required | Choices | Description | +|-------------|----------|------------|-----------------------------------------------------| +| ``ansible_host`` | yes | | Specifies the hostname or address for connecting to the remote device over the specified transport | +| ``ansible_port`` | no | | Specifies the port used to build the connection to the remote device; if the value is unspecified, the `ANSIBLE_REMOTE_PORT` option is used; defaults to 22 | +| ``os10_cli_user`` | no | | Specifies the username that authenticates the CLI login for the connection to the remote device; if value is unspecified, the default value is used | +| ``os10_cli_pass`` | no | | Specifies the password that authenticates the connection to the remote device | +| ``ansible_become`` | no | yes, no\* | Instructs the module to enter privileged mode on the remote device before sending any commands; if value is unspecified, the `ANSIBLE_BECOME` environment variable value is used, and the device attempts to execute all commands in non-privileged mode | +| ``ansible_become_method`` | no | enable, sudo\* | Instructs the module to allow the _become_ method to be specified for handling privilege escalation; if value is unspecified, the `ANSIBLE_BECOME_METHOD` environment variable value is used | +| ``ansible_become_pass`` | no | | Specifies the password to use, if required, to enter privileged mode on the remote device; if `ansible_become` is set to no, this key is not applicable | +| ``ansible_network_os`` | yes | os10, null\* | Loads the correct terminal and cliconf plugins to communicate with the remote device | + +> **NOTE**: Asterisk (*) denotes the default value if none is specified. + +Dependencies +------------ + +- The _xmltodict_ library should be installed to convert show command output in dictionary format from XML +- To install the package, use the pip install xmltodict command +- The *os10_fabric_summary* role must be included to query system network summary information + +Example playbook +---------------- + +This example uses the *os10_network_validation* role to verify network validations. It creates a *hosts* file with the switch details and corresponding variables. The hosts file should define the `ansible_network_os` variable with the corresponding Dell EMC OS10 name. + + +**Sample hosts file** + + site1-spine1 ansible_host=10.11.180.21 os10_cli_user=admin os10_cli_pass=admin ansible_network_os=dellemc.os10.os10 + site1-spine2 ansible_host=10.11.180.22 os10_cli_user=admin os10_cli_pass=admin ansible_network_os=dellemc.os10.os10 + site2-spine1 ansible_host=10.11.180.23 os10_cli_user=admin os10_cli_pass=admin ansible_network_os=dellemc.os10.os10 + site2-spine2 ansible_host=10.11.180.24 os10_cli_user=admin os10_cli_pass=admin ansible_network_os=dellemc.os10.os10 + [spine] + site1-spine1 + site1-spine2 + site2-spine1 + site2-spine2 + [LeafAndSpineSwitch:children] + spine + + +**Sample host_vars/site1-spine1** + + cli: + host: "{{ ansible_host }}" + username: "{{ os10_cli_user | default('admin') }}" + password: "{{ os10_cli_pass | default('admin') }}" + + os10_cli_user: xxxx + os10_cli_pass: xxxx + ansible_network_os: dellemc.os10.os10 + + +#### Sample ``group_var/all`` + +**Sample input for wiring validation** + + + intended_neighbors: + - source_switch: site1-spine2 + source_port: ethernet1/1/5 + dest_port: ethernet1/1/29 + dest_switch: site1-spine1 + - source_switch: site1-spine2 + source_port: ethernet1/1/6 + dest_port: ethernet1/1/30 + dest_switch: site1-spine1 + - source_switch: site1-spine2 + source_port: ethernet1/1/7 + dest_port: ethernet1/1/31 + dest_switch: site1-spine1 + - source_switch: site1-spine2 + source_port: ethernet1/1/8 + dest_port: ethernet1/1/32 + dest_switch: site1-spine1 + - source_switch: site1-spine2 + source_port: ethernet1/1/9 + dest_port: ethernet1/1/21 + dest_switch: site1-spine1 + - source_switch: site1-spine2 + source_port: ethernet1/1/7 + dest_port: ethernet1/1/29 + dest_switch: site1-spine3 + +**Sample input for BGP validation** + + intended_bgp_neighbors: + - source_switch: site1-spine1 + neighbor_ip: ["10.11.0.1","10.9.0.1","10.9.0.3","10.9.0.5","1.1.1.1"] + - source_switch: site1-spine2 + neighbor_ip: ["10.11.0.0","10.9.0.9","10.9.0.11","10.9.0.15"] + +**Sample input for VLT validation** + + intended_vlt_pairs: + - primary: site1-spine1 + secondary: site2-spine2 + - primary: site2-spine1 + secondary: site2-spine2 + + +#### Simple playbook to setup network validation + +**Sample playbook of ``validation.yaml`` to run complete validation** + + --- + - name: setup network validation + hosts: localhost + gather_facts: no + connection: local + roles: + - os10_network_validation + +**Sample playbook to run wiring validation** + + --- + - name: setup wiring validation + hosts: localhost + gather_facts: False + connection: local + collections: + - dellemc.os10 + tasks: + - import_role: + name: os10_network_validation + tasks_from: wiring_validation.yaml + +**Sample playbook to run BGP validation** + + --- + - name: setup bgp validation + hosts: localhost + gather_facts: False + connection: local + collections: + - dellemc.os10 + tasks: + - import_role: + name: os10_network_validation + tasks_from: bgp_validation.yaml + +**Sample playbook to run VLT validation** + + --- + - name: setup vlt validation + hosts: localhost + gather_facts: False + connection: local + collections: + - dellemc.os10 + tasks: + - import_role: + name: os10_network_validation + tasks_from: vlt_validation.yaml + +**Sample playbook to run MTU validation** + + --- + - name: setup mtu validation + hosts: localhost + gather_facts: False + connection: local + collections: + - dellemc.os10 + tasks: + - import_role: + name: os10_network_validation + tasks_from: mtu_validation.yaml + + +**Run** + +Execute the playbook and examine the results. + + ansible-playbook -i inventory.yaml validation.yaml + +**sample output of wiring validation** + + "results": [ + { + "dest_port": "ethernet1/1/1", + "dest_switch": "site2-spine2", + "error_type": "link-missing", + "reason": "link is not found for source switch: site2-spine1,port: ethernet1/1/1", + "source_port": "ethernet1/1/1", + "source_switch": "site2-spine1" + }, + { + "dest_port": "ethernet1/1/2", + "dest_switch": "site2-spine1", + "error_type": "link-mismatch", + "reason": "Destination switch is not an expected value, expected switch: site2-spine1,port: ethernet1/1/2; actual switch: site1-spine2(svc-tag:J33FXC2, node_mac:e4:f0:04:9b:eb:dc), port: ethernet1/1/1", + "source_port": "ethernet1/1/1", + "source_switch": "site1-spine1" + } + ] + +**sample output of BGP validation** + + "results": [ + { + "bgp_neighbor": "10.9.0.1", + "bgp_state": "idle", + "error_type": "remote_port_down", + "possible_reason": "remote port site2-spine1 ethernet1/1/2 is down", + "source_switch": "site1-spine1" + }, + { + "bgp_neighbor": "-", + "bgp_state": "idle", + "error_type": "not_an_intended_neighbor", + "possible_reason": "neighbor 10.9.0.7 is not an intended, please add this neighbor in the intended_bgp_neighbors", + "source_switch": "site1-spine1" + }, + { + "bgp_neighbor": "1.1.1.1", + "error_type": "config_missing", + "possible_reason": "neighbor config missing", + "source_switch": "site1-spine1" + }, + { + "bgp_neighbor": "10.9.0.9", + "bgp_state": "idle", + "error_type": "remote_port_down", + "possible_reason": "remote port site2-spine1 ethernet1/1/3 is down", + "source_switch": "site1-spine2" + } + ] + +**sample output of VLT validation** + + "results": [ + { + "error_type": "secondary_mismatch", + "intended_primary": "site1-spine1", + "intended_secondary": "site2-spine2", + "possible_reason": "config mismatch as site2-spine2 is expected, but the actual secondary is site1-spine2 ", + "secondary": "site1-spine2" + }, + { + "error_type": "peer_missing", + "intended_primary": "site2-spine1", + "intended_secondary": "site2-spine2", + "possible_reason": "peer info is not configured or peer interface is down" + } + ] + +**sample output of MTU validation** + + "msg": { + "results": "There is no MTU mistmatch between neighbors" + } + + +(c) 2017-2020 Dell Inc. or its subsidiaries. All rights reserved.
\ No newline at end of file diff --git a/ansible_collections/dellemc/os10/roles/os10_network_validation/meta/main.yml b/ansible_collections/dellemc/os10/roles/os10_network_validation/meta/main.yml new file mode 100644 index 00000000..b01fd4b1 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_network_validation/meta/main.yml @@ -0,0 +1,21 @@ +# Copyright (c) 2020 Dell Inc. or its subsidiaries. All Rights Reserved. +--- +galaxy_info: + role_name: os10_network_validation + author: Dell EMC Networking Engineering + description: The os10_network_validation role faclitates to provide the Network validation in devices running on Dell EMC SmartFabric OS10. + license: GPLv3 + min_ansible_version: 2.9.6 + + platforms: + - name: os10 + + galaxy_tags: + - networking + - dell + - emc + - dellemc + - os10 + + dependencies: + - role: os10_fabric_summary diff --git a/ansible_collections/dellemc/os10/roles/os10_network_validation/tasks/bgp_validation.yaml b/ansible_collections/dellemc/os10/roles/os10_network_validation/tasks/bgp_validation.yaml new file mode 100644 index 00000000..a289b50c --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_network_validation/tasks/bgp_validation.yaml @@ -0,0 +1,33 @@ +--- +- name: "Get Dell EMC OS10 Show ip bgp summary" + os10_command: + commands: + - command: "show ip bgp summary | display-xml" + - command: "show ip interface brief | display-xml" + provider: "{{ hostvars[item].cli }}" + with_items: "{{ groups['all'] }}" + register: show_bgp +- name: "set fact to form bgp database" + set_fact: + output_bgp: "{{ output_bgp|default([])+ [{'host': item.invocation.module_args.provider.host, 'inv_name': item.item, 'stdout_show_bgp': item.stdout.0, 'stdout_show_ip': item.stdout.1}] }}" + loop: "{{ show_bgp.results }}" +- name: call lib to convert bgp info from xml to dict format + base_xml_to_dict: + cli_responses: "{{ item.stdout_show_bgp }}" + with_items: + - "{{ output_bgp }}" + register: show_bgp_list +- name: call lib to convert ip interface info from xml to dict format + base_xml_to_dict: + cli_responses: "{{ item.stdout_show_ip }}" + with_items: + - "{{ output_bgp }}" + register: show_ip_intf_list +- name: call lib for bgp validation + bgp_validate: + show_ip_bgp: "{{ show_bgp_list.results }}" + show_ip_intf_brief: "{{ show_ip_intf_list.results }}" + bgp_neighbors: "{{ intended_bgp_neighbors }}" + register: bgp_validation_output +- name: "debug bgp database" + debug: var=bgp_validation_output.msg.results diff --git a/ansible_collections/dellemc/os10/roles/os10_network_validation/tasks/main.yaml b/ansible_collections/dellemc/os10/roles/os10_network_validation/tasks/main.yaml new file mode 100644 index 00000000..c81545b8 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_network_validation/tasks/main.yaml @@ -0,0 +1,9 @@ +--- +- name: "Validate the wiring info" + import_tasks: wiring_validation.yaml +- name: "Validate the BGP info" + import_tasks: bgp_validation.yaml +- name: "Validate the VLT info" + import_tasks: vlt_validation.yaml +- name: "Validate the MTU info for lldp neigbors" + import_tasks: mtu_validation.yaml diff --git a/ansible_collections/dellemc/os10/roles/os10_network_validation/tasks/mtu_validation.yaml b/ansible_collections/dellemc/os10/roles/os10_network_validation/tasks/mtu_validation.yaml new file mode 100644 index 00000000..fbc58538 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_network_validation/tasks/mtu_validation.yaml @@ -0,0 +1,32 @@ +--- +- name: "Get Dell EMC OS10 MTU mismatch info" + os10_command: + commands: + - command: "show lldp neighbors" + - command: "show ip interface brief | display-xml" + provider: "{{ hostvars[item].cli }}" + with_items: "{{ groups['all'] }}" + register: show_output +- name: "set fact to form database" + set_fact: + output_mtu: "{{ output_mtu|default([])+ [{'host': item.invocation.module_args.provider.host, 'inv_name': item.item, 'stdout_show_lldp': item.stdout.0, 'stdout_show_ip': item.stdout.1 }] }}" + loop: "{{ show_output.results }}" +- name: "debug the output database" + debug: var=output_mtu +- name: call lib to convert ip interface info from xml to dict format + base_xml_to_dict: + cli_responses: "{{ item.stdout_show_ip }}" + with_items: "{{ output_mtu }}" + register: show_ip_intf_list +- name: "Get Dell EMC OS10 Show system" + import_role: + name: os10_fabric_summary + register: show_system_network_summary +- name: "call lib to process" + mtu_validate: + show_lldp_neighbors_list: "{{ output_mtu }}" + show_system_network_summary: "{{ show_system_network_summary.msg.results }}" + show_ip_intf_brief: "{{ show_ip_intf_list.results }}" + register: mtu_validation +- name: "debug mtu validation result" + debug: var=mtu_validation.msg.results diff --git a/ansible_collections/dellemc/os10/roles/os10_network_validation/tasks/vlt_validation.yaml b/ansible_collections/dellemc/os10/roles/os10_network_validation/tasks/vlt_validation.yaml new file mode 100644 index 00000000..1a673e19 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_network_validation/tasks/vlt_validation.yaml @@ -0,0 +1,44 @@ +--- +- name: "Get Dell EMC OS10 Show run vlt" + os10_command: + commands: + - command: "show running-configuration vlt | grep vlt-domain" + provider: "{{ hostvars[item].cli }}" + with_items: "{{ groups['all'] }}" + register: show_run_vlt +- name: "set fact to form show vlt database" + set_fact: + output_vlt: "{{ output_vlt|default([])+ [{'host': item.invocation.module_args.provider.host, 'inv_name': item.item, 'stdout_show_vlt': item.stdout.0}] }}" + loop: "{{ show_run_vlt.results }}" +- name: "debug output_vlt" + debug: var=output_vlt +- name: "Get Dell EMC OS10 Show vlt info" + os10_command: + commands: + - command: "show vlt {{ item.stdout_show_vlt.split()[1] }} | display-xml" + provider: "{{ hostvars[item.inv_name].cli }}" + with_items: "{{ output_vlt }}" + register: show_vlt +- name: "set fact to form vlt database" + set_fact: + vlt_out: "{{ vlt_out|default([])+ [{'host': item.invocation.module_args.provider.host, 'inv_name': item.item, 'show_vlt_stdout': item.stdout.0}] }}" + loop: "{{ show_vlt.results }}" + register: vlt_output +- name: call lib to convert vlt info from xml to dict format + base_xml_to_dict: + cli_responses: "{{ item.show_vlt_stdout }}" + with_items: + - "{{ vlt_out }}" + register: vlt_dict_output +- name: "Get Dell EMC OS10 Show system" + import_role: + name: os10_fabric_summary + register: show_system_network_summary +- name: call lib to process + vlt_validate: + show_vlt: "{{ vlt_dict_output.results }}" + show_system_network_summary: "{{ show_system_network_summary.msg.results }}" + intended_vlt_pairs: "{{ intended_vlt_pairs }}" + register: show_vlt_info +- name: "debug vlt validation result" + debug: var=show_vlt_info.msg.results diff --git a/ansible_collections/dellemc/os10/roles/os10_network_validation/tasks/wiring_validation.yaml b/ansible_collections/dellemc/os10/roles/os10_network_validation/tasks/wiring_validation.yaml new file mode 100644 index 00000000..d89ac18c --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_network_validation/tasks/wiring_validation.yaml @@ -0,0 +1,24 @@ +--- +- name: "Get Dell EMC OS10 wiring info" + os10_command: + commands: + - command: "show lldp neighbors" + provider: "{{ hostvars[item].cli }}" + with_items: "{{ groups['all'] }}" + register: show_lldp +- name: "set facts to form lldp db" + set_fact: + output_lldp: "{{ output_lldp|default([])+ [{'host': item.invocation.module_args.provider.host, 'inv_name': item.item, 'stdout_show_lldp': item.stdout}] }}" + loop: "{{ show_lldp.results }}" +- name: "Get Dell EMC OS10 Show system" + import_role: + name: os10_fabric_summary + register: show_system_network_summary +- name: call lib to process + wiring_validate: + show_lldp_neighbors_list: "{{ output_lldp }}" + show_system_network_summary: "{{ show_system_network_summary.msg.results }}" + planned_neighbors: "{{ intended_neighbors }}" + register: wiring_validation +- name: "debug the wiring validation results" + debug: var=wiring_validation.msg.results diff --git a/ansible_collections/dellemc/os10/roles/os10_network_validation/tests/group_vars/all b/ansible_collections/dellemc/os10/roles/os10_network_validation/tests/group_vars/all new file mode 100644 index 00000000..01c4856e --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_network_validation/tests/group_vars/all @@ -0,0 +1,30 @@ +#wiring_validation input +intended_neighbors: + - source_switch: site1-spine1 + source_port: ethernet1/1/1 + dest_port: ethernet1/1/1 + dest_switch: site1-spine2 + - source_switch: site2-spine1 + source_port: ethernet1/1/1 + dest_port: ethernet1/1/1 + dest_switch: site2-spine2 + - source_switch: site1-spine1 + source_port: ethernet1/1/1 + dest_port: ethernet1/1/2 + dest_switch: site2-spine1 + - source_switch: site1-spine1 + source_port: ethernet1/1/2 + dest_port: ethernet1/1/2 + dest_switch: site2-spine2 +#bgp_validation input +intended_bgp_neighbors: + - source_switch: site1-spine1 + neighbor_ip: ["10.11.0.1", "10.9.0.1", "10.9.0.3", "10.9.0.5", "1.1.1.1"] + - source_switch: site1-spine2 + neighbor_ip: ["10.11.0.0", "10.9.0.9", "10.9.0.11", "10.9.0.15"] +#vlt_validation input +intended_vlt_pairs: + - primary: site1-spine1 + secondary: site1-spine2 + - primary: site2-spine1 + secondary: site2-spine2 diff --git a/ansible_collections/dellemc/os10/roles/os10_network_validation/tests/host_vars/site1-spine1 b/ansible_collections/dellemc/os10/roles/os10_network_validation/tests/host_vars/site1-spine1 new file mode 100644 index 00000000..1f450079 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_network_validation/tests/host_vars/site1-spine1 @@ -0,0 +1,11 @@ +--- +# Sample variables for OS10 device +cli: + host: "{{ ansible_host }}" + username: "{{ os10_cli_user | default('admin') }}" + password: "{{ os10_cli_pass | default('admin') }}" + timeout: 300 + +os10_cli_user: xxxx +os10_cli_pass: xxxx +ansible_network_os: dellemc.os10.os10 diff --git a/ansible_collections/dellemc/os10/roles/os10_network_validation/tests/host_vars/site1-spine2 b/ansible_collections/dellemc/os10/roles/os10_network_validation/tests/host_vars/site1-spine2 new file mode 100644 index 00000000..1f450079 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_network_validation/tests/host_vars/site1-spine2 @@ -0,0 +1,11 @@ +--- +# Sample variables for OS10 device +cli: + host: "{{ ansible_host }}" + username: "{{ os10_cli_user | default('admin') }}" + password: "{{ os10_cli_pass | default('admin') }}" + timeout: 300 + +os10_cli_user: xxxx +os10_cli_pass: xxxx +ansible_network_os: dellemc.os10.os10 diff --git a/ansible_collections/dellemc/os10/roles/os10_network_validation/tests/host_vars/site2-spine1 b/ansible_collections/dellemc/os10/roles/os10_network_validation/tests/host_vars/site2-spine1 new file mode 100644 index 00000000..1f450079 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_network_validation/tests/host_vars/site2-spine1 @@ -0,0 +1,11 @@ +--- +# Sample variables for OS10 device +cli: + host: "{{ ansible_host }}" + username: "{{ os10_cli_user | default('admin') }}" + password: "{{ os10_cli_pass | default('admin') }}" + timeout: 300 + +os10_cli_user: xxxx +os10_cli_pass: xxxx +ansible_network_os: dellemc.os10.os10 diff --git a/ansible_collections/dellemc/os10/roles/os10_network_validation/tests/host_vars/site2-spine2 b/ansible_collections/dellemc/os10/roles/os10_network_validation/tests/host_vars/site2-spine2 new file mode 100644 index 00000000..1f450079 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_network_validation/tests/host_vars/site2-spine2 @@ -0,0 +1,11 @@ +--- +# Sample variables for OS10 device +cli: + host: "{{ ansible_host }}" + username: "{{ os10_cli_user | default('admin') }}" + password: "{{ os10_cli_pass | default('admin') }}" + timeout: 300 + +os10_cli_user: xxxx +os10_cli_pass: xxxx +ansible_network_os: dellemc.os10.os10 diff --git a/ansible_collections/dellemc/os10/roles/os10_network_validation/tests/inventory.yaml b/ansible_collections/dellemc/os10/roles/os10_network_validation/tests/inventory.yaml new file mode 100644 index 00000000..d1838947 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_network_validation/tests/inventory.yaml @@ -0,0 +1,14 @@ +--- +site1-spine1 ansible_host=10.11.180.21 os10_cli_user=admin os10_cli_pass=admin ansible_network_os=dellemc.os10.os10 +site1-spine2 ansible_host=10.11.180.22 os10_cli_user=admin os10_cli_pass=admin ansible_network_os=dellemc.os10.os10 +site2-spine1 ansible_host=10.11.180.24 os10_cli_user=admin os10_cli_pass=admin ansible_network_os=dellemc.os10.os10 +site2-spine2 ansible_host=10.11.180.23 os10_cli_user=admin os10_cli_pass=admin ansible_network_os=dellemc.os10.os10 + +[spine] +site1-spine1 +site1-spine2 +site2-spine1 +site2-spine2 + +[LeafAndSpineSwitch:children] +spine diff --git a/ansible_collections/dellemc/os10/roles/os10_network_validation/tests/main.yaml b/ansible_collections/dellemc/os10/roles/os10_network_validation/tests/main.yaml new file mode 100644 index 00000000..1f450079 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_network_validation/tests/main.yaml @@ -0,0 +1,11 @@ +--- +# Sample variables for OS10 device +cli: + host: "{{ ansible_host }}" + username: "{{ os10_cli_user | default('admin') }}" + password: "{{ os10_cli_pass | default('admin') }}" + timeout: 300 + +os10_cli_user: xxxx +os10_cli_pass: xxxx +ansible_network_os: dellemc.os10.os10 diff --git a/ansible_collections/dellemc/os10/roles/os10_network_validation/tests/test.yaml b/ansible_collections/dellemc/os10/roles/os10_network_validation/tests/test.yaml new file mode 100644 index 00000000..aff21dfe --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_network_validation/tests/test.yaml @@ -0,0 +1,56 @@ +--- +# Sample playbook to validate network validation role +- name: setup network validation + hosts: localhost + gather_facts: False + connection: local + roles: + - dellemc.os10.os10_network_validation + +# Sample playbook to validate wiring validation +- name: setup play for wiring validation + hosts: localhost + gather_facts: False + connection: local + collections: + - dellemc.os10 + tasks: + - import_role: + name: os10_network_validation + tasks_from: wiring_validation.yaml + +# Sample playbook to validate bgp validation +- name: setup playbook to validate bgp validation + hosts: localhost + gather_facts: False + connection: local + collections: + - dellemc.os10 + tasks: + - import_role: + name: os10_network_validation + tasks_from: bgp_validation.yaml + +# Sample playbook to validate vlt validation +- name: setup playbook to validate vlt validation + hosts: localhost + gather_facts: False + connection: local + collections: + - dellemc.os10 + tasks: + - import_role: + name: os10_network_validation + tasks_from: vlt_validation.yaml + +# Sample playbook to validate mtu validation +- name: setup playbook to validate mtu validation + hosts: localhost + gather_facts: False + connection: local + collections: + - dellemc.os10 + tasks: + - import_role: + name: os10_network_validation + tasks_from: mtu_validation.yaml diff --git a/ansible_collections/dellemc/os10/roles/os10_ntp/LICENSE b/ansible_collections/dellemc/os10/roles/os10_ntp/LICENSE new file mode 100644 index 00000000..2c9b8e1f --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_ntp/LICENSE @@ -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) 2020, Dell Inc. All rights reserved. + + 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) 2020, Dell Inc. All rights reserved. + 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>. diff --git a/ansible_collections/dellemc/os10/roles/os10_ntp/README.md b/ansible_collections/dellemc/os10/roles/os10_ntp/README.md new file mode 100644 index 00000000..17e879c6 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_ntp/README.md @@ -0,0 +1,124 @@ +NTP role +======== + +This role facilitates the configuration of network time protocol (NTP) attributes. It specifically enables configuration of NTP server, NTP source, authentication, and broadcast service. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. + +The NTP role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. + +Role variables +-------------- + +- Role is abstracted using the `ansible_network_os` variable that can take `dellemc.os10.os10` as the value +- If `os10_cfg_generate` is set to true, the variable generates the role configuration commands in a file +- Any role variable with a corresponding state variable set to absent negates the configuration of that variable +- Setting an empty value for any variable negates the corresponding configuration +- Variables and values are case-sensitive + +**os10_ntp keys** + +| Key | Type | Description | Support | +|------------|---------------------------|---------------------------------------------------------|-----------------------| +| ``server`` | list | Configures the NTP server (see ``server.*``) | os10 | +| ``server.ip`` | string (required) | Configures an IPv4 address for the NTP server (A.B.C.D format) | os10 | +| ``server.key`` | integer | Configures the peer authentication key for the NTP server | os10 | +| ``server.prefer`` | boolean | Configures the peer preference | os10 | +| ``server.state`` | string: absent,present\* | Deletes the NTP server if set to absent | os10 | +| ``source`` | string | Configures the interface for the source address | os10 | +| ``master`` | integer | Configures the local clock to act as the server | os10 | +| ``authenticate`` | boolean | Configures authenticate time sources | os10 | +| ``authentication_key`` | list | Configures authentication key for trusted time sources (see ``authentication_key.*``) | os10 | +| ``authentication_key.key_num`` | integer | Configures authentication key number | os10 | +| ``authentication_key.key_string_type`` | integer: 0,9 | Configures hidden authentication key string if the value is 9, and configures unencrypted authentication key string if the value is 0 | os10 | +| ``authentication_key.key_string`` | string | Configures the authentication key string | os10 | +| ``authentication_key.type`` | string: md5,sha1,sha2-256 | Configures the authentication type | os10 | +| ``authentication_key.state`` | string: absent,present\* | Deletes the authenticaton key if set to absent | os10 | +| ``trusted_key`` | list | Configures key numbers for trusted time sources (see ``trusted_key.*``) | os10 | +| ``trusted_key.key_num`` | integer | Configures the key number | os10 | +| ``trusted_key.state`` | string: absent,present\* | Deletes the trusted key if set to absent | os10 | +| ``intf`` | dictionary | Configures NTP on the interface (see ``intf.*``) | os10 | +| ``intf.<interface name>`` | dictionary | Configures NTP on the interface (see ``<interface name>.*``) | os10 | +| ``<interface name>.disable`` | boolean | Configures NTP disable on the interface | os10 | +| ``<interface name>.broadcast`` | boolean | Configures NTP broadcast client service on the interface | os10 | +| ``vrf`` | dictionary | Enables NTP on VRF (see ``vrf.*``) | os10 | +| ``vrf.name`` | string | Name of the VRF to enable NTP | os10 | +| ``vrf.state`` | string: absent,present\* | Disables NTP on the VRF if set to absent | os10 | + +> **NOTE**: Asterisk (\*) denotes the default value if none is specified. + +Connection variables +-------------------- + +Ansible Dell EMC network roles require connection information to establish communication with the nodes in your inventory. This information can exist in the Ansible *group_vars* or *host_vars* directories or inventory or in the playbook itself. + +| Key | Required | Choices | Description | +|-------------|----------|------------|-------------------------------------------------------| +| ``ansible_host`` | yes | | Specifies the hostname or address for connecting to the remote device over the specified transport | +| ``ansible_port`` | no | | Specifies the port used to build the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_PORT` option is used; it defaults to 22 | +| ``ansible_ssh_user`` | no | | Specifies the username that authenticates the CLI login for the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_USER` environment variable value is used | +| ``ansible_ssh_pass`` | no | | Specifies the password that authenticates the connection to the remote device | +| ``ansible_become`` | no | yes, no\* | Instructs the module to enter privileged mode on the remote device before sending any commands; if value is unspecified, the `ANSIBLE_BECOME` environment variable value is used, and the device attempts to execute all commands in non-privileged mode | +| ``ansible_become_method`` | no | enable, sudo\* | Instructs the module to allow the become method to be specified for handling privilege escalation; if value is unspecified, the `ANSIBLE_BECOME_METHOD` environment variable value is used | +| ``ansible_become_pass`` | no | | Specifies the password to use if required to enter privileged mode on the remote device; if ``ansible_become`` is set to no this key is not applicable | +| ``ansible_network_os`` | yes | os10, null\* | Loads the correct terminal and cliconf plugins to communicate with the remote device | + +> **NOTE**: Asterisk (\*) denotes the default value if none is specified. + + +Example playbook +---------------- + +This example uses the *os10_ntp* role to set the NTP server, source ip, authentication and broadcast service. It creates a *hosts* file with the switch details and corresponding variables. The hosts file should define the `ansible_network_os` variable with corresponding Dell EMC OS10 name. + +When the `os10_cfg_generate` variable is set to true, it generates the configuration commands as a .part file in *build_dir* path. By default it is set to false. The example writes a simple playbook that only references the *os10_ntp* role. + +By including the role, you automatically get access to all of the tasks to configure NTP attributes. The sample *host_vars* is for os10. + +**Sample hosts file** + + leaf1 ansible_host= <ip_address> + +**Sample host_vars/leaf1** + + host: leaf1 + ansible_ssh_user: xxxxx + ansible_ssh_pass: xxxxx + ansible_network_os: dellemc.os10.os10 + build_dir: ../temp/os10 + + os10_ntp: + source: ethernet 1/1/2 + master: 5 + authenticate: true + authentication_key: + - key_num: 123 + key_string_type: 9 + key_string: test + type: md5 + state: present + trusted_key: + - key_num: 1323 + state: present + server: + - ip: 2.2.2.2 + key: 345 + prefer: true + state: present + intf: + ethernet 1/1/2: + disable: true + broadcast: true + vrf: + name: red + state: present + +**Simple playbook to setup NTP — leaf.yaml** + + - hosts: leaf1 + roles: + - dellemc.os10.os10_ntp + +**Run** + + ansible-playbook -i hosts leaf.yaml + +(c) 2017-2020 Dell Inc. or its subsidiaries. All rights reserved. diff --git a/ansible_collections/dellemc/os10/roles/os10_ntp/defaults/main.yml b/ansible_collections/dellemc/os10/roles/os10_ntp/defaults/main.yml new file mode 100644 index 00000000..7d2d8eee --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_ntp/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for dellemc.os10.os10_ntp diff --git a/ansible_collections/dellemc/os10/roles/os10_ntp/handlers/main.yml b/ansible_collections/dellemc/os10/roles/os10_ntp/handlers/main.yml new file mode 100644 index 00000000..965f50b5 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_ntp/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for dellemc.os10.os10_ntp diff --git a/ansible_collections/dellemc/os10/roles/os10_ntp/meta/main.yml b/ansible_collections/dellemc/os10/roles/os10_ntp/meta/main.yml new file mode 100644 index 00000000..3befe0cd --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_ntp/meta/main.yml @@ -0,0 +1,18 @@ +# Copyright (c) 2020 Dell Inc. +--- +galaxy_info: + author: Dell EMC Networking Engineering + description: The os10_ntp role facilitates the configuration of NTP attributes in devices running Dell EMC SmartFabric OS10. + company: Dell Technologies + license: GPLv3 + min_ansible_version: 2.9.6 + + platforms: + - name: os10 + + galaxy_tags: + - networking + - dell + - emc + - dellemc + - os10 diff --git a/ansible_collections/dellemc/os10/roles/os10_ntp/tasks/main.yml b/ansible_collections/dellemc/os10/roles/os10_ntp/tasks/main.yml new file mode 100644 index 00000000..202e5601 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_ntp/tasks/main.yml @@ -0,0 +1,41 @@ +--- +# tasks file for os10 + - name: "Generating NTP configuration for os10" + template: + src: os10_ntp.j2 + dest: "{{ build_dir }}/ntp10_{{ hostname }}.conf.part" + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") and ((os10_cfg_generate | default('False')) | bool) +# notify: save config os10 + register: generate_output + + - name: "Provisioning NTP configuration for os10" + os10_config: + src: os10_ntp.j2 + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") +# notify: save config os10 + register: output + + - name: "Generating NTP VRF configuration for os10" + lineinfile: + path: "{{ build_dir }}/ntp10_{{ hostname }}.conf.part" + line: "{{ lookup('template', 'os10_ntp_vrf.j2') }}" + insertafter: EOF + when: > + (ansible_network_os is defined and + ansible_network_os == "dellemc.os10.os10" and + ((os10_cfg_generate | default('False')) | bool) and + os10_ntp.vrf is defined and + os10_ntp.vrf) + + - name: "Provisioning NTP VRF configuration for os10" + os10_config: + lines: + - command: "{{ lookup('template', 'os10_ntp_vrf.j2') }}" + prompt: "Do you want to continue" + answer: "yes" + when: > + (ansible_network_os is defined and + ansible_network_os == "dellemc.os10.os10" and + os10_ntp.vrf is defined and + os10_ntp.vrf) +# notify: save config os10 diff --git a/ansible_collections/dellemc/os10/roles/os10_ntp/templates/os10_ntp.j2 b/ansible_collections/dellemc/os10/roles/os10_ntp/templates/os10_ntp.j2 new file mode 100644 index 00000000..7524c935 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_ntp/templates/os10_ntp.j2 @@ -0,0 +1,125 @@ +#jinja2: trim_blocks: True,lstrip_blocks: True +{############################################# +Purpose: +Configure NTP commands for os10 Devices +os10_ntp: + source: ethernet 1/1/2 + master: 5 + authenticate: true + vrf: + name: red + authentication_key: + - key_num: 123 + key_string_type: 7 + key_string: test + type: md5 + state: present + trusted_key: + - key_num: 1323 + state: present + server: + - ip: 2.2.2.2 + key: 345 + prefer: true + state: present + intf: + ethernet 1/1/2: + disable: true + broadcast: true +###############################################} +{% if os10_ntp is defined and os10_ntp %} + {% if os10_ntp.source is defined %} + {% if os10_ntp.source %} +ntp source {{ os10_ntp.source }} + {% else %} +no ntp source + {% endif %} + {% endif %} + {% if os10_ntp.master is defined %} + {% if os10_ntp.master %} +ntp master {{ os10_ntp.master }} + {% else %} +no ntp master + {% endif %} + {% endif %} + {% if os10_ntp.authenticate is defined %} + {% if os10_ntp.authenticate %} +ntp authenticate + {% else %} +no ntp authenticate + {% endif %} + {% endif %} + {% if os10_ntp.server is defined and os10_ntp.server %} + {% for item in os10_ntp.server %} + {% if item.ip is defined and item.ip %} + {% if item.state is defined and item.state == "absent" %} +no ntp server {{ item.ip }} + {% else %} + {% if item.key is defined and item.key %} + {% if item.prefer is defined and item.prefer %} +ntp server {{ item.ip }} key {{ item.key }} prefer + {% else %} +ntp server {{ item.ip }} key {{ item.key }} + {% endif %} + {% else %} + {% if item.prefer is defined and item.prefer %} +ntp server {{ item.ip }} prefer + {% else %} +ntp server {{ item.ip }} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% if os10_ntp.authentication_key is defined and os10_ntp.authentication_key %} + {% for item in os10_ntp.authentication_key %} + {% if item.key_num is defined and item.key_num %} + {% if item.state is defined and item.state == "absent" %} +no ntp authentication-key {{ item.key_num }} + {% else %} + {% if item.key_string_type is defined and item.key_string_type >= 0 %} + {% if item.key_string is defined and item.key_string %} + {% if item.type is defined and item.type %} + {% set auth_type = item.type %} + {% else %} + {% set auth_type = 'md5' %} + {% endif%} +ntp authentication-key {{ item.key_num }} {{ auth_type }} {{ item.key_string_type }} {{ item.key_string }} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% if os10_ntp.trusted_key is defined and os10_ntp.trusted_key %} + {% for item in os10_ntp.trusted_key %} + {% if item.key_num is defined and item.key_num %} + {% if item.state is defined and item.state == "absent" %} +no ntp trusted-key {{ item.key_num }} + {% else %} +ntp trusted-key {{ item.key_num }} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% if os10_ntp.intf is defined and os10_ntp.intf %} + {% for key in os10_ntp.intf.keys() %} +interface {{ key }} + {% if os10_ntp.intf[key].disable is defined %} + {% if os10_ntp.intf[key].disable %} + ntp disable + {% else %} + no ntp disable + {% endif %} + {% endif %} + {% if os10_ntp.intf[key].broadcast is defined %} + {% if os10_ntp.intf[key].broadcast %} + ntp broadcast client + {% else %} + no ntp broadcast client + {% endif %} + {% endif %} + {% endfor %} + {% endif %} +{% endif %} diff --git a/ansible_collections/dellemc/os10/roles/os10_ntp/templates/os10_ntp_vrf.j2 b/ansible_collections/dellemc/os10/roles/os10_ntp/templates/os10_ntp_vrf.j2 new file mode 100644 index 00000000..d2e12a39 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_ntp/templates/os10_ntp_vrf.j2 @@ -0,0 +1,18 @@ +#jinja2: trim_blocks: True,lstrip_blocks: True +{############################################# +Purpose: +Configure NTP VRF for os10 Devices +os10_ntp: + vrf: + name: red + state: present +###############################################} +{% if os10_ntp is defined and os10_ntp %} + {% if os10_ntp.vrf is defined and os10_ntp.vrf.name is defined %} + {% if os10_ntp.vrf.state is defined and os10_ntp.vrf.state == "absent" %} +no ntp enable vrf {{ os10_ntp.vrf.name }} + {% else %} +ntp enable vrf {{ os10_ntp.vrf.name }} + {% endif%} + {% endif %} +{% endif %} diff --git a/ansible_collections/dellemc/os10/roles/os10_ntp/tests/inventory b/ansible_collections/dellemc/os10/roles/os10_ntp/tests/inventory new file mode 100644 index 00000000..85a255f9 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_ntp/tests/inventory @@ -0,0 +1,2 @@ +--- +localhost diff --git a/ansible_collections/dellemc/os10/roles/os10_ntp/tests/main.os10.yaml b/ansible_collections/dellemc/os10/roles/os10_ntp/tests/main.os10.yaml new file mode 100644 index 00000000..cc2a9b09 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_ntp/tests/main.os10.yaml @@ -0,0 +1,25 @@ +--- +# vars file for dellemc.os10.os10_ntp, +# below gives a sample configuration +# Sample variables for OS10 device +os10_ntp: + source: ethernet 1/1/2 + master: 5 + authenticate: true + authentication_key: + - key_num: 123 + key_string_type: 0 + key_string: test + state: present + trusted_key: + - key_num: 1323 + state: present + server: + - ip: 2.2.2.2 + key: 345 + prefer: true + state: present + intf: + ethernet 1/1/2: + disable: true + broadcast: true diff --git a/ansible_collections/dellemc/os10/roles/os10_ntp/tests/test.yml b/ansible_collections/dellemc/os10/roles/os10_ntp/tests/test.yml new file mode 100644 index 00000000..dce69c7b --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_ntp/tests/test.yml @@ -0,0 +1,5 @@ +--- +- hosts: localhost + connection: network_cli + roles: + - dellemc.os10.os10_ntp diff --git a/ansible_collections/dellemc/os10/roles/os10_ntp/vars/main.yml b/ansible_collections/dellemc/os10/roles/os10_ntp/vars/main.yml new file mode 100644 index 00000000..e90d53c0 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_ntp/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for dellemc.os10.os10_ntp diff --git a/ansible_collections/dellemc/os10/roles/os10_prefix_list/LICENSE b/ansible_collections/dellemc/os10/roles/os10_prefix_list/LICENSE new file mode 100644 index 00000000..2c9b8e1f --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_prefix_list/LICENSE @@ -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) 2020, Dell Inc. All rights reserved. + + 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) 2020, Dell Inc. All rights reserved. + 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>. diff --git a/ansible_collections/dellemc/os10/roles/os10_prefix_list/README.md b/ansible_collections/dellemc/os10/roles/os10_prefix_list/README.md new file mode 100644 index 00000000..dce141e8 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_prefix_list/README.md @@ -0,0 +1,104 @@ +Prefix-list role +================ + +This role facilitates the configuration of a prefix-list. It supports the configuration of an IP prefix-list, and assigns the prefix-list to line terminals. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. + +The prefix-list role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. + +Role variables +-------------- + +- Role is abstracted using the `ansible_network_os` variable that can take `dellemc.os10.os10` value +- If `os10_cfg_generate` set to true, the variable generates the role configuration commands in a file +- Any role variable with a corresponding state variable set to absent negates the configuration of that variable +- Setting an empty value for any variable negates the corresponding configuration +- Variables and values are case-sensitive + +**os10_prefix_list keys** + +| Key | Type | Description | Support | +|------------|---------------------------|---------------------------------------------------------|-----------------------| +| ``type`` | string (required): ipv4,ipv6 | Configures an L3 (IPv4/IPv6) prefix-list | os10 | +| ``name`` | string (required) | Configures the prefix-list name | os10 | +| ``description`` | string | Configures the prefix-list description | os10 | +| ``entries`` | list | Configures rules in the prefix-list (see ``seqlist.*``) | os10 | +| ``entries.number`` | int (required) | Specifies the sequence number of the prefix-list rule | os10 | +| ``entries.permit`` | boolean (required): true,false | Specifies the rule to permit packets if set to true, and specifies to reject packets if set to false | os10 | +| ``entries.net_num`` | string (required) | Specifies the network number | os10 | +| ``entries.mask`` | string (required) | Specifies the mask | os10 | +| ``entries.condition_list`` | list | Configures conditions to filter packets (see ``condition_list.*``)| os10 | +| ``condition_list.condition`` | list | Specifies the condition to filter packets from the source address | os10 | +| ``condition_list.prelen`` | string (required) | Specifies the allowed prefix length | os10 | +| ``entries.state`` | string: absent,present\* | Deletes the rule from the prefix-list if set to absent | os10 | +| ``state`` | string: absent,present\* | Deletes the prefix-list if set to absent | os10 | + +> **NOTE**: Asterisk (\*) denotes the default value if none is specified. + +Connection variables +-------------------- + +Ansible Dell EMC network roles require connection information to establish communication with the nodes in your inventory. This information can exist in the Ansible *group_vars* or *host_vars* directories, or inventory or in the playbook itself. + +| Key | Required | Choices | Description | +|-------------|----------|------------|-----------------------------------------------------| +| ``ansible_host`` | yes | | Specifies the hostname or address for connecting to the remote device over the specified transport | +| ``ansible_port`` | no | | Specifies the port used to build the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_PORT` option is used; it defaults to 22 | +| ``ansible_ssh_user`` | no | | Specifies the username that authenticates the CLI login for the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_USER` environment variable value is used | +| ``ansible_ssh_pass`` | no | | Specifies the password that authenticates the connection to the remote device | +| ``ansible_become`` | no | yes, no\* | Instructs the module to enter privileged mode on the remote device before sending any commands; if value is unspecified, the `ANSIBLE_BECOME` environment variable value is used, and the device attempts to execute all commands in non-privileged mode | +| ``ansible_become_method`` | no | enable, sudo\* | Instructs the module to allow the become method to be specified for handling privilege escalation; if value is unspecified, the `ANSIBLE_BECOME_METHOD` environment variable value is used | +| ``ansible_become_pass`` | no | | Specifies the password to use if required to enter privileged mode on the remote device; if ``ansible_become`` is set to no this key is not applicable | +| ``ansible_network_os`` | yes | os10, null\* | Loads the correct terminal and cliconf plugins to communicate with the remote device | + +> **NOTE**: Asterisk (\*) denotes the default value if none is specified. + + +Example playbook +---------------- + +This example uses the *os10_prefix_list* role to configure prefix-list for both IPv4 and IPv6. It creates a *hosts* file with the switch details and corresponding variables. The hosts file should define the `ansible_network_os` variable with corresponding Dell EMC OS10 name. + +When `os10_cfg_generate` is set to true, the variable generates the configuration commands as a .part file in *build_dir* path. By default, the variable is set to false. It writes a simple playbook that only references the *os10_prefix_list* role. + +**Sample hosts file** + + leaf1 ansible_host= <ip_address> + +**Sample host_vars/leaf1** + + hostname: leaf1 + ansible_become: yes + ansible_become_method: xxxxx + ansible_become_pass: xxxxx + ansible_ssh_user: xxxxx + ansible_ssh_pass: xxxxx + ansible_network_os: dellemc.os10.os10 + build_dir: ../temp/temp_os10 + os10_prefix_list: + - name: testpl + type: ipv4 + description: pl + entries: + - number: 19 + permit: true + net_num: 20.0.0.0 + mask: 16 + condition_list: + - condition: ge + prelen: 17 + - condition: le + prelen: 18 + state: present + state: present + +**Simple playbook to setup system — leaf.yaml** + + - hosts: leaf1 + roles: + - dellemc.os10.os10_prefix_list + +**Run** + + ansible-playbook -i hosts leaf.yaml + +(c) 2017-2020 Dell Inc. or its subsidiaries. All rights reserved. diff --git a/ansible_collections/dellemc/os10/roles/os10_prefix_list/defaults/main.yml b/ansible_collections/dellemc/os10/roles/os10_prefix_list/defaults/main.yml new file mode 100644 index 00000000..8d218029 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_prefix_list/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for dellemc.os10.os10_prefix_list diff --git a/ansible_collections/dellemc/os10/roles/os10_prefix_list/handlers/main.yml b/ansible_collections/dellemc/os10/roles/os10_prefix_list/handlers/main.yml new file mode 100644 index 00000000..72b64726 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_prefix_list/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for dellemc.os10.os10_prefix_list diff --git a/ansible_collections/dellemc/os10/roles/os10_prefix_list/meta/.galaxy_install_info b/ansible_collections/dellemc/os10/roles/os10_prefix_list/meta/.galaxy_install_info new file mode 100644 index 00000000..ccddfc42 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_prefix_list/meta/.galaxy_install_info @@ -0,0 +1 @@ +{install_date: 'Fri Mar 10 15:35:29 2017', version: v1.0.1} diff --git a/ansible_collections/dellemc/os10/roles/os10_prefix_list/meta/main.yml b/ansible_collections/dellemc/os10/roles/os10_prefix_list/meta/main.yml new file mode 100644 index 00000000..287ff507 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_prefix_list/meta/main.yml @@ -0,0 +1,16 @@ +# Copyright (c) 2017-2020 Dell Inc. +--- +galaxy_info: + author: Dell EMC Networking Engineering + description: The os10_prefix_list role facilitates the configuration of prefix list attributes in devices running Dell EMC SmartFabric OS10. + license: GPLv3 + min_ansible_version: 2.9.6 + + platforms: + - name: os10 + + galaxy_tags: + - networking + - dell + - emc + - dellemc diff --git a/ansible_collections/dellemc/os10/roles/os10_prefix_list/tasks/main.yml b/ansible_collections/dellemc/os10/roles/os10_prefix_list/tasks/main.yml new file mode 100644 index 00000000..449b80ba --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_prefix_list/tasks/main.yml @@ -0,0 +1,16 @@ +--- +# tasks file for os10 + - name: "Generating prefix list configuration for os10" + template: + src: os10_prefix_list.j2 + dest: "{{ build_dir }}/prefixlist10_{{ hostname }}.conf.part" + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") and ((os10_cfg_generate | default('False')) | bool) +# notify: save config os10 + register: generate_output + + - name: "Provisioning prefix list configuration for os10" + os10_config: + src: os10_prefix_list.j2 + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") +# notify: save config os10 + register: output diff --git a/ansible_collections/dellemc/os10/roles/os10_prefix_list/templates/os10_prefix_list.j2 b/ansible_collections/dellemc/os10/roles/os10_prefix_list/templates/os10_prefix_list.j2 new file mode 100644 index 00000000..fe598331 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_prefix_list/templates/os10_prefix_list.j2 @@ -0,0 +1,95 @@ +#jinja2: trim_blocks: True,lstrip_blocks: True +{#################################### +Purpose: +Configure pl on OS10 devices +os10_prefix_list: + - name: testpl + type: ipv4 + description: pl + entries: + - number: 19 + permit: true + net_num: 20.0.0.0 + mask: 16 + condition_list: + - condition: ge + prelen: 17 + - condition: le + prelen: 18 + state: present + state: present +#####################################} +{% if (os10_prefix_list is defined and os10_prefix_list) %} + {% for val in os10_prefix_list %} + {% if val.name is defined and val.name %} + {% if val.state is defined and val.state == "absent" %} + {% if val.type is defined and val.type == "ipv4" %} +no ip prefix-list {{ val.name }} + {% elif val.type is defined and val.type == "ipv6" %} +no ipv6 prefix-list {{ val.name }} + {% endif %} + {% else %} + {% if val.type is defined and val.type == "ipv4" %} + {% set ip = "ip" %} + {% elif val.type is defined and val.type == "ipv6" %} + {% set ip = "ipv6" %} + {% endif %} + {% if val.description is defined %} + {% if val.description %} +{{ ip }} prefix-list {{ val.name }} description {{ val.description }} + {% else %} +no {{ ip }} prefix-list {{ val.name }} description {{ val.description }} + {% endif %} + {% endif %} + {% if val.entries is defined and val.entries %} + {% for rule in val.entries %} + {% if rule.number is defined and rule.number %} + {% if rule.state is defined %} + {% if rule.state == "absent" %} +no {{ ip }} prefix-list {{ val.name }} seq {{ rule.number }} + {% else %} + {% if rule.permit is defined %} + {% if rule.permit %} + {% set is_permit = "permit" %} + {% else %} + {% set is_permit = "deny" %} + {% endif %} + {% endif %} + {% if rule.net_num is defined and rule.net_num %} + {% if rule.mask is defined %} + {% if rule.mask or rule.mask == 0 %} + {% if rule.condition_list is defined and rule.condition_list %} + {% set condition_string = [' '] %} + {% set item = "" %} + {% if rule.condition_list | length > 1 %} + {% for condition in rule.condition_list %} + {% if rule.condition_list[0].condition == "ge" and rule.condition_list[1].condition == "le" %} + {% set item = condition_string[0] + condition.condition + ' ' + condition.prelen|string + ' ' %} + {% endif %} + {% if condition_string.insert(0,item) %} {% endif %} + {% endfor %} + {% else %} + {% for condition in rule.condition_list %} + {% if rule.condition_list[0].condition == "ge" or rule.condition_list[0].condition == "le" %} + {% set item = condition_string[0] + condition.condition + ' ' + condition.prelen|string + ' ' +%} + {% endif %} + {% if condition_string.insert(0,item) %} {% endif %} + {% endfor %} + {% endif %} +{{ ip }} prefix-list {{ val.name }} seq {{ rule.number }} {{ is_permit }} {{ rule.net_num }}/{{ rule.mask }}{{ condition_string[0] }} + {% else %} +{{ ip }} prefix-list {{ val.name }} seq {{ rule.number}} {{ is_permit }} {{ rule.net_num }}/{{ rule.mask }} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% endif %} + {% endif %} + {% endfor %} +{% endif %} diff --git a/ansible_collections/dellemc/os10/roles/os10_prefix_list/tests/inventory.yaml b/ansible_collections/dellemc/os10/roles/os10_prefix_list/tests/inventory.yaml new file mode 100644 index 00000000..b1ff63e6 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_prefix_list/tests/inventory.yaml @@ -0,0 +1,22 @@ +--- +spine1 ansible_host=10.11.182.25 ansible_network_os="dellemc.os10.os10" +spine2 ansible_host=10.16.151.220 ansible_network_os="dellemc.os10.os10" + +leaf1 ansible_host=10.11.182.23 ansible_network_os="dellemc.os10.os10" +leaf2 ansible_host=10.11.182.16 ansible_network_os="dellemc.os10.os10" +leaf3 ansible_host=10.11.182.17 ansible_network_os="dellemc.os10.os10" +leaf4 ansible_host=10.16.148.79 ansible_network_os="dellemc.os10.os10" + +[spine] +spine1 +spine2 + +[leaf] +leaf1 +leaf2 +leaf3 +leaf4 + +[datacenter:children] +spine +leaf diff --git a/ansible_collections/dellemc/os10/roles/os10_prefix_list/tests/main.os10.yaml b/ansible_collections/dellemc/os10/roles/os10_prefix_list/tests/main.os10.yaml new file mode 100644 index 00000000..3e8250fd --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_prefix_list/tests/main.os10.yaml @@ -0,0 +1,20 @@ +--- +# vars file for dellemc.os10.os10_prefix_list, +# below gives a sample configuration +# Sample variables for OS10 device +os10_prefix_list: + - name: testpl + type: ipv4 + description: pl + entries: + - number: 19 + permit: true + net_num: 20.0.0.0 + mask: 16 + condition_list: + - condition: ge + prelen: 17 + - condition: le + prelen: 18 + state: present + state: present diff --git a/ansible_collections/dellemc/os10/roles/os10_prefix_list/tests/test.yaml b/ansible_collections/dellemc/os10/roles/os10_prefix_list/tests/test.yaml new file mode 100644 index 00000000..46fb739a --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_prefix_list/tests/test.yaml @@ -0,0 +1,5 @@ +--- +- hosts: datacenter + connection: network_cli + roles: + - dellemc.os10.os10_prefix_list diff --git a/ansible_collections/dellemc/os10/roles/os10_prefix_list/vars/main.yml b/ansible_collections/dellemc/os10/roles/os10_prefix_list/vars/main.yml new file mode 100644 index 00000000..bcff7f3f --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_prefix_list/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for dellemc.os10.os10_prefix_list diff --git a/ansible_collections/dellemc/os10/roles/os10_qos/LICENSE b/ansible_collections/dellemc/os10/roles/os10_qos/LICENSE new file mode 100644 index 00000000..2c9b8e1f --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_qos/LICENSE @@ -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) 2020, Dell Inc. All rights reserved. + + 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) 2020, Dell Inc. All rights reserved. + 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>. diff --git a/ansible_collections/dellemc/os10/roles/os10_qos/README.md b/ansible_collections/dellemc/os10/roles/os10_qos/README.md new file mode 100644 index 00000000..58415970 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_qos/README.md @@ -0,0 +1,90 @@ +QoS role +======== + +This role facilitates the configuration quality of service (QoS) attributes like policy-map and class-map. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. + +The QoS role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. + +Role variables +-------------- + +- Role is abstracted using the `ansible_network_os` variable that can take `dellemc.os10.os10` as the value +- If `os10_cfg_generate` is set to true, the variable generates the role configuration commands in a file +- Any role variable with a corresponding state variable set to absent negates the configuration of that variable +- Setting an empty value for any variable negates the corresponding configuration +- Variables and values are case-sensitive + +**os10_qos keys** + +| Key | Type | Description | Support | +|------------|---------------------------|---------------------------------------------------------|-----------------------| +| ``policy_map`` | list | Configures the policy-map (see ``policy_map.*``) | os10 | +| ``policy_map.name`` | string (required) | Configures the policy-map name | os10 | +| ``policy_map.type`` | string: qos\*, application, control-plane, network-qos, queuing in os10 | Configures the policy-map type | os10 | +| ``policy_map.state`` | string: present\*,absent | Deletes the policy-map if set to absent | os10 | +| ``class_map`` | list | Configures the class-map (see ``class_map.*``) | os10 | +| ``class_map.name`` | string (required) | Configures the class-map name | os10 | +| ``class_map.type`` | string: qos\*,application,control-plane,network-qos,queuing | Configures the class-map type | os10 | +| ``class_map.state`` | string: present\*,absent | Deletes the class-map if set to absent | os10 | + +> **NOTE**: Asterisk (\*) denotes the default value if none is specified. + +Connection variables +-------------------- + +Ansible Dell EMC network roles require connection information to establish communication with the nodes in your inventory. This information can exist in the Ansible *group_vars* or *host_vars* directories, or inventory or in the playbook itself. + +| Key | Required | Choices | Description | +|-------------|----------|------------|-----------------------------------------------------| +| ``ansible_host`` | yes | | Specifies the hostname or address for connecting to the remote device over the specified transport | +| ``ansible_port`` | no | | Specifies the port used to build the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_PORT` option is used; it defaults to 22 | +| ``ansible_ssh_user`` | no | | Specifies the username that authenticates the CLI login for the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_USER` environment variable value is used | +| ``ansible_ssh_pass`` | no | | Specifies the password that authenticates the connection to the remote device | +| ``ansible_become`` | no | yes, no\* | Instructs the module to enter privileged mode on the remote device before sending any commands; if value is unspecified, the `ANSIBLE_BECOME` environment variable value is used, and the device attempts to execute all commands in non-privileged mode | +| ``ansible_become_method`` | no | enable, sudo\* | Instructs the module to allow the become method to be specified for handling privilege escalation; if value is unspecified, the `ANSIBLE_BECOME_METHOD` environment variable value is used | +| ``ansible_become_pass`` | no | | Specifies the password to use if required to enter privileged mode on the remote device; if ``ansible_become`` is set to no this key is not applicable | +| ``ansible_network_os`` | yes | os10, null\* | Loads the correct terminal and cliconf plugins to communicate with the remote device | + +> **NOTE**: Asterisk (\*) denotes the default value if none is specified. + + +Example playbook +---------------- + +This example uses the *os10_qos* role to configure the policy-map class-map. It creates a *hosts* file with the switch details and corresponding variables. The hosts file should define the `ansible_network_os` variable with corresponding Dell EMC OS10 name. + +When `os10_cfg_generate` is set to true, the variable generates the configuration commands as a .part file in *build_dir* path. By default, the variable is set to false. It writes a simple playbook that only references the *os10_qos* role. By including the role, you automatically get access to all of the tasks to configure QoS features. + +**Sample hosts file** + + leaf1 ansible_host= <ip_address> + +**Sample host_vars/leaf1** + + hostname: leaf1 + ansible_ssh_user: xxxxx + ansible_ssh_pass: xxxxx + ansible_network_os: dellemc.os10.os10 + build_dir: ../temp/os10 + + os10_qos: + policy_map: + - name: testpolicy + type: qos + state: present + class_map: + - name: testclass + type: application + state: present + +**Simple playbook to setup qos — leaf.yaml** + + - hosts: leaf1 + roles: + - Dell-Networking.os10.os10_qos + +**Run** + + ansible-playbook -i hosts leaf.yaml + +(c) 2017-2020 Dell Inc. or its subsidiaries. All rights reserved. diff --git a/ansible_collections/dellemc/os10/roles/os10_qos/defaults/main.yml b/ansible_collections/dellemc/os10/roles/os10_qos/defaults/main.yml new file mode 100644 index 00000000..447b4329 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_qos/defaults/main.yml @@ -0,0 +1,5 @@ +--- +# defaults file for os10_qos +match_type: + match_all: match-all + match_any: match-any diff --git a/ansible_collections/dellemc/os10/roles/os10_qos/handlers/main.yml b/ansible_collections/dellemc/os10/roles/os10_qos/handlers/main.yml new file mode 100644 index 00000000..43fd82c7 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_qos/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for os10_qos diff --git a/ansible_collections/dellemc/os10/roles/os10_qos/meta/main.yml b/ansible_collections/dellemc/os10/roles/os10_qos/meta/main.yml new file mode 100644 index 00000000..0b07e1d9 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_qos/meta/main.yml @@ -0,0 +1,17 @@ +# Copyright (c) 2017-2020 Dell Inc. or its subsidiaries. All Rights Reserved. +--- +galaxy_info: + author: Dell EMC Networking Engineering + description: The os10_qos role facilitates the configuration of qos attributes in devices running Dell EMC SmartFabric OS10. + license: GPLv3 + min_ansible_version: 2.9.6 + + platforms: + - name: os10 + + galaxy_tags: + - networking + - dell + - emc + - dellemc + - os10 diff --git a/ansible_collections/dellemc/os10/roles/os10_qos/tasks/main.yml b/ansible_collections/dellemc/os10/roles/os10_qos/tasks/main.yml new file mode 100644 index 00000000..6921f69a --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_qos/tasks/main.yml @@ -0,0 +1,16 @@ +--- +# tasks file for Dellos10 + - name: "Provisioning Qos configuration for os10" + os10_config: + src: os10_qos.j2 + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") +# notify: save config os10 + register: output + + - name: "Generating Qos configuration for os10" + template: + src: os10_qos.j2 + dest: "{{ build_dir }}/qos10_{{ hostname }}.conf.part" + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") and ((os10_cfg_generate | default('False')) | bool) +# notify: save config os10 + register: generate_output diff --git a/ansible_collections/dellemc/os10/roles/os10_qos/templates/os10_qos.j2 b/ansible_collections/dellemc/os10/roles/os10_qos/templates/os10_qos.j2 new file mode 100644 index 00000000..a94c5415 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_qos/templates/os10_qos.j2 @@ -0,0 +1,48 @@ +#jinja2: trim_blocks: True,lstrip_blocks: True +{##################################################### +Purpose: +Configure qos commands for os10 Devices. +os10_qos: + policy_map: + - name: testpolicy + type: qos + state: present + class_map: + - name: testclass + type: application + state: present +#####################################################} +{% if os10_qos is defined and os10_qos %} +{% for key in os10_qos.keys() %} + {% if key =="policy_map" %} + {% for vars in os10_qos[key] %} + {% if vars.name is defined and vars.name %} + {% if vars.state is defined and vars.state == "absent" %} +no policy-map {{ vars.name }} + {% else %} + {% if vars.type is defined and vars.type %} +policy-map type {{ vars.type }} {{ vars.name }} + {% else %} +policy-map type qos {{ vars.name }} + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + {% elif key =="class_map" %} + {% for vars in os10_qos[key] %} + {% if vars.name is defined and vars.name %} + {% if vars.state is defined and vars.state == "absent" %} +no class-map {{ vars.name }} + {% else %} + {% if vars.type is defined and vars.type %} +class-map type {{ vars.type }} {{ vars.name }} + {% else %} +class-map type qos {{ vars.name }} + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + + {% endif %} +{% endfor %} +{% endif %} diff --git a/ansible_collections/dellemc/os10/roles/os10_qos/tests/inventory b/ansible_collections/dellemc/os10/roles/os10_qos/tests/inventory new file mode 100644 index 00000000..85a255f9 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_qos/tests/inventory @@ -0,0 +1,2 @@ +--- +localhost diff --git a/ansible_collections/dellemc/os10/roles/os10_qos/tests/main.os10.yaml b/ansible_collections/dellemc/os10/roles/os10_qos/tests/main.os10.yaml new file mode 100644 index 00000000..191d94ce --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_qos/tests/main.os10.yaml @@ -0,0 +1,11 @@ +--- +# Sample variables for OS10 device +os10_qos: + policy_map: + - name: testpolicy + type: qos + state: present + class_map: + - name: testclas + type: qos + state: present diff --git a/ansible_collections/dellemc/os10/roles/os10_qos/tests/test.yml b/ansible_collections/dellemc/os10/roles/os10_qos/tests/test.yml new file mode 100644 index 00000000..4107ee81 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_qos/tests/test.yml @@ -0,0 +1,5 @@ +--- +- hosts: localhost + connection: network_cli + roles: + - os10_qos diff --git a/ansible_collections/dellemc/os10/roles/os10_qos/vars/main.yml b/ansible_collections/dellemc/os10/roles/os10_qos/vars/main.yml new file mode 100644 index 00000000..ecee178e --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_qos/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for os10_qos diff --git a/ansible_collections/dellemc/os10/roles/os10_raguard/LICENSE b/ansible_collections/dellemc/os10/roles/os10_raguard/LICENSE new file mode 100644 index 00000000..2c9b8e1f --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_raguard/LICENSE @@ -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) 2020, Dell Inc. All rights reserved. + + 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) 2020, Dell Inc. All rights reserved. + 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>. diff --git a/ansible_collections/dellemc/os10/roles/os10_raguard/README.md b/ansible_collections/dellemc/os10/roles/os10_raguard/README.md new file mode 100644 index 00000000..abf7cf4a --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_raguard/README.md @@ -0,0 +1,126 @@ +IPv6 RA uard role +=================== + +This role facilitates the configuration of IPv6 RA Guard attributes. It specifically enables configuration of IPv6 RA Guard feature enable/disable, IPv6 RA Guard policy definition and policy parameter configuration, and attachment of IPv6 RA Guard policy to an interface. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. + +The IPv6 RA Guard role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. + +Role variables +-------------- + +- Role is abstracted using the `ansible_network_os` variable that can take `dellemc.os10.os10` as the value +- If `os10_cfg_generate` is set to true, the variable generates the role configuration commands in a file +- Any role variable with a corresponding state variable set to absent negates the configuration of that variable +- Setting an empty value for any variable negates the corresponding configuration +- Variables and values are case-sensitive + +**os10_raguard keys** + + +| Key | Type | Description |Support | +|--------------------------------------|-------------------------|----------------------------------------------------------|---------| +| ``enable`` | boolean | Enables IPv6 RA-Guard feature | os10 | +| ``policy`` | list | Configures the IPv6 RA Guard policy (see ``policy.*``) | os10 | +| ``policy.state`` | string: absent/present\*| Deletes the policy if set to absent | os10 | +| ``policy.name`` | string (required) | Configures the IPv6 RA Guard policy name | os10 | +| ``policy.device_role.value`` | string (required) | Configures the device role for a policy | os10 | +| ``policy.device_role.state`` | string: absent,present\*| Deletes the device role if set to absent | os10 | +| ``policy.managed_config_flag.value`` | string | Configures the managed config flag param for a policy | os10 | +| ``policy.managed_config_flag.state`` | string: absent,present\*| Deletes the managed config flag if set to absent | os10 | +| ``policy.other_config_flag.value`` | string | Configures the other config flag param for a policy | os10 | +| ``policy.other_config_flag.state`` | string: absent,present\*| Deletes the other config flag if set to absent | os10 | +| ``policy.mtu.value`` | integer | Configures the MTU param for a policy | os10 | +| ``policy.mtu.state`` | string: absent,present\*| Deletes the MTU if set to absent | os10 | +| ``policy.reachable_time.value`` | integer | Configures the reachable time param for a policy | os10 | +| ``policy.reachable_time.state`` | string: absent,present\*| Deletes the reachable time if set to absent | os10 | +| ``policy.retrans_timer.value`` | integer | Configures the retransmit timer param for a policy | os10 | +| ``policy.retrans_timer.state`` | string: absent,present\*| Deletes the retransmit timer if set to absent | os10 | +| ``policy.router_lifetime.value`` | integer | Configures the router lifetime param for a policy | os10 | +| ``policy.router_lifetime.state`` | string: absent,present\*| Deletes the router lifetime if set to absent | os10 | +| ``policy.router_preference.value`` | string | Configures the router preference param for a policy | os10 | +| ``policy.router_preference.state`` | string: absent,present\*| Deletes the router preference if set to absent | os10 | +| ``policy.match`` | list | Configures the prefix/ACL/MAC list param for a policy | os10 | +| ``policy.match.type`` | string | Configures the prefix/ACL/MAC type for a policy | os10 | +| ``policy.match.name`` | string | Configures the prefix/ACL/MAC name for a policy | os10 | +| ``policy.match.state`` | string: absent,present\*| Deletes the prefix/ACL/MAC if set to absent | os10 | +| ``intf`` | dictionary | Configures IPv6 RA Guard on the interface (see``intf.*``) | os10 | +| ``intf.<interface name>`` | dictionary | Configures RA Guard on the interface (see``<interface name>.*``)| os10 | +| ``<interface name>.policy_name`` | String | Configures RA Guard policy name to be attached on an interface | os10 | +| ``<interface name>.vlan`` | String | Configures VLAN name to which policy to be attached on an interface| os10| +| ``<interface name>.state`` | String: absent,present\*| Deletes the policy if set to absent an interface | os10| + +> **NOTE**: Asterisk (\*) denotes the default value if none is specified. + +Connection variables +-------------------- + +Ansible Dell EMC network roles require connection information to establish communication with the nodes in your inventory. This information can exist in the Ansible *group_vars* or *host_vars* directories or inventory or in the playbook itself. + +| Key | Required | Choices | Description | +|-------------|----------|------------|-------------------------------------------------------| +| ``ansible_host`` | yes | | Specifies the hostname or address for connecting to the remote device over the specified transport | +| ``ansible_port`` | no | | Specifies the port used to build the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_PORT` option is used; it defaults to 22 | +| ``ansible_ssh_user`` | no | | Specifies the username that authenticates the CLI login for the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_USER` environment variable value is used | +| ``ansible_ssh_pass`` | no | | Specifies the password that authenticates the connection to the remote device | +| ``ansible_become`` | no | yes, no\* | Instructs the module to enter privileged mode on the remote device before sending any commands; if value is unspecified, the `ANSIBLE_BECOME` environment variable value is used, and the device attempts to execute all commands in non-privileged mode | +| ``ansible_become_method`` | no | enable, sudo\* | Instructs the module to allow the become method to be specified for handling privilege escalation; if value is unspecified, the `ANSIBLE_BECOME_METHOD` environment variable value is used | +| ``ansible_become_pass`` | no | | Specifies the password to use if required to enter privileged mode on the remote device; if ``ansible_become`` is set to no this key is not applicable | +| ``ansible_network_os`` | yes | os10, null\* | Loads the correct terminal and cliconf plugins to communicate with the remote device | + +> **NOTE**: Asterisk (\*) denotes the default value if none is specified. + + +Example playbook +---------------- + +This example uses the *os10_raguard* role to configure the IPv6 RA Guard feature enable/disable, IPv6 RA Guard Policy defination and policy parameter configuration, Attachment of IPv6 RA Guard policy to an interface. It creates a *hosts* file with the switch details and corresponding variables. The hosts file should define the `ansible_network_os` variable with corresponding Dell EMC OS10 name. + +When `os10_cfg_generate` is set to true, it generates the configuration commands as a .part file in *build_dir* path. By default it is set to false. The example writes a simple playbook that only references the *os10_raguard* role. By including the role, you automatically get access to all of the tasks to configure IPv6 RA Guard attributes. + +**Sample hosts file** + + leaf1 ansible_host= <ip_address> + +**Sample host_vars/leaf1** + + host: leaf1 + ansible_ssh_user: xxxxx + ansible_ssh_pass: xxxxx + ansible_network_os: dellemc.os10.os10 + build_dir: ../temp/os10 + + os10_raguard: + enable: true + policy: + - policy_name: test + device_role: + value: router + state: present + managed_config_flag: + value: "on" + state: present + mtu: + value: 1280 + state: present + match: + - type: prefix_list + name: test_prefix + state: present + state: present + intf: + ethernet 1/1/2: + policy_name: test + vlan: 10 + state: present + +**Simple playbook to setup IPv6 RA Guard — leaf.yaml** + + - hosts: leaf1 + roles: + - dellemc.os10.os10_raguard + +**Run** + + ansible-playbook -i hosts leaf.yaml + +(c) 2017-2020 Dell Inc. or its subsidiaries. All rights reserved. diff --git a/ansible_collections/dellemc/os10/roles/os10_raguard/defaults/main.yml b/ansible_collections/dellemc/os10/roles/os10_raguard/defaults/main.yml new file mode 100644 index 00000000..57e6cf6b --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_raguard/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for dellemc.os10.os10_raguard diff --git a/ansible_collections/dellemc/os10/roles/os10_raguard/handlers/main.yml b/ansible_collections/dellemc/os10/roles/os10_raguard/handlers/main.yml new file mode 100644 index 00000000..5b69a797 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_raguard/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for dellemc.os10.os10_raguard diff --git a/ansible_collections/dellemc/os10/roles/os10_raguard/meta/main.yml b/ansible_collections/dellemc/os10/roles/os10_raguard/meta/main.yml new file mode 100644 index 00000000..1093615d --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_raguard/meta/main.yml @@ -0,0 +1,18 @@ +# Copyright (c) 2020 Dell Inc. +--- +galaxy_info: + author: Dell EMC Networking Engineering + description: The os10_raguard role facilitates the configuration of IPv6 RA Guard attributes in devices running Dell EMC SmartFabric OS10. + company: Dell Technologies + license: GPLv3 + min_ansible_version: 2.9.6 + + platforms: + - name: os10 + + galaxy_tags: + - networking + - dell + - emc + - dellemc + - os10 diff --git a/ansible_collections/dellemc/os10/roles/os10_raguard/tasks/main.yml b/ansible_collections/dellemc/os10/roles/os10_raguard/tasks/main.yml new file mode 100644 index 00000000..f2ccf55a --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_raguard/tasks/main.yml @@ -0,0 +1,17 @@ +--- +# tasks file for dellemc.os10.os10_raguard +# tasks file for os10 + - name: "Generating IPv6 RA Guard configuration for os10" + template: + src: os10_raguard.j2 + dest: "{{ build_dir }}/raguard10_{{ hostname }}.conf.part" + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") and ((os10_cfg_generate | default('False')) | bool) +# notify: save config os10 + register: generate_output + + - name: "Provisioning IPv6 RA Guard configuration for os10" + os10_config: + src: os10_raguard.j2 + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") +# notify: save config os10 + register: output diff --git a/ansible_collections/dellemc/os10/roles/os10_raguard/templates/os10_raguard.j2 b/ansible_collections/dellemc/os10/roles/os10_raguard/templates/os10_raguard.j2 new file mode 100644 index 00000000..7abc27d0 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_raguard/templates/os10_raguard.j2 @@ -0,0 +1,174 @@ +#jinja2: trim_blocks: True,lstrip_blocks: True +{############################################# +Purpose: +Configure IPv6 RA Guard commands for OS10 Devices +os10_raguard: + enable: true + policy: + - policy_name: test + device_role: + value: router + state: present + managed_config_flag: + value: "on" + state: present + other_config_flag: + value: "on" + state: present + mtu: + value: 1280 + state: present + reachable_time: + value: 100 + state: present + retrans_timer: + value: 100 + state: present + router_lifetime: + value: 10 + state: present + router_preference: + value: high + state: present + match: + - type: prefix_list + name: test_prefix + state: present + - type: access_list + name: test_access + state: present + - type: mac_list + name: test_mac + state: present + state: present + intf: + ethernet 1/1/2: + policy_name: test + vlan: 10 + state: present + ethernet 1/1/3: + policy_name: test + vlan: all + state: present + ethernet 1/1/4: + policy_name: test + vlan: 10,11,12,15 + state: present +###############################################} +{% if os10_raguard is defined and os10_raguard %} + {% if os10_raguard.enable is defined %} + {% if os10_raguard.enable %} +ipv6 nd ra-guard enable + {% else %} +no ipv6 nd ra-guard enable + {% endif %} + {% endif %} + {% if os10_raguard.policy is defined and os10_raguard.policy %} + {% for item in os10_raguard.policy %} + {% if item.policy_name is defined and item.policy_name %} + {% if item.state is defined and item.state == "absent" %} +no ipv6 nd ra-guard policy {{ item.policy_name }} + {% else %} +ipv6 nd ra-guard policy {{ item.policy_name }} + {% if item.device_role is defined and item.device_role %} + {% if item.device_role.state is defined and item.device_role.state == "absent" %} +no device-role {{ item.device_role }} + {% else %} +device-role {{ item.device_role.value }} + {% endif %} + {% endif %} + {% if item.device_role is defined and item.device_role.value == "router" %} + {% if item.managed_config_flag is defined and item.managed_config_flag %} + {% if item.managed_config_flag.state is defined and item.managed_config_flag.state == "absent" %} +no managed-config-flag {{ item.managed_config_flag.value }} + {% else %} +managed-config-flag {{ item.managed_config_flag.value }} + {% endif %} + {% endif %} + {% if item.other_config_flag is defined and item.other_config_flag %} + {% if item.other_config_flag.state is defined and item.other_config_flag.state == "absent" %} +no other-config-flag {{ item.other_config_flag.value }} + {% else %} +other-config-flag {{ item.other_config_flag.value }} + {% endif %} + {% endif %} + {% if item.mtu is defined and item.mtu %} + {% if item.mtu.state is defined and item.mtu.state == "absent" %} +no mtu {{ item.mtu.value }} + {% else %} +mtu {{ item.mtu.value }} + {% endif %} + {% endif %} + {% if item.reachable_time is defined and item.reachable_time %} + {% if item.reachable_time.state is defined and item.reachable_time.state == "absent" %} +no reachable-time {{ item.reachable_time.value }} + {% else %} +reachable-time {{ item.reachable_time.value }} + {% endif %} + {% endif %} + {% if item.retrans_timer is defined and item.retrans_timer %} + {% if item.retrans_timer.state is defined and item.retrans_timer.state == "absent" %} +no retrans-timer {{ item.retrans_timer.value }} + {% else %} +retrans-timer {{ item.retrans_timer.value }} + {% endif %} + {% endif %} + {% if item.router_lifetime is defined and item.router_lifetime %} + {% if item.router_lifetime.state is defined and item.router_lifetime.state == "absent" %} +no router-lifetime {{ item.router_lifetime.value }} + {% else %} +router-lifetime {{ item.router_lifetime.value }} + {% endif %} + {% endif %} + {% if item.router_preference is defined and item.router_preference %} + {% if item.router_preference.state is defined and item.router_preference.state == "absent" %} +no router-preference maximum + {% else %} +router-preference maximum {{ item.router_preference.value }} + {% endif %} + {% endif %} + {% if item.match is defined and item.match %} + {% for item1 in item.match %} + {% if item1.type is defined %} + {% if item1.type == "prefix_list" %} + {% if item1.state is defined and item1.state == "absent" %} +no match ra ipv6-prefix-list {{ item1.name }} + {% else %} +match ra ipv6-prefix-list {{ item1.name }} + {% endif %} + {% endif %} + {% if item1.type == "access_list" %} + {% if item1.state is defined and item1.state == "absent" %} +no match ra ipv6-access-list {{ item1.name }} + {% else %} +match ra ipv6-access-list {{ item1.name }} + {% endif %} + {% endif %} + {% if item1.type == "mac_list" %} + {% if item1.state is defined and item1.state == "absent" %} +no match ra mac-access-list {{ item1.name }} + {% else %} +match ra mac-access-list {{ item1.name }} + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% if os10_raguard.intf is defined and os10_raguard.intf %} + {% for key in os10_raguard.intf.keys() %} +interface {{ key }} + {% if os10_raguard.intf[key].policy_name is defined and os10_raguard.intf[key].policy_name %} + {% if os10_raguard.intf[key].state is defined and os10_raguard.intf[key].state == "absent" %} +no ipv6 nd ra-guard attach-policy {{ os10_raguard.intf[key].policy_name }} vlan {{ os10_raguard.intf[key].vlan }} + {% else %} +ipv6 nd ra-guard attach-policy {{ os10_raguard.intf[key].policy_name }} vlan {{ os10_raguard.intf[key].vlan }} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} +{% endif %} diff --git a/ansible_collections/dellemc/os10/roles/os10_raguard/tests/inventory.yaml b/ansible_collections/dellemc/os10/roles/os10_raguard/tests/inventory.yaml new file mode 100644 index 00000000..85a255f9 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_raguard/tests/inventory.yaml @@ -0,0 +1,2 @@ +--- +localhost diff --git a/ansible_collections/dellemc/os10/roles/os10_raguard/tests/main.os10.yaml b/ansible_collections/dellemc/os10/roles/os10_raguard/tests/main.os10.yaml new file mode 100644 index 00000000..3d1548c7 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_raguard/tests/main.os10.yaml @@ -0,0 +1,56 @@ +--- +# vars file for dellemc.os10.os10_raguard, +# below gives a sample configuration +# Sample variables for OS10 device +os10_raguard: + enable: true + policy: + - policy_name: test + device_role: + value: router + state: present + managed_config_flag: + value: "on" + state: present + other_config_flag: + value: "on" + state: present + mtu: + value: 1280 + state: present + reachable_time: + value: 100 + state: present + retrans_timer: + value: 100 + state: present + router_lifetime: + value: 10 + state: present + router_preference: + value: high + state: present + match: + - type: prefix_list + name: test_prefix + state: present + - type: access_list + name: test_access + state: present + - type: mac_list + name: test_mac + state: present + state: present + intf: + ethernet 1/1/2: + policy_name: test + vlan: 10 + state: present + ethernet 1/1/3: + policy_name: test + vlan: all + state: present + ethernet 1/1/4: + policy_name: test + vlan: 10,11,12,15 + state: present diff --git a/ansible_collections/dellemc/os10/roles/os10_raguard/tests/test.yaml b/ansible_collections/dellemc/os10/roles/os10_raguard/tests/test.yaml new file mode 100644 index 00000000..7ae62a2c --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_raguard/tests/test.yaml @@ -0,0 +1,5 @@ +--- +- hosts: localhost + connection: network_cli + roles: + - dellemc.os10.os10_raguard diff --git a/ansible_collections/dellemc/os10/roles/os10_raguard/vars/main.yml b/ansible_collections/dellemc/os10/roles/os10_raguard/vars/main.yml new file mode 100644 index 00000000..172b49cf --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_raguard/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for dellemc.os10.os10_raguard diff --git a/ansible_collections/dellemc/os10/roles/os10_route_map/LICENSE b/ansible_collections/dellemc/os10/roles/os10_route_map/LICENSE new file mode 100644 index 00000000..2c9b8e1f --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_route_map/LICENSE @@ -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) 2020, Dell Inc. All rights reserved. + + 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) 2020, Dell Inc. All rights reserved. + 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>. diff --git a/ansible_collections/dellemc/os10/roles/os10_route_map/README.md b/ansible_collections/dellemc/os10/roles/os10_route_map/README.md new file mode 100644 index 00000000..1160ca48 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_route_map/README.md @@ -0,0 +1,190 @@ +Route-map role +============== + +This role facilitates the configuration of route-map attributes. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. + +The route-map role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. + +Role variables +-------------- + +- Role is abstracted using the `ansible_network_os` variable that can take `dellemc.os10.os10` as the value +- If `os10_cfg_generate` is set to true, the variable generates the role configuration commands in a file +- Any role variable with a corresponding state variable set to absent negates the configuration of that variable +- Setting an empty value for any variable negates the corresponding configuration +- Variables and values are case-sensitive + +**os10_route_map keys** + +| Key | Type | Description | Support | +|------------|---------------------------|---------------------------------------------------------|-----------------------| +| ``route_map`` | list | Configures the route-map (see ``route_map.*``) | os10 | +| ``route_map.name`` | string (required) | Configures the route-map name | os10 | +| ``route_map.permit`` | boolean | Configures permit/deny set operations | os10 | +| ``route_map.seq_num`` | integer | Configures the sequence number | os10 | +| ``route_map.continue`` | integer | Configures the next sequence number | os10 | +| ``route_map.set`` | dictionary | Configures route-map to set values in the destination routing protocol (see ``set.*``) | os10 | +| ``set.local_pref`` | integer | Configures the BGP local preference path attribute | os10 | +| ``set.metric`` | string | Configures a specific value to add or subtract from the existing metric value ("+ <value>", "- <value>", <value> format) | os10 | +| ``set.metric_type`` | string: internal,type-1,type-2 | Configures the metric type for the destination routing protocol | os10 | +| ``set.origin`` | string: igp,egp,incomplete | Configures the BGP origin attribute | os10 | +| ``set.weight`` | integer | Configures the weight for the BGP route | os10 | +| ``set.comm_list`` | dictionary | Configures the BGP community list (see ``comm_list.*``) | os10 | +| ``comm_list.add`` | string | Adds the community attribute of a BGP update | os10 | +| ``comm_list.delete`` | string | Deletes a community attribute of a BGP update | os10 | +| ``set.community`` | string | Configures the community attribute for a BGP route update | os10 | +| ``set.extcomm_list`` | dictionary | Configures the BGP extcommunity list (see ``extcomm_list.*``) | os10 | +| ``extcomm_list.add`` | string | Adds an extended community attribute of a BGP update | os10 | +| ``extcomm_list.delete`` | string | Deletes the extended community attribute of a BGP update | os10 | +| ``set.extcommunity`` | string | Configures the extended community attribute for a BGP route update | os10 | +| ``set.next_hop`` | list | Configures the next-hop address (see ``next_hop.*``) | os10 | +| ``next_hop.type`` | string: ip,ipv6 | Configures the type of the next-hop address | os10 | +| ``next_hop.address`` | string | Configures the next-hop address | os10 | +| ``next_hop.track_id`` | integer | Configures the object track ID | os10 | +| ``next_hop.state`` | string: present\*,absent | Deletes the next-hop address if set to absent | os10 | +| ``route_map.match`` | list | Configures the route-map to match values from the route table (see ``match.*``) | os10 | +| ``match.ip_type`` | string (required): ipv4,ipv6 | Configures the IPv4/IPv6 address to match | os10 | +| ``match.access_group`` | string | Configures the access-group or list to match | os10 | +| ``match.source_protocol_ebgp`` | string | Configures the source protocol to eBGP to match | os10 | +| ``match.source_protocol_ibgp`` | string | Configures the source protocol to iBGP to match | os10 | +| ``match.source_protocol_evpn`` | string | Configures the source protocol to EVPN to match | os10 | +| ``match.source_protocol_static`` | string | Configures the source protocol to static to match | os10 | +| ``match.source_protocol_connected`` | string | Configures the source protocol to connected to match | os10 | +| ``match.source_protocol_ospf`` | string | Configures the source protocol to OSPF to match | os10 | +| ``match.prefix_list`` | string | Configures the IP prefix-list to match against | os10 | +| ``route_map.state`` | string, choices: present\*,absent | Deletes the route-map if set to absent | os10 | +| ``as_path`` | list | Configures the BGP AS path filter (see ``as_path.*``) | os10 | +| ``as_path.access_list`` | string (required) | Configures the access-list name | os10 | +| ``as_path.permit`` | boolean (required) | Configures an AS path to accept or reject | os10 | +| ``as_path.regex``| string (required) | Configures a regular expression | os10 | +| ``as_path.state`` | string: absent,present\* | Deletes the BGP as path filter if set to absent | os10 | +| ``community_list`` | list | Configures a community list entry (see ``community_list.*``) | os10 | +| ``community_list.type`` | string (required): standard,expanded | Configures the type of community-list entry | os10 | +| ``community_list.name`` | string (required) | Configures the name of community-list entry | os10 | +| ``community_list.permit`` | boolean(required) | Configures the community to accept or reject | os10 | +| ``community_list.regex`` | string (required) | Configures the regular expression for extended community list; mutually exclusive with *community_list.community* | os10 | +| ``community_list.community`` | string (required) | Configures a well-known community or community number for standard community list; mutually exclusive with *community_list.regex* | os10 | +| ``community_list.state`` | string: absent,present\* | Deletes the community list entry if set to absent | os10 | +| ``extcommunity_list`` | list | Configures extcommunity-list entry (see ``extcommunity_list.*``) | os10 | +| ``extcommunity_list.type`` | string (required): standard,expanded | Configures the type of extcommunity-list entry | os10 | +| ``extcommunity_list.name`` | string (required) | Configures the name of extcommunity-list entry | os10 | +| ``extcommunity_list.permit`` | boolean(required) | Configures the extcommunity to accept or reject | os10 | +| ``extcommunity_list.regex`` | string (required) | Configures the regular expression for the extended extcommunity list; mutually exclusive with *extcommunity_list.community* | os10 | +| ``extcommunity_list.community`` | string (required) | Configures the extended community for standard community-list; mutually exclusive with *extcommunity_list.regex* | os10 | +| ``extcommunity_list.state`` | string: absent,present\* | Deletes the extcommunity-list entry if set to absent | os10 | + +> **NOTE**: Asterisk (\*) denotes the default value if none is specified. + +Connection variables +-------------------- + +Ansible Dell EMC network roles require connection information to establish communication with the nodes in your inventory. This information can exist in the Ansible *group_vars* or *host_vars* directories, or inventory or in the playbook itself. + +| Key | Required | Choices | Description | +|-------------|----------|------------|-----------------------------------------------------| +| ``ansible_host`` | yes | | Specifies the hostname or address for connecting to the remote device over the specified transport | +| ``ansible_port`` | no | | Specifies the port used to build the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_PORT` option is used; it defaults to 22 | +| ``ansible_ssh_user`` | no | | Specifies the username that authenticates the CLI login for the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_USER` environment variable value is used | +| ``ansible_ssh_pass`` | no | | Specifies the password that authenticates the connection to the remote device | +| ``ansible_become`` | no | yes, no\* | Instructs the module to enter privileged mode on the remote device before sending any commands; if value is unspecified, the `ANSIBLE_BECOME` environment variable value is used, and the device attempts to execute all commands in non-privileged mode | +| ``ansible_become_method`` | no | enable, sudo\* | Instructs the module to allow the become method to be specified for handling privilege escalation; if value is unspecified, the `ANSIBLE_BECOME_METHOD` environment variable value is used | +| ``ansible_become_pass`` | no | | Specifies the password to use if required to enter privileged mode on the remote device; if ``ansible_become`` is set to no this key is not applicable | +| ``ansible_network_os`` | yes | os10, null\* | Loads the correct terminal and cliconf plugins to communicate with the remote device | + +> **NOTE**: Asterisk (\*) denotes the default value if none is specified. + + +Example playbook +---------------- + +This example uses the *os10_route_map* role for the route-map, policy-map, and class-map. It creates a *hosts* file with the switch details and corresponding variables. The hosts file should define the `ansible_network_os` variable with corresponding Dell EMC OS10 name. + +When `os10_cfg_generate` is set to true, the variable generates the configuration commands as a .part file in *build_dir* path. By default, the variable is set to false. It writes a simple playbook that only references the *os10_route_map* role. By including the role, you automatically get access to all of the tasks to configure route-map features. + +**Sample hosts file** + + leaf1 ansible_host= <ip_address> + +**Sample host_vars/leaf1** + + hostname: leaf1 + ansible_ssh_user: xxxxx + ansible_ssh_pass: xxxxx + ansible_network_os: dellemc.os10.os10 + build_dir: ../temp/os10 + + os10_route_map: + as_path: + - access_list: aa + permit: true + regex: www + state: present + community_list: + - type: expanded + name: qq + permit: true + regex: aaa + state: present + - type: standard + name: qqq + permit: false + community: internet + state: present + extcommunity_list: + - type: expanded + name: qq + permit: true + regex: aaa + state: present + - type: standard + name: qqq + permit: false + community: "rt 22:33" + state: present + route_map: + - name: test + permit: true + seq_num: 1 + continue: 20 + match: + - ip_type: ipv4 + access_group: testaccess + prefix_list: testprefix + source_protocol_ebgp: present + source_protocol_ibgp: present + source_protocol_evpn: present + source_protocol_static: present + source_protocol_ospf: present + source_protocol_connected: present + set: + local_pref: 1200 + metric_type: internal + metric: + 30 + origin: igp + weight: 50 + next_hop: + - type: ip + address: 10.1.1.1 + track_id: 3 + state: present + community: internet + comm_list: + add: qq + delete: qqq + extcommunity: "22:33" + extcomm_list: + add: aa + delete: aa + state: present + +**Simple playbook to setup QoS —leaf.yaml** + + - hosts: leaf1 + roles: + - dellemc.os10.os10_route_map + +**Run** + + ansible-playbook -i hosts leaf.yaml + +(c) 2017-2020 Dell Inc. or its subsidiaries. All rights reserved. diff --git a/ansible_collections/dellemc/os10/roles/os10_route_map/defaults/main.yml b/ansible_collections/dellemc/os10/roles/os10_route_map/defaults/main.yml new file mode 100644 index 00000000..a78d55b8 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_route_map/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for dellemc.os10.os10_route_map diff --git a/ansible_collections/dellemc/os10/roles/os10_route_map/handlers/main.yml b/ansible_collections/dellemc/os10/roles/os10_route_map/handlers/main.yml new file mode 100644 index 00000000..ef0b4531 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_route_map/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for dellemc.os10.os10_route_map diff --git a/ansible_collections/dellemc/os10/roles/os10_route_map/meta/main.yml b/ansible_collections/dellemc/os10/roles/os10_route_map/meta/main.yml new file mode 100644 index 00000000..b73ddcef --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_route_map/meta/main.yml @@ -0,0 +1,17 @@ +# Copyright (c) 2020 Dell Inc. +--- +galaxy_info: + author: Dell EMC Networking Engineering + description: The os10_route_map role facilitates the configuration of route map attributes in devices running Dell EMC SmartFabric OS10. + license: GPLv3 + min_ansible_version: 2.9.6 + + platforms: + - name: os10 + + galaxy_tags: + - networking + - dell + - emc + - os10 + - dellemc diff --git a/ansible_collections/dellemc/os10/roles/os10_route_map/tasks/main.yml b/ansible_collections/dellemc/os10/roles/os10_route_map/tasks/main.yml new file mode 100644 index 00000000..62c94bdd --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_route_map/tasks/main.yml @@ -0,0 +1,16 @@ +--- +# tasks file for os10 + - name: "Provisioning route-map configuration for os10" + os10_config: + src: os10_route_map.j2 + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") +# notify: save config os10 + register: output + + - name: "Generating route map configuration for os10" + template: + src: os10_route_map.j2 + dest: "{{ build_dir }}/routemap10_{{ hostname }}.conf.part" + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") and ((os10_cfg_generate | default('False')) | bool) +# notify: save config os10 + register: generate_output diff --git a/ansible_collections/dellemc/os10/roles/os10_route_map/templates/os10_route_map.j2 b/ansible_collections/dellemc/os10/roles/os10_route_map/templates/os10_route_map.j2 new file mode 100644 index 00000000..bfca3d17 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_route_map/templates/os10_route_map.j2 @@ -0,0 +1,348 @@ +#jinja2: trim_blocks: True,lstrip_blocks: True +{##################################################### +Purpose: +Configure route-map commands for os10 Devices. +os10_route_map: + as_path: + - access_list: aa + permit: true + regex: www + state: present + community_list: + - type: standard + name: qqq + permit: false + community: internet + state: present + extcommunity_list: + - type: standard + name: qqq + permit: false + community: "rt 22:33" + state: present + route_map: + - name: test + permit: true + seq_num: 1 + continue: 20 + match: + - ip_type: ipv4 + access_group: testaccess + prefix_list: testprefix + source_protocol_ebgp: "present" + source_protocol_ibgp: "present" + source_protocol_evpn: "present" + source_protocol_ospf: "present" + source_protocol_static: "present" + source_protocol_connected: "present" + set: + local_pref: 1200 + metric_type: internal + metric: + 30 + origin: igp + weight: 50 + next_hop: + - type: ip + address: 10.1.1.1 + track_id: 3 + state: present + community: internet + comm_list: + add: qq + delete: qqq + extcommunity: "22:33" + extcomm_list: + add: aa + delete: aa + state: present +#####################################################} +{% if os10_route_map is defined and os10_route_map %} +{% for key in os10_route_map.keys() %} + {% if key == "route_map" %} + {% for vars in os10_route_map[key] %} + {% if vars.name is defined and vars.name %} + {% if vars.state is defined and vars.state == "absent" %} +no route-map {{ vars.name }} + {% else %} + {% if vars.permit is defined and vars.permit %} + {% if vars.seq_num is defined and vars.seq_num %} +route-map {{ vars.name }} permit {{ vars.seq_num }} + {% else %} +route-map {{ vars.name }} permit 10 + {% endif %} + {% elif vars.permit is defined and not vars.permit %} + {% if vars.seq_num is defined and vars.seq_num %} +route-map {{ vars.name }} deny {{ vars.seq_num }} + {% else %} +route-map {{ vars.name }} deny 10 + {% endif %} + {% else %} + {% if vars.seq_num is defined and vars.seq_num %} +route-map {{ vars.name }} permit {{ vars.seq_num }} + {% else %} +route-map {{ vars.name }} permit 10 + {% endif %} + {% endif %} + {% if vars.set is defined and vars.set %} + {% if vars.set.local_pref is defined %} + {% if vars.set.local_pref %} + set local-preference {{ vars.set.local_pref }} + {% else %} + no set local-preference + {% endif %} + {% endif %} + {% if vars.set.metric_type is defined %} + {% if vars.set.metric_type %} + set metric-type {{ vars.set.metric_type }} + {% else %} + no set metric-type internal + {% endif %} + {% endif %} + {% if vars.set.metric is defined %} + {% if vars.set.metric %} + set metric {{ vars.set.metric }} + {% else %} + no set metric + {% endif %} + {% endif %} + {% if vars.set.origin is defined %} + {% if vars.set.origin %} + set origin {{ vars.set.origin }} + {% else %} + no set origin + {% endif %} + {% endif %} + {% if vars.set.community is defined %} + {% if vars.set.community %} + set community {{ vars.set.community }} + {% else %} + no set community internet + {% endif %} + {% endif %} + {% if vars.set.extcommunity is defined %} + {% if vars.set.extcommunity %} + set extcommunity rt {{ vars.set.extcommunity }} + {% else %} + no set extcommunity rt 11:33 + {% endif %} + {% endif %} + {% if vars.set.weight is defined %} + {% if vars.set.weight %} + set weight {{ vars.set.weight }} + {% else %} + no set weight + {% endif %} + {% endif %} + {% if vars.set.comm_list is defined and vars.set.comm_list %} + {% if vars.set.comm_list.add is defined and vars.set.comm_list.add %} + set comm-list {{ vars.set.comm_list.add }} add + {% else %} + no set comm-list aa add + {% endif %} + {% if vars.set.comm_list.delete is defined and vars.set.comm_list.delete %} + set comm-list {{ vars.set.comm_list.delete }} delete + {% else %} + no set comm-list aa delete + {% endif %} + {% endif %} + {% if vars.set.extcomm_list is defined and vars.set.extcomm_list %} + {% if vars.set.extcomm_list.add is defined and vars.set.extcomm_list.add %} + set extcomm-list {{ vars.set.extcomm_list.add }} add + {% else %} + no set extcomm-list aa add + {% endif %} + {% if vars.set.extcomm_list.delete is defined and vars.set.extcomm_list.delete %} + set extcomm-list {{ vars.set.extcomm_list.delete }} delete + {% else %} + no set extcomm-list aa delete + {% endif %} + {% endif %} + {% if vars.set.next_hop is defined and vars.set.next_hop %} + {% for item in vars.set.next_hop %} + {% if item.type is defined and item.type %} + {% if item.address is defined and item.address %} + {% if item.state is defined and item.state=="absent" %} + no set {{ item.type }} next-hop {{ item.address }} + {% else %} + {% if item.track_id is defined and item.track_id %} + set {{ item.type }} next-hop {{ item.address }} track-id {{ item.track_id }} + {% else %} + set {{ item.type }} next-hop {{ item.address }} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% endif %} + {% if vars.continue is defined %} + {% if vars.continue %} + continue {{ vars.continue }} + {% else %} + no continue + {% endif %} + {% endif %} + {% if vars.match is defined and vars.match %} + {% for match in vars.match %} + {% if match.ip_type is defined and match.ip_type %} + {% if match.ip_type =="ipv4" %} + {% set ip = "ip" %} + {% else %} + {% set ip = "ipv6" %} + {% endif %} + {% if match.access_group is defined %} + {% if match.access_group %} + match {{ ip }} address {{ match.access_group }} + {% else %} + no match {{ ip }} address a + {% endif %} + {% endif %} + {% if match.prefix_list is defined %} + {% if match.prefix_list %} + match {{ ip }} address prefix-list {{ match.prefix_list }} + {% else %} + no match {{ ip }} address prefix-list a + {% endif %} + {% endif %} + {% endif %} + {% if match.source_protocol_ebgp is defined and match.source_protocol_ebgp %} + {% if match.source_protocol_ebgp == "present" %} + match source-protocol bgp ebgp + {% endif %} + {% if match.source_protocol_ebgp == "absent" %} + no match source-protocol bgp ebgp + {% endif %} + {% endif %} + {% if match.source_protocol_ibgp is defined and match.source_protocol_ibgp %} + {% if match.source_protocol_ibgp == "present" %} + match source-protocol bgp ibgp + {% endif %} + {% if match.source_protocol_ibgp == "absent" %} + no match source-protocol bgp ibgp + {% endif %} + {% endif %} + {% if match.source_protocol_evpn is defined and match.source_protocol_evpn %} + {% if match.source_protocol_evpn == "present" %} + match source-protocol bgp evpn + {% endif %} + {% if match.source_protocol_evpn == "absent" %} + no match source-protocol bgp evpn + {% endif %} + {% endif %} + {% if match.source_protocol_ospf is defined and match.source_protocol_ospf %} + {% if match.source_protocol_ospf == "present" %} + match source-protocol ospf + {% endif %} + {% if match.source_protocol_ospf == "absent" %} + no match source-protocol ospf + {% endif %} + {% endif %} + {% if match.source_protocol_static is defined and match.source_protocol_static %} + {% if match.source_protocol_static == "present" %} + match source-protocol static + {% endif %} + {% if match.source_protocol_static == "absent" %} + no match source-protocol static + {% endif %} + {% endif %} + {% if match.source_protocol_connected is defined and match.source_protocol_connected %} + {% if match.source_protocol_connected == "present" %} + match source-protocol connected + {% endif %} + {% if match.source_protocol_connected == "absent" %} + no match source-protocol connected + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + {% elif key == "as_path" %} + {% for item in os10_route_map[key] %} + {% if item.access_list is defined and item.access_list %} + {% if item.permit is defined %} + {% if item.permit %} + {% set filter = "permit" %} + {% else %} + {% set filter = "deny" %} + {% endif %} + {% if item.regex is defined and item.regex %} + {% if item.state is defined and item.state == "absent" %} +no ip as-path access-list {{ item.access_list }} {{ filter }} {{ item.regex }} + {% else %} +ip as-path access-list {{ item.access_list }} {{ filter }} {{ item.regex }} + {% endif %} + {% endif %} + {% else %} + {% if item.state is defined and item.state == "absent" %} +no ip as-path access-list {{ item.access_list }} + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + {% elif key == "community_list" %} + {% for item in os10_route_map[key] %} + {% if item.type is defined and item.type %} + {% if item.name is defined and item.name %} + {% if item.permit is defined %} + {% if item.permit %} + {% set filter = "permit" %} + {% else %} + {% set filter = "deny" %} + {% endif %} + {% if item.regex is defined and item.regex %} + {% if item.state is defined and item.state == "absent" %} +no ip community-list standard {{ item.name }} {{ filter }} {{ item.regex }} + {% else %} +ip community-list standard {{ item.name }} {{ filter }} {{ item.regex }} + {% endif %} + {% elif item.community is defined and item.community %} + {% if item.state is defined and item.state == "absent" %} +no ip community-list standard {{ item.name }} {{ filter }} {{ item.community }} + {% else %} +ip community-list {{ item.type }} {{ item.name }} {{ filter }} {{ item.community }} + {% endif %} + {% endif %} + {% else %} + {% if item.state is defined and item.state == "absent" %} +no ip community-list standard {{ item.name }} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + {% elif key == "extcommunity_list" %} + {% for item in os10_route_map[key] %} + {% if item.type is defined and item.type %} + {% if item.name is defined and item.name %} + {% if item.permit is defined %} + {% if item.permit %} + {% set filter = "permit" %} + {% else %} + {% set filter = "deny" %} + {% endif %} + {% if item.regex is defined and item.regex %} + {% if item.state is defined and item.state == "absent" %} +no ip extcommunity-list standard {{ item.name }} {{ filter }} {{ item.regex }} + {% else %} +ip extcommunity-list standard {{ item.name }} {{ filter }} {{ item.regex }} + {% endif %} + {% elif item.community is defined and item.community %} + {% if item.state is defined and item.state == "absent" %} +no ip extcommunity-list standard {{ item.name }} {{ filter }} {{ item.community }} + {% else %} +ip extcommunity-list {{ item.type }} {{ item.name }} {{ filter }} {{ item.community }} + {% endif %} + {% endif %} + {% else %} + {% if item.state is defined and item.state == "absent" %} +no ip extcommunity-list standard {{ item.name }} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} +{% endfor %} +{% endif %} diff --git a/ansible_collections/dellemc/os10/roles/os10_route_map/tests/inventory b/ansible_collections/dellemc/os10/roles/os10_route_map/tests/inventory new file mode 100644 index 00000000..85a255f9 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_route_map/tests/inventory @@ -0,0 +1,2 @@ +--- +localhost diff --git a/ansible_collections/dellemc/os10/roles/os10_route_map/tests/main.yaml b/ansible_collections/dellemc/os10/roles/os10_route_map/tests/main.yaml new file mode 100644 index 00000000..e791b295 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_route_map/tests/main.yaml @@ -0,0 +1,55 @@ +--- +# Sample variables for OS10 device +os10_route_map: + as_path: + - access_list: aa + permit: true + regex: www + state: present + community_list: + - type: standard + name: qqq + permit: false + community: internet + state: present + extcommunity_list: + - type: standard + name: qqq + permit: false + community: "rt 22:33" + state: present + route_map: + - name: test + permit: true + seq_num: 1 + continue: 20 + match: + - ip_type: ipv4 + access_group: testaccess + prefix_list: testprefix + source_protocol_ebgp: present + source_protocol_ibgp: present + source_protocol_evpn: present + source_protocol_static: present + source_protocol_ospf: present + source_protocol_connected: present + set: + local_pref: 1200 + metric_type: internal + metric: + 30 + origin: igp + weight: 50 + next_hop: + - type: ip + address: 10.1.1.1 + track_id: 3 + state: present + community: internet + comm_list: + add: qq + delete: qqq + extcommunity: "22:33" + extcomm_list: + add: aa + delete: aa + state: present diff --git a/ansible_collections/dellemc/os10/roles/os10_route_map/tests/test.yml b/ansible_collections/dellemc/os10/roles/os10_route_map/tests/test.yml new file mode 100644 index 00000000..4302a12d --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_route_map/tests/test.yml @@ -0,0 +1,5 @@ +--- +- hosts: localhost + connection: network_cli + roles: + - dellemc.os10.os10_route_map diff --git a/ansible_collections/dellemc/os10/roles/os10_route_map/vars/main.yml b/ansible_collections/dellemc/os10/roles/os10_route_map/vars/main.yml new file mode 100644 index 00000000..ff4a48ac --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_route_map/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for dellemc.os10.os10_route_map diff --git a/ansible_collections/dellemc/os10/roles/os10_snmp/LICENSE b/ansible_collections/dellemc/os10/roles/os10_snmp/LICENSE new file mode 100644 index 00000000..2c9b8e1f --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_snmp/LICENSE @@ -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) 2020, Dell Inc. All rights reserved. + + 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) 2020, Dell Inc. All rights reserved. + 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>. diff --git a/ansible_collections/dellemc/os10/roles/os10_snmp/README.md b/ansible_collections/dellemc/os10/roles/os10_snmp/README.md new file mode 100644 index 00000000..a875a234 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_snmp/README.md @@ -0,0 +1,269 @@ +SNMP role +========= + +This role facilitates the configuration of global SNMP attributes. It supports the configuration of SNMP server attributes including users, group, community, location, and traps. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. + +The SNMP role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. + +Role variables +-------------- + +- Role is abstracted using the `ansible_network_os` variable that can take `dellemc.os10.os10` as the value +- If `os10_cfg_generate` is set to true, the variable generates the role configuration commands in a file +- Any role variable with a corresponding state variable set to absent negates the configuration of that variable +- Setting an empty value for any variable negates the corresponding configuration +- Variables and values are case-sensitive + +**os10_snmp keys** + +| Key | Type | Description | Support | +|------------|---------------------------|---------------------------------------------------------|-----------------------| +| ``snmp_contact`` | string | Configures SNMP contact information | os10 | +| ``snmp_location`` | string | Configures SNMP location information | os10 | +| ``snmp_community`` | list | Configures SNMP community information (see ``snmp_community.*``) | os10 | +| ``snmp_community.name`` | string (required) | Configures the SNMP community string | os10 | +| ``snmp_community.access_mode`` | string: ro,rw | Configures access-mode for the community | os10 | +| ``snmp_community.access_list`` | dictionary | Configures ACL for the community (see ``snmp_community.access_list.*``) | os10 | +| ``snmp_community.access_list.name`` | string | Specifies the name of the ACL for the community | os10 | +| ``snmp_community.access_list.state`` | string: absent,present\* | Deletes the ACL from the community if set to absent | os10 | +| ``snmp_community.state`` | string: absent,present\* | Deletes the SNMP community information if set to absent | os10 | +| ``snmp_engine_id`` | string | Configures SNMP local EngineID | os10 | +| ``snmp_remote_engine_id`` | list | Configures SNMP remote engine information (see ``snmp_remote_engine_id.*``) | os10 | +| ``snmp_remote_engine_id.ip`` | string | Configures the IP address of the SNMP remote engine | os10 | +| ``snmp_remote_engine_id.engine_id`` | string | Configures the EngineID of the SNMP remote engine | os10 | +| ``snmp_remote_engine_id.udpport`` | string | Configures the UDP port of the SNMP remote engine | os10 | +| ``snmp_remote_engine_id.state`` | string: absent,present\* | Deletes the SNMP remote engine information if set to absent | os10 | +| ``snmp_group`` | list | Configures the SNMP group information (see ``snmp_group.*``) | os10 | +| ``snmp_group.name`` | string | Configures the name of the SNMP group | os10 | +| ``snmp_group.version`` | string: 1,2c,3 | Configures the version of the SNMP group | os10 | +| ``snmp_group.security_level`` | string: auth,noauth,priv | Configures the security level of SNMP group for version 3 | os10 | +| ``snmp_group.access_list`` | dictionary | Configures the access list of the SNMP group (see ``snmp_group.access_list.*``)| os10 | +| ``snmp_group.access_list.name`` | string | Specifies the name of the access list for the SNMP group wtih version 1 or 2c | os10 | +| ``snmp_group.access_list.state`` | string: absent,present\* | Deletes the access list from the SNMP group if set to absent | os10 | +| ``snmp_group.read_view`` | dictionary | Configures the read view of the SNMP group (see ``snmp_group.read_view.*``) | os10 | +| ``snmp_group.read_view.name`` | string | Specifies the name of the read view for the SNMP group | os10 | +| ``snmp_group.read_view.state`` | string: absent,present\* | Deletes the read view from the SNMP group if set to absent | os10 | +| ``snmp_group.write_view`` | dictionary | Configures the write view of the SNMP group (see ``snmp_group.write_view``) | os10 | +| ``snmp_group.write_view.name`` | string | Specifies the name of the write view for the SNMP group | os10 | +| ``snmp_group.write_view.state`` | string: absent,present\* | Deletes the write view from the SNMP group if set to absent | os10 | +| ``snmp_group.notify_view`` | dictionary | Configures the notify view of the SNMP group (see ``snmp_group.notify_view.*``) | os10 | +| ``snmp_group.notify_view.name`` | string | Specifies the name of the notify view for the SNMP group | os10 | +| ``snmp_group.notify_view.state`` | string: absent,present\* | Deletes the notify view from the SNMP group if set to absent | os10 | +| ``snmp_group.state`` | string: absent,present\* | Deletes the SNMP group if set to absent | os10 | +| ``snmp_host`` | list | Configures SNMP hosts to receive SNMP traps (see ``snmp_host.*``) | os10 | +| ``snmp_host.ip`` | string | Configures the IP address of the SNMP trap host | os10 | +| ``snmp_host.communitystring`` | string | Configures the SNMP community string of the trap host for version 1 or 2c | os10 | +| ``snmp_host.udpport`` | string | Configures the UDP number of the SNMP trap host (0 to 65535) | os10 | +| ``snmp_host.version`` | string: 1,2c,3 (required) | Specifies the SNMP version of the host (1 or 2c or 3 in os10) | os10 | +| ``snmp_host.security_level`` | string: auth,noauth,priv | Configures the security level of the SNMP host for version 3 | os10 | +| ``snmp_host.security_name`` | string | Configures the security name of the SNMP host for version 3 | os10 | +| ``snmp_host.notification_type`` | string: traps,informs | Configures the notification type of the SNMP host | os10 | +| ``snmp_host.trap_categories`` | dictionary | Enables or disables different trap categories for the SNMP host (see ``snmp_host.trap_categories.*``) | os10 | +| ``snmp_host.trap_categories.dom`` | boolean: true,false | Enables or disables dom category traps for the SNMP host | os10 | +| ``snmp_host.trap_categories.entity`` | boolean: true,false | Enables or disables entity category traps for the SNMP host | os10 | +| ``snmp_host.trap_categories.envmon`` | boolean: true,false | Enables or disables envmon category traps for the SNMP host | os10 | +| ``snmp_host.trap_categories.lldp`` | boolean: true,false | | Enables or disables lldp category traps for the SNMP host | os10 | +| ``snmp_host.trap_categories.snmp`` | boolean: true,false | | Enables or disables snmp category traps for the SNMP host | os10 | +| ``snmp_host.state`` | string: absent,present\* | Deletes the SNMP trap host if set to absent | os10 | +| ``snmp_source_interface`` | string | Configures the source interface for SNMP | os10 | +| ``snmp_traps`` | list | Configures SNMP traps (see ``snmp_traps.*``) | os10 | +| ``snmp_traps.name`` | string | Enables SNMP traps | os10 | +| ``snmp_traps.state`` | string: absent,present\* | Deletes the SNMP trap if set to absent | os10 | +| ``snmp_user`` | list | Configures the SNMP user information (see ``snmp_user.*``) | os10 | +| ``snmp_user.name`` | string | Specifies the name of the SNMP user | os10 | +| ``snmp_user.group_name`` | string | Specifies the group of the SNMP user | os10 | +| ``snmp_user.version `` | string: 1,2c,3 | Configures the version for the SNMP user | os10 | +| ``snmp_user.access_list`` | string | Configures the access list for the SNMP user with version 1 or 2c | os10 | +| ``snmp_user.authentication`` | dictionary | Configures the authentication information for the SNMP user with version 3 (see ``snmp_user.authentication.*``) | os10 | +| ``snmp_user.authentication.localized`` | boolean: true,false | Configures the password to be in localized key format or not | os10 | +| ``snmp_user.authentication.algorithm`` | string: md5, sha | Configures the authentication algorithm for the SNMP user | os10 | +| ``snmp_user.authentication.password`` | string | Configures the authentication password for the SNMP user; if localized is true it should be a hexadecimal string prefixed with 0x and qouted | os10 | +| ``snmp_user.authentication.encryption`` | dictionary | Configures the encryption parameters for the SNMP user | os10 | +| ``snmp_user.authentication.encryption.algorithm`` | string: aes,des | Configures the encryption algorithm for the SNMP user | os10 | +| ``snmp_user.authentication.encryption.password`` | string | Configures encryption password for the SNMP user; if localized is true it should be a hexadecimal string prefixed with 0x and qouted | os10 | +| ``snmp_user.remote`` | dictionary | Configures the remote SNMP entity the user belongs to (see ``snmp_user.remote.*``) | os10 | +| ``snmp_user.remote.ip`` | string | Configures the IP address of the remote entity for the SNMP user | os10 | +| ``snmp_user.remote.udpport`` | string | Configures the UDP port of the remote entiry for the SNMP user | os10 | +| ``snmp_user.state`` | string: absent,present\* | Deletes the SNMP user if set to absent | os10 | +| ``snmp_view`` | list | Configures SNMPv3 view information (see ``snmp_view.*``) | os10 | +| ``snmp_view.name`` | string | Configures the SNMP view name (up to 20 characters) | os10 | +| ``snmp_view.oid_subtree`` | integer | Configures the SNMP view for the OID subtree | os10 | +| ``snmp_view.include`` | boolean: true,false | Specifies if the MIB family should be included or excluded from the view | os10 | +| ``snmp_view.state`` | string: absent,present\* | Deletes the SNMP view if set to absent | os10 | +| ``snmp_vrf`` | string | Configures the VRF for SNMP | os10 | + + +> **NOTE**: Asterisk (\*) denotes the default value if none is specified. + +Connection variables +-------------------- + +Ansible Dell EMC network roles require connection information to establish communication with the nodes in your inventory. This information can exist in the Ansible *group_vars* or *host_vars* directories, or inventory or in the playbook itself. + +| Key | Required | Choices | Description | +|-------------|----------|------------|-----------------------------------------------------| +| ``ansible_host`` | yes | | Specifies the hostname or address for connecting to the remote device over the specified transport | +| ``ansible_port`` | no | | Specifies the port used to build the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_PORT` option is used; it defaults to 22 | +| ``ansible_ssh_user`` | no | | Specifies the username that authenticates the CLI login for the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_USER` environment variable value is used | +| ``ansible_ssh_pass`` | no | | Specifies the password that authenticates the connection to the remote device | +| ``ansible_become`` | no | yes, no\* | Instructs the module to enter privileged mode on the remote device before sending any commands; if value is unspecified, the `ANSIBLE_BECOME` environment variable value is used, and the device attempts to execute all commands in non-privileged mode | +| ``ansible_become_method`` | no | enable, sudo\* | Instructs the module to allow the become method to be specified for handling privilege escalation; if value is unspecified, the `ANSIBLE_BECOME_METHOD` environment variable value is used | +| ``ansible_become_pass`` | no | | Specifies the password to use if required to enter privileged mode on the remote device; if ``ansible_become`` is set to no this key is not applicable | +| ``ansible_network_os`` | yes | os10, null\* | Loads the correct terminal and cliconf plugins to communicate with the remote device | + +> **NOTE**: Asterisk (\*) denotes the default value if none is specified. + + +Example playbook +---------------- + +This example uses the *os10_snmp* role to completely set up the SNMP server attributes. It creates a *hosts* file with the switch details and corresponding variables. The hosts file should define the `ansible_network_os` variable with corresponding Dell EMC OS10 name. + +When `os10_cfg_generate` is set to true, the variable generates the configuration commands as a .part file in *build_dir* path. By default, the variable is set to false. It writes a simple playbook that only references the *os10_snmp* role. By including the role, you automatically get access to all of the tasks to configure SNMP features. + +**Sample hosts file** + + leaf1 ansible_host= <ip_address> + +**Sample host_vars/leaf1** + + hostname: leaf1 + ansible_become: yes + ansible_become_method: xxxxx + ansible_become_pass: xxxxx + ansible_ssh_user: xxxxx + ansible_ssh_pass: xxxxx + ansible_network_os: dellemc.os10.os10 + build_dir: ../temp/temp_os10 + + os10_snmp: + snmp_contact: test + snmp_location: Chennai + snmp_source_interface: loopback 10 + snmp_vrf: test + snmp_community: + - name: public + access_mode: ro + access_list: + name: test_acl + state: present + state: present + snmp_engine_id: 123456789 + snmp_remote_engine_id: + - host: 1.1.1.1 + engine_id: '0xab' + udpport: 162 + state: present + snmp_traps: + - name: all + state: present + snmp_view: + - name: view_1 + oid_subtree: 2 + include: true + state: absent + snmp_host: + - ip: 1.1.1.1 + communitystring: c1 + version: "2c" + udpport: 4 + state: present + - ip: 2.2.2.2 + version: 1 + communitystring: c3 + trap_categories: + dom: true + lldp: true + state: present + - ip: 3.1.1.1 + version: 3 + security_level: priv + security_name: test + notification_type: informs + udpport: 200 + trap_categories: + dom: true + entity: true + envmon: true + snmp: true + state: present + snmp_group: + - name: group_1 + version: "2c" + state: present + access_list: + name: test_acl + state: present + read_view: + name: view_1 + state: present + write_view: + name: view_2 + state: present + notify_view: + name: view_3 + state: present + - name: group_2 + version: 3 + security_level: priv + state: present + read_view: + name: view_1 + state: absent + notify_view: + name: view_3 + state: present + snmp_user: + - name: user_1 + group_name: group_1 + version: 3 + authentication: + localized: true + algorithm: md5 + password: 9fc53d9d908118b2804fe80e3ba8763d + encryption: + algorithm: aes + password: d0452401a8c3ce42804fe80e3ba8763d + state: present + - name: user_2 + group_name: group_1 + version: 3 + remote: + ip: 1.1.1.1 + udpport: 200 + authentication: + localized: true + algorithm: md5 + password: '0x9fc53d9d908118b2804fe80e3ba8763d' + encryption: + algorithm: aes + password: '0xd0452401a8c3ce42804fe80e3ba8763d' + state: present + - name: user_3 + group_name: group_1 + version: 2c + state: present + - name: user_4 + group_name: group_1 + version: 3 + state: present + - name: user_5 + group_name: group_2 + version: 2c + remote: + ip: 1.1.1.1 + udpport: 200 + access_list: test_acl + state: present + +**Simple playbook to setup SNMP — leaf.yaml** + + - hosts: leaf1 + roles: + - dellemc.os10.os10_snmp + +**Run** + + ansible-playbook -i hosts leaf.yaml + +(c) 2017-2020 Dell Inc. or its subsidiaries. All rights reserved. diff --git a/ansible_collections/dellemc/os10/roles/os10_snmp/defaults/main.yml b/ansible_collections/dellemc/os10/roles/os10_snmp/defaults/main.yml new file mode 100644 index 00000000..81a11877 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_snmp/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for dellemc.os10.os10_snmp diff --git a/ansible_collections/dellemc/os10/roles/os10_snmp/handlers/main.yml b/ansible_collections/dellemc/os10/roles/os10_snmp/handlers/main.yml new file mode 100644 index 00000000..1a8a3142 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_snmp/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for dellemc.os10.os10_snmp diff --git a/ansible_collections/dellemc/os10/roles/os10_snmp/meta/main.yml b/ansible_collections/dellemc/os10/roles/os10_snmp/meta/main.yml new file mode 100644 index 00000000..efbf4e40 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_snmp/meta/main.yml @@ -0,0 +1,18 @@ +# Copyright (c) 2020 Dell Inc. +--- +galaxy_info: + author: Dell EMC Networking Engineering + description: The os10_snmp role facilitates the configuration of snmp attributes in devices running Dell EMC SmartFabric OS10. + company: Dell Technologies + license: GPLv3 + min_ansible_version: 2.9.6 + + platforms: + - name: os10 + + galaxy_tags: + - networking + - dell + - emc + - dellemc + - os10 diff --git a/ansible_collections/dellemc/os10/roles/os10_snmp/tasks/main.yml b/ansible_collections/dellemc/os10/roles/os10_snmp/tasks/main.yml new file mode 100644 index 00000000..7ed03578 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_snmp/tasks/main.yml @@ -0,0 +1,16 @@ +--- +# tasks file for os10 + - name: "Generating SNMP configuration for os10" + template: + src: os10_snmp.j2 + dest: "{{ build_dir }}/snmp10_{{ hostname }}.conf.part" + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") and ((os10_cfg_generate | default('False')) | bool) +# notify: save config os10 + register: generate_output + + - name: "Provisioning SNMP configuration for os10" + os10_config: + src: os10_snmp.j2 + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") +# notify: save config os10 + register: output diff --git a/ansible_collections/dellemc/os10/roles/os10_snmp/templates/os10_snmp.j2 b/ansible_collections/dellemc/os10/roles/os10_snmp/templates/os10_snmp.j2 new file mode 100644 index 00000000..f9581709 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_snmp/templates/os10_snmp.j2 @@ -0,0 +1,441 @@ +#jinja2: trim_blocks: True,lstrip_blocks: True +{############################################# +Purpose: +Configure snmp commands for os10 Devices +os10_snmp: + snmp_contact: test + snmp_location: Chennai + snmp_vrf: test + snmp_source_interface: loopback 10 + snmp_community: + - name: public + access_mode: ro + access_list: + name: test_acl + state: present + state: present + snmp_traps: + - name: all + state: present + snmp_engine_id: 123456789 + snmp_remote_engine_id: + - host: 1.1.1.1 + engine_id: '0xab' + udpport: 162 + state: present + snmp_view: + - name: view_1 + oid_subtree: 2 + include: true + state: absent + snmp_host: + - ip: 1.1.1.1 + communitystring: c1 + version: "2c" + udpport: 4 + state: present + - ip: 2.2.2.2 + version: 1 + communitystring: c3 + state: present + - ip: 3.1.1.1 + version: 3 + security_level: priv + security_name: test + notification_type: informs + udpport: 200 + trap_categories: + dom: true + entity: true + envmon: true + snmp: true + state: present + snmp_group: + - name: group_1 + version: "2c" + state: present + access_list: + name: test_acl + state: present + read_view: + name: view_1 + state: present + write_view: + name: view_2 + state: present + notify_view: + name: view_3 + state: present + - name: group_2 + version: 3 + security_level: priv + state: present + read_view: + name: view_1 + state: absent + notify_view: + name: view_3 + state: present + snmp_user: + - name: user_1 + group_name: group_1 + version: 3 + authentication: + localized: true + algorithm: md5 + password: 9fc53d9d908118b2804fe80e3ba8763d + encryption: + algorithm: aes + password: d0452401a8c3ce42804fe80e3ba8763d + state: present + - name: user_2 + group_name: group_1 + version: 3 + remote: + ip: 1.1.1.1 + udpport: 200 + authentication: + localized: true + algorithm: md5 + password: '0x9fc53d9d908118b2804fe80e3ba8763d' + encryption: + algorithm: aes + password: '0xd0452401a8c3ce42804fe80e3ba8763d' + state: present + - name: user_3 + group_name: group_1 + version: 2c + state: present + - name: user_4 + group_name: group_1 + version: 3 + state: present + - name: user_5 + group_name: group_2 + version: 2c + remote: + ip: 1.1.1.1 + udpport: 200 + access_list: test_acl + state: present + +###############################################} +{% if os10_snmp is defined and os10_snmp %} + {% if os10_snmp.snmp_community is defined %} + {% set value = os10_snmp.snmp_community %} + {% if value %} + {% for item in value %} + {% if item.name is defined and item.name %} + {% if item.access_mode is defined and item.access_mode %} + {% if item.state is defined and item.state == "absent" %} +no snmp-server community {{ item.name }} {{ item.access_mode }} + {% else %} + {% if item.access_list is defined and item.access_list and item.access_list.name is defined and item.access_list.name %} + {% if item.access_list.state is defined and item.access_list.state == "absent" %} +no snmp-server community {{ item.name }} {{ item.access_mode }} acl {{ item.access_list.name }} + {% else %} +snmp-server community {{ item.name }} {{ item.access_mode }} acl {{ item.access_list.name }} + {% endif %} + {% else %} +snmp-server community {{ item.name }} {{ item.access_mode }} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% endif %} + + {% if os10_snmp.snmp_contact is defined %} + {% set value = os10_snmp.snmp_contact %} + {% if value %} +snmp-server contact {{ value }} + {% else %} +no snmp-server contact + {% endif %} + {% endif %} + + {% if os10_snmp.snmp_engine_id is defined %} + {% set value = os10_snmp.snmp_engine_id %} + {% if value %} +snmp-server engineID local {{ value }} + {% else %} +no snmp-server engineID local + {% endif %} + {% endif %} + + {# Remove users before removing remote engine #} + {% if os10_snmp.snmp_user is defined and os10_snmp.snmp_user %} + {% set value = os10_snmp.snmp_user %} + {% for item in value %} + {% if item.name is defined and item.name and item.group_name is defined and item.group_name %} + {% if item.state is defined and item.state == "absent" %} + {% set user_remote_option = "" %} + {% if item.remote is defined and item.remote %} + {% if item.remote.ip is defined and item.remote.ip %} + {% if item.remote.udpport is defined and item.remote.udpport %} + {% set user_remote_option = " remote " + item.remote.ip + " udp-port " + item.remote.udpport|string %} + {% endif %} + {% endif %} + {% endif %} +no snmp-server user {{ item.name }} {{ item.group_name }}{{ user_remote_option }} {{ item.version }} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + + {% if os10_snmp.snmp_remote_engine_id is defined %} + {% set value = os10_snmp.snmp_remote_engine_id %} + {% for item in value %} + {% if item.host is defined and item.host %} + {% if item.state is defined and item.state == "absent" %} + {% if item.udpport is defined and item.udpport %} +no snmp-server engineID remote {{ item.host }} udp-port {{ item.udpport }} + {% else %} +no snmp-server engineID remote {{ item.host }} + {% endif %} + {% else %} + {% if item.engine_id is defined and item.engine_id %} + {% if item.udpport is defined and item.udpport %} +snmp-server engineID remote {{ item.host }} udp-port {{ item.udpport }} {{ item.engine_id }} + {% else %} +snmp-server engineID remote {{ item.host }} udp-port 162 {{ item.engine_id }} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + + {% if os10_snmp.snmp_traps is defined %} + {% set value = os10_snmp.snmp_traps %} + {% if value %} + {% for val in value %} + {% if val.name is defined and val.name %} + {% if val.state is defined and val.state == "absent" %} + {% if val.name == "all" %} + {% set trap_list = ['snmp authentication','snmp linkDown','snmp linkUp','envmon fan','envmon power-supply','envmon temperature'] %} + {% for name in trap_list %} +no snmp-server enable traps {{ name }} + {% endfor %} + {% else %} +no snmp-server enable traps {{ val.name }} + {% endif %} + {% else %} + {% if val.name == "all" %} + {% set trap_list = ['snmp authentication','snmp linkDown','snmp linkUp','envmon fan','envmon power-supply','envmon temperature'] %} + {% for name in trap_list %} +snmp-server enable traps {{ name }} + {% endfor %} + {% else %} +snmp-server enable traps {{ val.name }} + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% endif %} + + {% if os10_snmp.snmp_group is defined and os10_snmp.snmp_group %} + {% set value = os10_snmp.snmp_group %} + {% for item in value %} + {% if item.name is defined and item.name and item.version is defined and item.version %} + {% set group_value = item.name + " " + item.version|string %} + {% if item.security_level is defined and item.security_level %} + {% if item.version|string != "1" and item.version|string != "2c" %} + {% set group_value = group_value + " " + item.security_level %} + {% endif %} + {% endif %} + {% if item.state is defined and item.state == "absent" %} +no snmp-server group {{ group_value }} + {% else %} + {% set group_options = [] %} + {% if item.version|string == "1" or item.version|string == "2c" %} + {% if item.access_list is defined and item.access_list and item.access_list.name is defined and item.access_list.name %} + {% if item.access_list.state is defined and item.access_list.state == "absent" %} +no snmp-server group {{ group_value }} access {{ item.access_list.name }} + {% else %} + {{ group_options.append("access "+item.access_list.name) }} + {% endif %} + {% endif %} + {% endif %} + {% if item.notify_view is defined and item.notify_view and item.notify_view.name is defined and item.notify_view.name %} + {% if item.notify_view.state is defined and item.notify_view.state == "absent" %} +no snmp-server group {{ group_value }} notify {{ item.notify_view.name }} + {% else %} + {{ group_options.append("notify "+item.notify_view.name)}} + {% endif %} + {% endif %} + {% if item.read_view is defined and item.read_view and item.read_view.name is defined and item.read_view.name %} + {% if item.read_view.state is defined and item.read_view.state == "absent" %} +no snmp-server group {{ group_value }} read {{ item.read_view.name }} + {% else %} + {{ group_options.append("read "+item.read_view.name) }} + {% endif %} + {% endif %} + {% if item.write_view is defined and item.write_view and item.write_view.name is defined and item.write_view.name %} + {% if item.write_view.state is defined and item.write_view.state == "absent" %} +no snmp-server group {{ group_value }} write {{ item.write_view.name }} + {% else %} + {{ group_options.append("write "+item.write_view.name)}} + {% endif %} + {% endif %} +snmp-server group {{ group_value }} {{ group_options|join(" ") }} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + + {% if os10_snmp.snmp_host is defined and os10_snmp.snmp_host %} + {% set value = os10_snmp.snmp_host %} + {% for item in value %} + {% if item.ip is defined and item.ip %} + {% set host_port_option = "" %} + {% if item.udpport is defined and item.udpport %} + {% set host_port_option = " udp-port " + item.udpport|string %} + {% endif %} + {% if item.state is defined and item.state == "absent" %} +no snmp-server host {{ item.ip }}{{ host_port_option }} + {% else %} + {% set host_notif_type = "traps" %} + {% if item.notification_type is defined and item.notification_type %} + {% set host_notif_type = item.notification_type %} + {% endif %} + {% if item.version is defined and item.version %} + {% set host_version = "" %} + {% if item.version|string == "1" or item.version|string == "2c" %} + {% if item.communitystring is defined and item.communitystring %} + {% set host_version = item.version|string + " " + item.communitystring %} + {% endif %} + {% elif item.security_level is defined and item.security_level %} + {% if item.security_name is defined and item.security_name %} + {% set host_version = item.version|string + " " + item.security_level + " " + item.security_name %} + {% endif %} + {% endif %} + {% set host_trap_categories = [] %} + {% if item.trap_categories is defined and item.trap_categories %} + {% for cat_key, cat_value in item.trap_categories.items() %} + {% if cat_value %} + {% if cat_key == "dom" %} + {{ host_trap_categories.append("dom")}} + {% elif cat_key == "entity" %} + {{ host_trap_categories.append("entity") }} + {% elif cat_key == "envmon" %} + {{ host_trap_categories.append("envmon") }} + {% elif cat_key == "lldp" %} + {{ host_trap_categories.append("lldp") }} + {% elif cat_key == "snmp" %} + {{ host_trap_categories.append("snmp") }} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% if host_version %} +snmp-server host {{ item.ip }} {{ host_notif_type }} version {{ host_version }}{{ host_port_option }} {{ host_trap_categories|join(" ") }} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + + {% if os10_snmp.snmp_location is defined %} + {% set value = os10_snmp.snmp_location %} + {% if value %} +snmp-server location {{ value }} + {% else %} +no snmp-server location + {% endif %} + {% endif %} + + {% if os10_snmp.snmp_source_interface is defined %} + {% set value = os10_snmp.snmp_source_interface %} + {% if value %} +snmp-server source-interface {{ value.split() | join() }} + {% else %} +no snmp-server source-interface + {% endif %} + {% endif %} + + {% if os10_snmp.snmp_user is defined and os10_snmp.snmp_user %} + {% set value = os10_snmp.snmp_user %} + {% for item in value %} + {% if item.name is defined and item.name and item.group_name is defined and item.group_name %} + {% if item.version is defined and item.version %} + {% if item.state is defined and item.state == "absent" %} + {# snmp user removal is handled above remote engind id #} + {% else %} + {% set user_remote_option = "" %} + {% if item.remote is defined and item.remote %} + {% if item.remote.ip is defined and item.remote.ip %} + {% if item.remote.udpport is defined and item.remote.udpport %} + {% set user_remote_option = " remote " + item.remote.ip + " udp-port " + item.remote.udpport|string %} + {% endif %} + {% endif %} + {% endif %} + {% if item.version|string == "1" or item.version|string == "2c" %} + {% set user_acl_option = "" %} + {% if item.access_list is defined and item.access_list %} + {% set user_acl_option = "access " + item.access_list %} + {% endif %} +snmp-server user {{ item.name }} {{ item.group_name }}{{ user_remote_option }} {{ item.version }} {{ user_acl_option }} + {% else %} + {% set user_auth_option = "" %} + {% if item.authentication is defined and item.authentication %} + {% if item.authentication.localized is defined and item.authentication.localized %} + {% set user_auth_option = " localized" %} + {% endif %} + {% if item.authentication.algorithm is defined and item.authentication.algorithm %} + {% if item.authentication.password is defined and item.authentication.password %} + {% set user_auth_option = user_auth_option + " auth " + item.authentication.algorithm + " " + item.authentication.password %} + {% if item.authentication.encryption is defined and item.authentication.encryption %} + {% if item.authentication.encryption.algorithm is defined and item.authentication.encryption.algorithm %} + {% if item.authentication.encryption.password is defined and item.authentication.encryption.password %} + {% set user_auth_option = user_auth_option + " priv " + item.authentication.encryption.algorithm + " " + item.authentication.encryption.password %} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endif %} +snmp-server user {{ item.name }} {{ item.group_name }}{{ user_remote_option }} {{ item.version }}{{ user_auth_option }} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + + {% if os10_snmp.snmp_view is defined %} + {% set value = os10_snmp.snmp_view %} + {% if value %} + {% for item in value %} + {% if item.name is defined and item.name %} + {% if item.oid_subtree is defined and item.oid_subtree %} + {% if item.state is defined and item.state == "absent" %} +no snmp-server view {{ item.name }} {{ item.oid_subtree }} + {% else %} + {% if item.include is defined %} + {% if item.include %} +snmp-server view {{ item.name }} {{ item.oid_subtree }} included + {% elif not item.include %} +snmp-server view {{ item.name }} {{ item.oid_subtree }} excluded + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% endif %} + + {% if os10_snmp.snmp_vrf is defined %} + {% set value = os10_snmp.snmp_vrf %} + {% if value %} +snmp-server vrf {{ value }} + {% else %} +no snmp-server vrf default + {% endif %} + {% endif %} + +{% endif %} diff --git a/ansible_collections/dellemc/os10/roles/os10_snmp/tests/inventory.yaml b/ansible_collections/dellemc/os10/roles/os10_snmp/tests/inventory.yaml new file mode 100644 index 00000000..b1ff63e6 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_snmp/tests/inventory.yaml @@ -0,0 +1,22 @@ +--- +spine1 ansible_host=10.11.182.25 ansible_network_os="dellemc.os10.os10" +spine2 ansible_host=10.16.151.220 ansible_network_os="dellemc.os10.os10" + +leaf1 ansible_host=10.11.182.23 ansible_network_os="dellemc.os10.os10" +leaf2 ansible_host=10.11.182.16 ansible_network_os="dellemc.os10.os10" +leaf3 ansible_host=10.11.182.17 ansible_network_os="dellemc.os10.os10" +leaf4 ansible_host=10.16.148.79 ansible_network_os="dellemc.os10.os10" + +[spine] +spine1 +spine2 + +[leaf] +leaf1 +leaf2 +leaf3 +leaf4 + +[datacenter:children] +spine +leaf diff --git a/ansible_collections/dellemc/os10/roles/os10_snmp/tests/main.os10.yaml b/ansible_collections/dellemc/os10/roles/os10_snmp/tests/main.os10.yaml new file mode 100644 index 00000000..bafcc210 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_snmp/tests/main.os10.yaml @@ -0,0 +1,29 @@ +--- +# vars file for dellemc.os10.os10_snmp, +# below gives a sample configuration +# Sample variables for OS10 device +os10_snmp: + snmp_contact: test + snmp_location: Chennai + snmp_community: + - name: public + access_mode: ro + state: present + snmp_traps: + - name: all + state: present + snmp_view: + - name: view_1 + oid_subtree: 2 + include: false + state: absent + snmp_host: + - ip: 1.1.1.1 + communitystring: c1 + version: "2c" + udpport: 4 + state: present + - ip: 2.2.2.2 + version: 1 + communitystring: c3 + state: present diff --git a/ansible_collections/dellemc/os10/roles/os10_snmp/tests/test.yaml b/ansible_collections/dellemc/os10/roles/os10_snmp/tests/test.yaml new file mode 100644 index 00000000..6b4b4e7e --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_snmp/tests/test.yaml @@ -0,0 +1,5 @@ +--- +- hosts: datacenter + connection: network_cli + roles: + - dellemc.os10.os10_snmp diff --git a/ansible_collections/dellemc/os10/roles/os10_snmp/vars/main.yml b/ansible_collections/dellemc/os10/roles/os10_snmp/vars/main.yml new file mode 100644 index 00000000..407dad8e --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_snmp/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for dellemc.os10.os10_snmp diff --git a/ansible_collections/dellemc/os10/roles/os10_system/LICENSE b/ansible_collections/dellemc/os10/roles/os10_system/LICENSE new file mode 100644 index 00000000..2c9b8e1f --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_system/LICENSE @@ -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) 2020, Dell Inc. All rights reserved. + + 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) 2020, Dell Inc. All rights reserved. + 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>. diff --git a/ansible_collections/dellemc/os10/roles/os10_system/README.md b/ansible_collections/dellemc/os10/roles/os10_system/README.md new file mode 100644 index 00000000..119138af --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_system/README.md @@ -0,0 +1,126 @@ +System role +=========== + +This role facilitates the configuration of global system attributes. It specifically enables configuration of hostname and hashing algorithm. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. + +The System role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. + +Role variables +-------------- + +- Role is abstracted using the `ansible_network_os` variable that can take `dellemc.os10.os10` as the value +- If `os10_cfg_generate` is set to true, the variable generates the role configuration commands in a file +- Any role variable with a corresponding state variable set to absent negates the configuration of that variable +- Setting an empty value for any variable negates the corresponding configuration +- Variables and values are case-sensitive + +**os10_system keys** + +| Key | Type | Description | Support | +|------------|---------------------------|---------------------------------------------------------|-----------------------| +| ``hostname`` | string | Configures a hostname to the device (no negate command) | os10 | +| ``hardware_forwarding`` | string: scaled-l2,scaled-l3-routes,scaled-l3-hosts | Configures hardware forwarding mode | os10 | +| ``hash_algo`` | dictionary | Configures hash algorithm commands (see ``hash_algo.*``) | os10 | +| ``hash_algo.algo`` | list | Configures hashing algorithm (see ``algo.*``) | os10 | +| ``algo.name`` | string (required) | Configures the name of the hashing algorithm | os10 | +| ``algo.mode`` | string (required) | Configures the hashing algorithm mode | os10 | +| ``algo.state`` | string: absent,present\* | Deletes the hashing algorithm if set to absent | os10 | +| ``load_balance`` | dictionary | Configures the global traffic load balance (see ``load_balance.*``) | os10 | +| ``load_balance.ingress_port`` | boolean: true,false | Specifies whether to use the source port ID for the hashing algorithm | os10 | +| ``load_balance.ip_selection`` | list | Configures IPv4 key fields to use in hashing algorithm; | os10 | +| ``ip_selection.field`` | string | Configures IPv4 key fields to use in hashing algorithm | os10 | +| ``ip_selection.state`` | string: absent,present\* | Deletes the IPv4 key fields if set to absent | os10 | +| ``load_balance.ipv6_selection`` | list | Configures IPv6 key fields to use in hashing algorithm | os10 | +| ``ipv6_selection.field`` | string | Configures IPv6 key fields to use in hashing algorithm | os10 | +| ``ipv6_selection.state`` | string: absent,present\* | Deletes the IPv6 key fields if set to absent | os10 | +| ``load_balance.mac_selection`` | list | Configures MAC key fields to use in hashing algorithm (see ``mac_selection.*``) | os10 | +| ``mac_selection.field`` | string | Configures MAC key fields to use in hashing algorithm | os10 | +| ``mac_selection.state`` | string: absent,present\* | Deletes the MAC key fields if set to absent | os10 | +| ``load_balance.tcp_udp_selection`` | list | Configures TCP UDP ports for load balancing configurations (see ``tcp_udp_selection.*``) | os10 | +| ``tcp_udp_selection.field`` | string | Configures TCP UDP port fields to use in hashing algorithm | os10 | +| ``tcp_udp_selection.state`` | string: absent,present\* | Deletes the TCP UDP ports if set to absent | os10 | +| ``min_ra`` | string | Configures global RA minimum interval value, applicable to all interfaces across VRFs | os10 | +| ``max_ra`` | string | Configures global RA maximum interval value, applicable to all interfaces across VRFs | os10 | + +> **NOTE**: Asterisk (\*) denotes the default value if none is specified. + +Connection variables +-------------------- + +Ansible Dell EMC network roles require connection information to establish communication with the nodes in your inventory. This information can exist in the Ansible *group_vars* or *host_vars* directories, or inventory or in the playbook itself. + +| Key | Required | Choices | Description | +|-------------|----------|------------|-----------------------------------------------------| +| ``ansible_host`` | yes | | Specifies the hostname or address for connecting to the remote device over the specified transport | +| ``ansible_port`` | no | | Specifies the port used to build the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_PORT` option is used; it defaults to 22 | +| ``ansible_ssh_user`` | no | | Specifies the username that authenticates the CLI login for the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_USER` environment variable value is used | +| ``ansible_ssh_pass`` | no | | Specifies the password that authenticates the connection to the remote device | +| ``ansible_become`` | no | yes, no\* | Instructs the module to enter privileged mode on the remote device before sending any commands; if value is unspecified, the `ANSIBLE_BECOME` environment variable value is used, and the device attempts to execute all commands in non-privileged mode | +| ``ansible_become_method`` | no | enable, sudo\* | Instructs the module to allow the become method to be specified for handling privilege escalation; if value is unspecified, the `ANSIBLE_BECOME_METHOD` environment variable value is used | +| ``ansible_become_pass`` | no | | Specifies the password to use if required to enter privileged mode on the remote device; if ``ansible_become`` is set to no this key is not applicable | +| ``ansible_network_os`` | yes | os10, null\* | Loads the correct terminal and cliconf plugins to communicate with the remote device | + +> **NOTE**: Asterisk (\*) denotes the default value if none is specified. + + +Example playbook +---------------- + +This example uses the *os10_system role* to completely set the NTP server, hostname, enable password, management route, hash alogrithm, clock, line terminal, banner and reload type. It creates a *hosts* file with the switch details and corresponding variables. The hosts file should define the `ansible_network_os` variable with corresponding Dell EMC OS10 name. + +When `os10_cfg_generate` is set to true, the variable generates the configuration commands as a .part file in *build_dir* path. By default, the variable is set to false. The system role writes a simple playbook that only references the *os10_system* role. By including the role, you automatically get access to all of the tasks to configure system features. + +**Sample hosts file** + + leaf1 ansible_host= <ip_address> + +**Sample host_vars/leaf1** + + hostname: leaf1 + ansible_become: yes + ansible_become_method: xxxxx + ansible_become_pass: xxxxx + ansible_ssh_user: xxxxx + ansible_ssh_pass: xxxxx + ansible_network_os: dellemc.os10.os10 + build_dir: ../temp/temp_os10 + + os10_system: + hostname: os10 + hardware_forwarding: scaled-l3-hosts + hash_algo: + algo: + - name: lag + mode: crc + state: present + - name: ecmp + mode: xor + state: present + load_balance: + ingress_port: true + ip_selection: + - field: source-ip + state: present + ipv6_selection: + - field: source-ip + state: present + mac_selection: + - field: source-mac + state: present + tcp_udp_selection: + - field: l4-source-port + state: present + max_ra: 15 + min_ra: 10 + +**Simple playbook to setup system — leaf.yaml** + + - hosts: leaf1 + roles: + - dellemc.os10.os10_system + +**Run** + + ansible-playbook -i hosts leaf.yaml + +(c) 2017-2020 Dell Inc. or its subsidiaries. All rights reserved. diff --git a/ansible_collections/dellemc/os10/roles/os10_system/defaults/main.yml b/ansible_collections/dellemc/os10/roles/os10_system/defaults/main.yml new file mode 100644 index 00000000..55924055 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_system/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for dellemc.os10.os10_system diff --git a/ansible_collections/dellemc/os10/roles/os10_system/handlers/main.yml b/ansible_collections/dellemc/os10/roles/os10_system/handlers/main.yml new file mode 100644 index 00000000..b7913129 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_system/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for dellemc.os10.os10_system diff --git a/ansible_collections/dellemc/os10/roles/os10_system/meta/main.yml b/ansible_collections/dellemc/os10/roles/os10_system/meta/main.yml new file mode 100644 index 00000000..588850b6 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_system/meta/main.yml @@ -0,0 +1,18 @@ +# Copyright (c) 2020 Dell Inc. +--- +galaxy_info: + author: Dell EMC Networking Engineering + description: The os10_system role facilitates the configuration of system attributes in devices running Dell EMC SmartFabric OS10. + company: Dell Technologies + license: GPLv3 + min_ansible_version: 2.9.6 + + platforms: + - name: os10 + + galaxy_tags: + - networking + - dell + - emc + - dellemc + - os10 diff --git a/ansible_collections/dellemc/os10/roles/os10_system/tasks/main.yml b/ansible_collections/dellemc/os10/roles/os10_system/tasks/main.yml new file mode 100644 index 00000000..5b61c862 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_system/tasks/main.yml @@ -0,0 +1,16 @@ +--- +# tasks file for os10 + - name: "Generating system configuration for os10" + template: + src: os10_system.j2 + dest: "{{ build_dir }}/system10_{{ hostname }}.conf.part" + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") and ((os10_cfg_generate | default('False')) | bool) +# notify: save config os10 + register: generate_output + + - name: "Provisioning system configuration for os10" + os10_config: + src: os10_system.j2 + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") +# notify: save config os10 + register: output diff --git a/ansible_collections/dellemc/os10/roles/os10_system/templates/os10_system.j2 b/ansible_collections/dellemc/os10/roles/os10_system/templates/os10_system.j2 new file mode 100644 index 00000000..95edc2eb --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_system/templates/os10_system.j2 @@ -0,0 +1,130 @@ +#jinja2: trim_blocks: True,lstrip_blocks: True +{############################################# + +Purpose: +Configure system commands for os10 Devices + +os10_system: + hostname: os10 + hardware_forwarding: scaled-l3-routes + hash_algo: + algo: + - name: lag + mode: crc + state: present + - name: ecmp + mode: xor + state: present + load_balance: + ingress_port: true + ip_selection: + - field: source-ip + state: present + ipv6_selection: + - field: source-ip + state: present + mac_selection: + - field: source-mac + state: present + tcp_udp_selection: + - field: l4-source-port + state: present + max_ra: 15 + min_ra: 10 + +###############################################} +{% if os10_system is defined and os10_system %} +{% if os10_system.hostname is defined and os10_system.hostname %} +hostname {{ os10_system.hostname }} +{% endif %} +{% if os10_system.max_ra is defined %} + {% if os10_system.max_ra %} +ipv6 nd max-ra-interval {{ os10_system.max_ra }} + {% else %} +no ipv6 nd max-ra-interval + {% endif %} +{% endif %} +{% if os10_system.min_ra is defined %} + {% if os10_system.min_ra %} +ipv6 nd min-ra-interval {{ os10_system.min_ra }} + {% else %} +no ipv6 nd min-ra-interval + {% endif %} +{% endif %} +{% for key,value in os10_system.items() %} + {% if key == "hardware_forwarding" %} + {% if value %} +hardware forwarding-table mode {{ value }} + {% else %} +no hardware forwarding-table mode + {% endif %} + {% elif key == "hash_algo" and value %} + {% if value.algo is defined and value.algo %} + {% for item in value.algo %} + {% if item.name is defined and item.name %} + {% if item.mode is defined and item.mode %} + {% if item.state is defined and item.state == "absent" %} +no hash-algorithm {{ item.name }} {{ item.mode }} + {% else %} +hash-algorithm {{ item.name }} {{ item.mode }} + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% elif key == "load_balance" and value %} + {% if value.ingress_port is defined %} + {% if value.ingress_port %} +load-balancing ingress-port enable + {% else %} +no load-balancing ingress-port enable + {% endif %} + {% endif %} + {% if value.ip_selection is defined and value.ip_selection %} + {% for listitem in value.ip_selection %} + {% if listitem.field is defined and listitem.field %} + {% if listitem.state is defined and listitem.state == "absent" %} +no load-balancing ip-selection {{ listitem.field }} + {% else %} +load-balancing ip-selection {{ listitem.field }} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% if value.ipv6_selection is defined and value.ipv6_selection %} + {% for listitem in value.ipv6_selection %} + {% if listitem.field is defined and listitem.field %} + {% if listitem.state is defined and listitem.state == "absent" %} +no load-balancing ipv6-selection {{ listitem.field }} + {% else %} +load-balancing ipv6-selection {{ listitem.field }} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% if value.mac_selection is defined and value.mac_selection %} + {% for listitem in value.mac_selection %} + {% if listitem.field is defined and listitem.field %} + {% if listitem.state is defined and listitem.state == "absent" %} +no load-balancing mac-selection {{ listitem.field }} + {% else %} +load-balancing mac-selection {{ listitem.field }} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% if value.tcp_udp_selection is defined and value.tcp_udp_selection %} + {% for listitem in value.tcp_udp_selection %} + {% if listitem.field is defined and listitem.field %} + {% if listitem.state is defined and listitem.state == "absent" %} +no load-balancing tcp-udp-selection {{ listitem.field }} + {% else %} +load-balancing tcp-udp-selection {{ listitem.field }} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + + {% endif %} +{% endfor %} +{% endif %} diff --git a/ansible_collections/dellemc/os10/roles/os10_system/tests/inventory.yaml b/ansible_collections/dellemc/os10/roles/os10_system/tests/inventory.yaml new file mode 100644 index 00000000..b1ff63e6 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_system/tests/inventory.yaml @@ -0,0 +1,22 @@ +--- +spine1 ansible_host=10.11.182.25 ansible_network_os="dellemc.os10.os10" +spine2 ansible_host=10.16.151.220 ansible_network_os="dellemc.os10.os10" + +leaf1 ansible_host=10.11.182.23 ansible_network_os="dellemc.os10.os10" +leaf2 ansible_host=10.11.182.16 ansible_network_os="dellemc.os10.os10" +leaf3 ansible_host=10.11.182.17 ansible_network_os="dellemc.os10.os10" +leaf4 ansible_host=10.16.148.79 ansible_network_os="dellemc.os10.os10" + +[spine] +spine1 +spine2 + +[leaf] +leaf1 +leaf2 +leaf3 +leaf4 + +[datacenter:children] +spine +leaf diff --git a/ansible_collections/dellemc/os10/roles/os10_system/tests/main.os10.yaml b/ansible_collections/dellemc/os10/roles/os10_system/tests/main.os10.yaml new file mode 100644 index 00000000..ea4bc20f --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_system/tests/main.os10.yaml @@ -0,0 +1,31 @@ +--- +# vars file for dellemc.os10.os10_system, +# below gives a sample configuration +# Sample variables for OS10 device +os10_system: + hostname: os10 + hardware_forwarding: scaled-l3-hosts + hash_algo: + algo: + - name: lag + mode: crc + state: present + - name: ecmp + mode: xor + state: present + load_balance: + ingress_port: true + ip_selection: + - field: source-ip + state: present + ipv6_selection: + - field: source-ip + state: present + mac_selection: + - field: source-mac + state: present + tcp_udp_selection: + - field: l4-source-port + state: present + max_ra: 15 + min_ra: 10 diff --git a/ansible_collections/dellemc/os10/roles/os10_system/tests/test.yaml b/ansible_collections/dellemc/os10/roles/os10_system/tests/test.yaml new file mode 100644 index 00000000..8674f097 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_system/tests/test.yaml @@ -0,0 +1,5 @@ +--- +- hosts: datacenter + connection: network_cli + roles: + - dellemc.os10.os10_system diff --git a/ansible_collections/dellemc/os10/roles/os10_system/vars/main.yml b/ansible_collections/dellemc/os10/roles/os10_system/vars/main.yml new file mode 100644 index 00000000..4a69de59 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_system/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for dellemc.os10.os10_system, diff --git a/ansible_collections/dellemc/os10/roles/os10_template/LICENSE b/ansible_collections/dellemc/os10/roles/os10_template/LICENSE new file mode 100644 index 00000000..2c9b8e1f --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_template/LICENSE @@ -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) 2020, Dell Inc. All rights reserved. + + 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) 2020, Dell Inc. All rights reserved. + 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>. diff --git a/ansible_collections/dellemc/os10/roles/os10_template/README.md b/ansible_collections/dellemc/os10/roles/os10_template/README.md new file mode 100644 index 00000000..d7faf013 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_template/README.md @@ -0,0 +1,75 @@ +Template role +============== + +This role provides access to structured data from show commands. This role facilitates the TEXTFSM parsing engine. TextFSM is a template based state machine . It takes the raw string input from the CLI of network devices, run them through a TEXTFSM template and return structured text in the form of a Python dictionary. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. + +The Template role is highly customizable, and it works with separate template definitions which contain variables and rules with regular expressions. This library is very helpful to parse any text-based CLI output from network devices. The Template role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. + +Role variables +-------------- + +- Role is abstracted using the `ansible_network_os` variable that can take `dellemc.os10.os10` as the value +- Variables and values are case-sensitive + +Connection variables +-------------------- + +Ansible Dell EMC network roles require connection information to establish communication with the nodes in your inventory. This information can exist in the Ansible *group_vars* or *host_vars* directories or inventory, or in the playbook itself. + +| Key | Required | Choices | Description | +|-------------|----------|------------|-----------------------------------------------------| +| ``ansible_host`` | yes | | Specifies the hostname or address for connecting to the remote device over the specified transport | +| ``ansible_port`` | no | | Specifies the port used to build the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_PORT` option is used; it defaults to 22 | +| ``ansible_ssh_user`` | no | | Specifies the username that authenticates the CLI login for the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_USER` environment variable value is used | +| ``ansible_ssh_pass`` | no | | Specifies the password that authenticates the connection to the remote device | +| ``ansible_become`` | no | yes, no\* | Instructs the module to enter privileged mode on the remote device before sending any commands; if value is unspecified, the `ANSIBLE_BECOME` environment variable value is used, and the device attempts to execute all commands in non-privileged mode | +| ``ansible_become_method`` | no | enable, sudo\* | Instructs the module to allow the become method to be specified for handling privilege escalation; if value is unspecified, the `ANSIBLE_BECOME_METHOD` environment variable value is used | +| ``ansible_become_pass`` | no | | Specifies the password to use if required to enter privileged mode on the remote device; if ``ansible_become`` is set to no this key is not applicable | +| ``ansible_network_os`` | yes | os10, null\* | Loads the correct terminal and cliconf plugins to communicate with the remote device | + +> **NOTE**: Asterisk (\*) denotes the default value if none is specified. + + +Example playbook +---------------- + +This example uses the *os10_template* role to parse any text-based CLI output. It creates a *hosts* file with the switch details and corresponding variables. The hosts file should define the `ansible_network_os` variable with corresponding Dell EMC OS10 name. All the supported CLI commands are imported as tasks in tasks/main.yml. + +For the *os10_template* role plugins to be used, you may need to specify the actual path of role in *ansible.cfg* file. + +**Sample ansible.cfg** + + action_plugins = ../../plugins/modules/ + + +**Sample hosts file** + + leaf1 ansible_host= <ip_address> ansible_network_os=dellemc.os10.os10 ansible_ssh_user=xxxxx ansible_ssh_pass=xxxxx + + +**Simple playbook to setup system — leaf.yaml** + + - hosts: leaf1 + roles: + - dellemc.os10.os10_template + +**Example playbook to run specific show command — leaf.yaml** + + + --- + - name: PARSE SHOW IP INTERFACE BRIEF + hosts: leaf1 + collections: + - dellemc.os10 + tasks: + - import_role: + name: os10_template + tasks_from: show_ip_interface_brief.yaml + + + +**Run** + + ansible-playbook -i hosts leaf.yaml + +(c) 2017-2020 Dell Inc. or its subsidiaries. All rights reserved. diff --git a/ansible_collections/dellemc/os10/roles/os10_template/meta/main.yml b/ansible_collections/dellemc/os10/roles/os10_template/meta/main.yml new file mode 100644 index 00000000..4df1a6b4 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_template/meta/main.yml @@ -0,0 +1,18 @@ +# Copyright (c) 2020 Dell Inc. or its subsidiaries. All Rights Reserved. +--- +galaxy_info: + role_name: os10_template + author: Dell EMC Networking Engineering + description: The os10_template role facilitates to provide the structured output from CLI in devices running on Dell EMC SmartFabric OS10. + license: GPLv3 + min_ansible_version: 2.9.6 + + platforms: + - name: os10 + + galaxy_tags: + - networking + - dell + - emc + - dellemc + - os10 diff --git a/ansible_collections/dellemc/os10/roles/os10_template/tasks/main.yml b/ansible_collections/dellemc/os10/roles/os10_template/tasks/main.yml new file mode 100644 index 00000000..9b41a6c2 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_template/tasks/main.yml @@ -0,0 +1,24 @@ +--- + - name: os10 dellemc.os10.os10_template test + import_tasks: show_ip_interface_brief.yaml + + - name: os10 dellemc.os10.os10_template test + import_tasks: show_port-channel_summary.yaml + + - name: os10 dellemc.os10.os10_template test + import_tasks: show_lldp_neighbors.yaml + + - name: os10 dellemc.os10.os10_template test + import_tasks: show_ip_vrf.yaml + + - name: os10 dellemc.os10.os10_template test + import_tasks: show_ip_bgp_summary.yaml + + - name: os10 dellemc.os10.os10_template test + import_tasks: show_vlan.yaml + + - name: os10 dellemc.os10.os10_template test + import_tasks: show_vlt_err_disabled_ports.yaml + + - name: os10 dellemc.os10.os10_template test + import_tasks: show_spanning_tree_compatibility_mode.yaml diff --git a/ansible_collections/dellemc/os10/roles/os10_template/tasks/show_ip_bgp_summary.yaml b/ansible_collections/dellemc/os10/roles/os10_template/tasks/show_ip_bgp_summary.yaml new file mode 100644 index 00000000..d2ee2ac7 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_template/tasks/show_ip_bgp_summary.yaml @@ -0,0 +1,21 @@ +--- + - name: CAPTURE SHOW IP BGP SUMMARY + os10_command: + commands: + - show ip bgp summary + register: output + + - name: DISPLAY THE OUTPUT + debug: var=output.stdout + + - name: INSTALL TEXTFSM + import_tasks: textfsm.yaml + + - name: PARSE THE OUTPUT for {{ ansible_network_os }} show_ip_bgp_summary + textfsm_parser: + src: "{{ lookup('file', './templates/os10_show_ip_bgp_summary.template') }}" + content: "{{ output.stdout[0] }}" + name: bgp_facts + register: result + vars: + - ansible_network_os: dellemc.os10.os10 diff --git a/ansible_collections/dellemc/os10/roles/os10_template/tasks/show_ip_interface_brief.yaml b/ansible_collections/dellemc/os10/roles/os10_template/tasks/show_ip_interface_brief.yaml new file mode 100644 index 00000000..f2996775 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_template/tasks/show_ip_interface_brief.yaml @@ -0,0 +1,21 @@ +--- + - name: CAPTURE SHOW_IP_INTERFACE_BRIEF + os10_command: + commands: + - show ip interface brief + register: output + + - name: DISPLAY THE OUTPUT + debug: var=output.stdout + + - name: INSTALL TEXTFSM + import_tasks: textfsm.yaml + + - name: PARSE THE OUTPUT for {{ ansible_network_os }} show_ip_interface_brief + textfsm_parser: + src: "{{ lookup('file', './templates/os10_show_ip_interface_brief.template') }}" + content: " {{ output.stdout[0] }}" + name: ip_interface_facts + register: result + vars: + - ansible_network_os: dellemc.os10.os10 diff --git a/ansible_collections/dellemc/os10/roles/os10_template/tasks/show_ip_vrf.yaml b/ansible_collections/dellemc/os10/roles/os10_template/tasks/show_ip_vrf.yaml new file mode 100644 index 00000000..616416ed --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_template/tasks/show_ip_vrf.yaml @@ -0,0 +1,21 @@ +--- + - name: CAPTURE SHOW IP VRF + os10_command: + commands: + - show ip vrf + register: output + + - name: DISPLAY THE OUTPUT + debug: var=output.stdout + + - name: INSTALL TEXTFSM + import_tasks: textfsm.yaml + + - name: PARSE THE OUTPUT for {{ ansible_network_os }} show_ip_vrf + textfsm_parser: + src: "{{ lookup('file', './templates/os10_show_ip_vrf.template') }}" + content: "{{ output.stdout[0] }}" + name: vrf_facts + register: result + vars: + - ansible_network_os: dellemc.os10.os10 diff --git a/ansible_collections/dellemc/os10/roles/os10_template/tasks/show_lldp_neighbors.yaml b/ansible_collections/dellemc/os10/roles/os10_template/tasks/show_lldp_neighbors.yaml new file mode 100644 index 00000000..1fedfe4b --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_template/tasks/show_lldp_neighbors.yaml @@ -0,0 +1,21 @@ +--- + - name: CAPTURE SHOW LLDP NEIGHBORS + os10_command: + commands: + - show lldp neighbors + register: output + + - name: DISPLAY THE OUTPUT + debug: var=output.stdout + + - name: INSTALL TEXTFSM + import_tasks: textfsm.yaml + + - name: PARSE THE OUTPUT for {{ ansible_network_os }} show_lldp_neighbors + textfsm_parser: + src: "{{ lookup('file', './templates/os10_show_lldp_neighbors.template') }}" + content: "{{ output.stdout[0] }}" + name: lldp_facts + register: result + vars: + - ansible_network_os: dellemc.os10.os10 diff --git a/ansible_collections/dellemc/os10/roles/os10_template/tasks/show_port-channel_summary.yaml b/ansible_collections/dellemc/os10/roles/os10_template/tasks/show_port-channel_summary.yaml new file mode 100644 index 00000000..2d26c14e --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_template/tasks/show_port-channel_summary.yaml @@ -0,0 +1,21 @@ +--- + - name: CAPTURE SHOW PORT-CHANNEL SUMMARY + os10_command: + commands: + - show port-channel summary + register: output + + - name: DISPLAY THE OUTPUT + debug: var=output.stdout + + - name: INSTALL TEXTFSM + import_tasks: textfsm.yaml + + - name: PARSE THE OUTPUT for {{ ansible_network_os }} show_port-channel_summary + textfsm_parser: + src: "{{ lookup('file', './templates/os10_show_port-channel_summary.template') }}" + content: "{{ output.stdout[0] }}" + name: port_channel_facts + register: result + vars: + - ansible_network_os: dellemc.os10.os10 diff --git a/ansible_collections/dellemc/os10/roles/os10_template/tasks/show_spanning_tree_compatibility_mode.yaml b/ansible_collections/dellemc/os10/roles/os10_template/tasks/show_spanning_tree_compatibility_mode.yaml new file mode 100644 index 00000000..a3c69524 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_template/tasks/show_spanning_tree_compatibility_mode.yaml @@ -0,0 +1,21 @@ +--- + - name: CAPTURE SHOW SPANNING TREE COMPATIBILITY MODE + os10_command: + commands: + - command: show spanning-tree compatibility-mode + register: output + + - name: DISPLAY THE OUTPUT + debug: var=output.stdout + + - name: INSTALL TEXTFSM + import_tasks: textfsm.yaml + + - name: PARSE THE OUTPUT for {{ ansible_network_os }} show_spanning_tree_compatibility_mode + textfsm_parser: + src: "{{ lookup('file', './templates/os10_show_spanning_tree_compatibility_mode.template') }}" + content: "{{ output.stdout[0] }}" + name: spanning_tree_comp_mode_facts + register: result + vars: + - ansible_network_os: dellemc.os10.os10 diff --git a/ansible_collections/dellemc/os10/roles/os10_template/tasks/show_vlan.yaml b/ansible_collections/dellemc/os10/roles/os10_template/tasks/show_vlan.yaml new file mode 100644 index 00000000..ee3c988e --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_template/tasks/show_vlan.yaml @@ -0,0 +1,21 @@ +--- + - name: CAPTURE SHOW VLAN + os10_command: + commands: + - show vlan + register: output + + - name: DISPLAY THE OUTPUT + debug: var=output.stdout + + - name: INSTALL TEXTFSM + import_tasks: textfsm.yaml + + - name: PARSE THE OUTPUT for {{ ansible_network_os }} show_vlan + textfsm_parser: + src: "{{ lookup('file', './templates/os10_show_vlan.template') }}" + content: "{{ output.stdout[0] }}" + name: vlan_facts + register: result + vars: + - ansible_network_os: dellemc.os10.os10 diff --git a/ansible_collections/dellemc/os10/roles/os10_template/tasks/show_vlt_err_disabled_ports.yaml b/ansible_collections/dellemc/os10/roles/os10_template/tasks/show_vlt_err_disabled_ports.yaml new file mode 100644 index 00000000..0e0f8b3d --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_template/tasks/show_vlt_err_disabled_ports.yaml @@ -0,0 +1,20 @@ +--- + - name: CAPTURE SHOW VLT ERR DISABLED PORTS + dellos10_command: + commands: ['show vlt all error-disabled-ports'] + register: output + + - name: DISPLAY THE OUTPUT + debug: var=output.stdout + + - name: INSTALL TEXTFSM + import_tasks: textfsm.yaml + + - name: PARSE THE OUTPUT for {{ ansible_network_os }} show_vlt_err_dis_ports + textfsm_parser: + src: "{{ lookup('file', './templates/os10_show_vlt_err_disabled_ports.template') }}" + content: "{{ output.stdout[0] }}" + name: vlt_err_dis_facts + register: result + vars: + - ansible_network_os: dellemc.os10.os10 diff --git a/ansible_collections/dellemc/os10/roles/os10_template/tasks/textfsm.yaml b/ansible_collections/dellemc/os10/roles/os10_template/tasks/textfsm.yaml new file mode 100644 index 00000000..99394b44 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_template/tasks/textfsm.yaml @@ -0,0 +1,3 @@ +#Install Textfsm + - pip: + name: textfsm diff --git a/ansible_collections/dellemc/os10/roles/os10_template/templates/os10_show_ip_bgp_summary.template b/ansible_collections/dellemc/os10/roles/os10_template/templates/os10_show_ip_bgp_summary.template new file mode 100644 index 00000000..52ddc289 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_template/templates/os10_show_ip_bgp_summary.template @@ -0,0 +1,16 @@ +Value Filldown RouterId (\d+\.\d+\.\d+\.\d+) +Value Filldown LocalAs (\d+) +Value Filldown BFD (enabled) +Value Neighbor (\S+) +Value AS (\d+) +Value MsgRcvd (\d+) +Value MsgSent (\d+) +Value Status (\S+) +Value State (\S+) + +Start + ^BGP router identifier ${RouterId} local AS number ${LocalAs} + ^Global BFD is ${BFD} + ^(?!Neighbor)${Neighbor}\s+${AS}\s+${MsgRcvd}\s+${MsgSent}\s+${Status}\s+${State} -> Record + +EOF diff --git a/ansible_collections/dellemc/os10/roles/os10_template/templates/os10_show_ip_interface_brief.template b/ansible_collections/dellemc/os10/roles/os10_template/templates/os10_show_ip_interface_brief.template new file mode 100644 index 00000000..20d01717 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_template/templates/os10_show_ip_interface_brief.template @@ -0,0 +1,9 @@ +Value INTERFACE_NAME (\S+\s\S+) +Value IP_ADDRESS (\S+) +Value OK (YES|NO) +Value METHOD (DHCP|manual|unset) +Value STATUS (up|down|admin down) +Value PROTOCOL (up|down|admin down) + +Start + ^${INTERFACE_NAME}\s+${IP_ADDRESS}\s+${OK}\s+${METHOD}\s+${STATUS}\s+${PROTOCOL} -> Record diff --git a/ansible_collections/dellemc/os10/roles/os10_template/templates/os10_show_ip_vrf.template b/ansible_collections/dellemc/os10/roles/os10_template/templates/os10_show_ip_vrf.template new file mode 100644 index 00000000..c7e4d754 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_template/templates/os10_show_ip_vrf.template @@ -0,0 +1,7 @@ +Value VRFName (\S+) +Value Interfaces (\S+) + +Start + ^(?!VRF-Name)${VRFName}\s+${Interfaces} -> Record + ^(?!VRF-Name)${VRFName} -> Record + ^\s+${Interfaces} -> Record diff --git a/ansible_collections/dellemc/os10/roles/os10_template/templates/os10_show_lldp_neighbors.template b/ansible_collections/dellemc/os10/roles/os10_template/templates/os10_show_lldp_neighbors.template new file mode 100644 index 00000000..3c935313 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_template/templates/os10_show_lldp_neighbors.template @@ -0,0 +1,7 @@ +Value LocPortID (\S+) +Value RemHostName (\S+) +Value RemPortId (\S+) +Value RemChassisId ([a-fA-F0-9:]{17}) + +Start + ^${LocPortID}\s+${RemHostName}\s+${RemPortId}\s+${RemChassisId} -> Record diff --git a/ansible_collections/dellemc/os10/roles/os10_template/templates/os10_show_port-channel_summary.template b/ansible_collections/dellemc/os10/roles/os10_template/templates/os10_show_port-channel_summary.template new file mode 100644 index 00000000..1e77b92e --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_template/templates/os10_show_port-channel_summary.template @@ -0,0 +1,9 @@ +Value GROUP (\d+) +Value PORT_CHANNEL (\S+\s+[(D)|(U)]+) +Value TYPE ([Eth|Gig|ten|For]+) +Value PROTOCOL ([DYNAMIC|STATIC]+) +Value List MEMBER_PORTS (\s.*) + +Start + ^${GROUP}\s+${PORT_CHANNEL}\s+${TYPE}\s+${PROTOCOL}\s+${MEMBER_PORTS} -> Record + ^${GROUP}\s+${PORT_CHANNEL}\s+${TYPE}\s+${PROTOCOL} -> Record diff --git a/ansible_collections/dellemc/os10/roles/os10_template/templates/os10_show_spanning_tree_compatibility_mode.template b/ansible_collections/dellemc/os10/roles/os10_template/templates/os10_show_spanning_tree_compatibility_mode.template new file mode 100644 index 00000000..bf365e33 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_template/templates/os10_show_spanning_tree_compatibility_mode.template @@ -0,0 +1,6 @@ +Value Interface_name ([a-zA-Z\-]+\s*[\d\/\:]+) +Value Instance (VLAN\s+(\d+)) +Value Compatibility_mode (\S+\s*) + +Start + ^${Interface_name}\s+${Instance}\s+${Compatibility_mode} -> Record diff --git a/ansible_collections/dellemc/os10/roles/os10_template/templates/os10_show_vlan.template b/ansible_collections/dellemc/os10/roles/os10_template/templates/os10_show_vlan.template new file mode 100644 index 00000000..f71e9573 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_template/templates/os10_show_vlan.template @@ -0,0 +1,12 @@ +Value Codes (\*|\@|\M|\R|\s) +Value NUM (\d+) +Value Status (Active|Inactive) +Value Description (\S+|\s+) +Value Q (A|T) +Value Ports (\S+) + +Start + ^${Codes}\s+${NUM}\s+${Status}\s+${Description}\s+${Q}\s+${Ports} -> Record + ^${Codes}\s+${NUM}\s+${Status}\s+${Description} -> Record + ^${Codes}\s+${NUM}\s+${Status} -> Record + ^\s+${Q}\s+${Ports} -> Record diff --git a/ansible_collections/dellemc/os10/roles/os10_template/templates/os10_show_vlt_err_disabled_ports.template b/ansible_collections/dellemc/os10/roles/os10_template/templates/os10_show_vlt_err_disabled_ports.template new file mode 100644 index 00000000..340b7a2b --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_template/templates/os10_show_vlt_err_disabled_ports.template @@ -0,0 +1,5 @@ +Value VLT_PORT_CHANNEL_ID (\d+) +Value PORT_CHANNEL (\S+\s*) + +Start + ^${VLT_PORT_CHANNEL_ID}\s+${PORT_CHANNEL} -> Record diff --git a/ansible_collections/dellemc/os10/roles/os10_template/tests/group_vars/all b/ansible_collections/dellemc/os10/roles/os10_template/tests/group_vars/all new file mode 100644 index 00000000..902b3301 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_template/tests/group_vars/all @@ -0,0 +1,3 @@ +ansible_ssh_user: xxxx +ansible_ssh_pass: xxxx +ansible_network_os: dellemc.os10.os10 diff --git a/ansible_collections/dellemc/os10/roles/os10_template/tests/inventory.yaml b/ansible_collections/dellemc/os10/roles/os10_template/tests/inventory.yaml new file mode 100644 index 00000000..a76e0817 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_template/tests/inventory.yaml @@ -0,0 +1,22 @@ +--- +spine1 ansible_host=10.11.182.25 ansible_network_os="dellemc.os10.os10" +spine2 ansible_host=10.16.151.220 ansible_network_os="dellemc.os10.os10" + +leaf1 ansible_host=10.11.182.23 ansible_network_os="dellemc.os10.os10" +leaf2 ansible_host=10.11.182.16 ansible_network_os="dellemc.os10.os10" +leaf3 ansible_host=10.11.182.17 ansible_network_os="dellemc.os10.os10" +leaf4 ansible_host=10.16.148.79 ansible_network_os="dellemc.os10.os10" + +[spine] +spine1 +spine2 + +[leaf] +leaf1 +leaf2 +leaf3 +leaf4 + +[LeafAndSpineSwitch:children] +spine +leaf diff --git a/ansible_collections/dellemc/os10/roles/os10_template/tests/main.yaml b/ansible_collections/dellemc/os10/roles/os10_template/tests/main.yaml new file mode 100644 index 00000000..ca1c43cc --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_template/tests/main.yaml @@ -0,0 +1,5 @@ +--- +- hosts: LeafAndSpineSwitch + connection: network_cli + roles: + - dellemc.os10.os10_template diff --git a/ansible_collections/dellemc/os10/roles/os10_template/tests/test.yaml b/ansible_collections/dellemc/os10/roles/os10_template/tests/test.yaml new file mode 100644 index 00000000..6d49466d --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_template/tests/test.yaml @@ -0,0 +1,9 @@ +--- +- hosts: LeafAndSpineSwitch + connection: network_cli + collections: + - dellemc.os10 + tasks: + - import_role: + name: os10_template + tasks_from: show_ip_interface_brief.yaml diff --git a/ansible_collections/dellemc/os10/roles/os10_uplink/LICENSE b/ansible_collections/dellemc/os10/roles/os10_uplink/LICENSE new file mode 100644 index 00000000..2c9b8e1f --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_uplink/LICENSE @@ -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) 2020, Dell Inc. All rights reserved. + + 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) 2020, Dell Inc. All rights reserved. + 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>. diff --git a/ansible_collections/dellemc/os10/roles/os10_uplink/README.md b/ansible_collections/dellemc/os10/roles/os10_uplink/README.md new file mode 100644 index 00000000..8ffeb0e7 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_uplink/README.md @@ -0,0 +1,109 @@ +Uplink role +=========== + +This role facilitates the configuration of uplink failure detection feature attributes. It specifically enables configuration of association between upstream and downstream interfaces known as uplink-state group. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. + +The Uplink role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. + +Role variables +-------------- + +- Role is abstracted using the `ansible_network_os` variable that can take `dellemc.os10.os10` as the value +- If `os10_cfg_generate` is set to true, the variable generates the role configuration commands in a file +- Any role variable with a corresponding state variable set to absent negates the configuration of that variable +- Setting an empty value for any variable negates the corresponding configuration +- Variables and values are case-sensitive + +**os10_uplink keys** + +| Key | Type | Description | Support | +|------------|---------------------------|---------------------------------------------------------|-----------------------| +| ``uplink_state_group`` | list | Configures the uplink state group (see ``uplink_state_group.*``) | os10 | +| ``uplink_state_group.id`` | integer | Configures the uplink state group instance | os10 | +| ``uplink_state_group.enable`` | boolean: True,False | Enables the uplink state group instance | os10 | +| ``uplink_state_group.defer_time`` | integer | Configures defer timer for the uplink state group | os10 | +| ``uplink_state_group.uplink_type`` | list | Configures the upstream and downstream attribute (see ``uplink_type.*``) | os10 | +| ``uplink_type.type`` | string: upstream,downstream | Configures the uplink type | os10 | +| ``uplink_type.intf`` | string | Configures the uplink interface | os10 | +| ``uplink_type.state`` | string: absent,present\* | Removes the uplink stream if set to absent | os10 | +| ``uplink_state_group.downstream`` | dictionary | Configures downstream information for the uplink state group (see ``downstream.*``) | os10 | +| ``downstream.disable_links`` | integer | Configures number of downstream links to be disabled. String 'all' can be used to disable all downstream links | os10 | +| ``downstream.auto_recover`` | boolean: True,False | Enables or disables auto recover for downstream interfaces | os10 | +| ``uplink_state_group.state`` | string: absent,present\* | Removes the uplink state group instance if set to absent | os10 | + +> **NOTE**: Asterisk (\*) denotes the default value if none is specified. + +Connection variables +******************** + +Ansible Dell EMC network roles require connection information to establish communication with the nodes in your inventory. This information can exist in the Ansible *group_vars* or *host_vars* directories, or inventory or in the playbook itself. + +| Key | Required | Choices | Description | +|-------------|----------|------------|-----------------------------------------------------| +| ``ansible_host`` | yes | | Specifies the hostname or address for connecting to the remote device over the specified transport | +| ``ansible_port`` | no | | Specifies the port used to build the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_PORT` option is used; it defaults to 22 | +| ``ansible_ssh_user`` | no | | Specifies the username that authenticates the CLI login for the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_USER` environment variable value is used | +| ``ansible_ssh_pass`` | no | | Specifies the password that authenticates the connection to the remote device | +| ``ansible_become`` | no | yes, no\* | Instructs the module to enter privileged mode on the remote device before sending any commands; if value is unspecified, the `ANSIBLE_BECOME` environment variable value is used, and the device attempts to execute all commands in non-privileged mode | +| ``ansible_become_method`` | no | enable, sudo\* | Instructs the module to allow the become method to be specified for handling privilege escalation; if value is unspecified, the `ANSIBLE_BECOME_METHOD` environment variable value is used | +| ``ansible_become_pass`` | no | | Specifies the password to use if required to enter privileged mode on the remote device; if ``ansible_become`` is set to no this key is not applicable | +| ``ansible_network_os`` | yes | os10, null\* | Loads the correct terminal and cliconf plugins to communicate with the remote device | + +> **NOTE**: Asterisk (\*) denotes the default value if none is specified. + + +Example playbook +---------------- + +This example uses the *os10_uplink role* to completely set the uplink sate group instance, and upstream, downstream interfaces. It creates a *hosts* file with the switch details and corresponding variables. The hosts file should define the `ansible_network_os` variable with corresponding Dell EMC OS10 name. + +When `os10_cfg_generate` is set to true, the variable generates the configuration commands as a .part file in *build_dir* path. By default, the variable is set to false. The uplink role writes a simple playbook that only references the *os10_uplink* role. By including the role, you automatically get access to all of the tasks to configure uplink features. + +**Sample hosts file** + + leaf1 ansible_host= <ip_address> + +**Sample host_vars/leaf1** + + hostname: leaf1 + ansible_become: yes + ansible_become_method: xxxxx + ansible_become_pass: xxxxx + ansible_ssh_user: xxxxx + ansible_ssh_pass: xxxxx + ansible_network_os: dellemc.os10.os10 + build_dir: ../temp/os10 + + os10_uplink: + uplink_state_group: + - id: 1 + enable: True + uplink_type: + - type: "upstream" + intf: "port-channel1" + state: "present" + - type: "downstream" + intf: "ethernet1/1/2-1/1/5" + state: "present" + state: "present" + downstream: + disable_links: all + auto_recover: false + defer_time: 50 + - id: 2 + enable: True + state: "present" + +> **NOTE**: Interfaces should be created using the *os10_interface* role. + +**Simple playbook to setup uplink — leaf.yaml** + + - hosts: leaf1 + roles: + - dellemc.os10.os10_uplink + +**Run** + + ansible-playbook -i hosts leaf.yaml + +(c) 2017-2020 Dell Inc. or its subsidiaries. All rights reserved. diff --git a/ansible_collections/dellemc/os10/roles/os10_uplink/defaults/main.yml b/ansible_collections/dellemc/os10/roles/os10_uplink/defaults/main.yml new file mode 100644 index 00000000..441d767e --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_uplink/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for dellemc.os10.os10_uplink diff --git a/ansible_collections/dellemc/os10/roles/os10_uplink/handlers/main.yml b/ansible_collections/dellemc/os10/roles/os10_uplink/handlers/main.yml new file mode 100644 index 00000000..7abb0012 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_uplink/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for dellemc.os10.os10_uplink diff --git a/ansible_collections/dellemc/os10/roles/os10_uplink/meta/main.yml b/ansible_collections/dellemc/os10/roles/os10_uplink/meta/main.yml new file mode 100644 index 00000000..0bc56196 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_uplink/meta/main.yml @@ -0,0 +1,18 @@ +# Copyright (c) 2020 Dell Inc. or its subsidiaries. All Rights Reserved. +--- +galaxy_info: + role_name: os10_uplink + author: Dell EMC Networking Engineering + description: The os10_uplink role facilitates the configuration of uplink attributes in devices running Dell EMC SmartFabric OS10. + license: GPLv3 + min_ansible_version: 2.9.6 + + platforms: + - name: os10 + + galaxy_tags: + - networking + - dell + - emc + - dellemc + - os10 diff --git a/ansible_collections/dellemc/os10/roles/os10_uplink/tasks/main.yml b/ansible_collections/dellemc/os10/roles/os10_uplink/tasks/main.yml new file mode 100644 index 00000000..6500ea3c --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_uplink/tasks/main.yml @@ -0,0 +1,16 @@ +--- +# tasks file for os10 + - name: "Generating uplink configuration for os10" + template: + src: os10_uplink.j2 + dest: "{{ build_dir }}/uplink10_{{ hostname }}.conf.part" + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") and ((os10_cfg_generate | default('False')) | bool) +# notify: save config os10 + register: generate_output + + - name: "Provisioning uplink configuration for os10" + os10_config: + src: os10_uplink.j2 + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") +# notify: save config os10 + register: output diff --git a/ansible_collections/dellemc/os10/roles/os10_uplink/templates/os10_uplink.j2 b/ansible_collections/dellemc/os10/roles/os10_uplink/templates/os10_uplink.j2 new file mode 100644 index 00000000..64a237d8 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_uplink/templates/os10_uplink.j2 @@ -0,0 +1,102 @@ +#jinja2: trim_blocks: True,lstrip_blocks: True +{############################################# +#Purpose: +Configure uplink commands for os10 Devices + +os10_uplink: + uplink_state_group: + - id: 1 + enable: True + uplink_type: + - type: "upstream" + intf: "port-channel1" + state: "present" + - type: "downstream" + intf: "ethernet1/1/2-1/1/5" + state: "present" + downstream: + disable_links: all + auto_recover: false + defer_time: 50 + state: "present" + - id: 1 + enable: True + uplink_type: + - type: "upstream" + intf: "port-channel1" + state: "present" + - type: "downstream" + intf: "ethernet1/1/2-1/1/5" + state: "present" + downstream: + disable_links: 10 + auto_recover: false + state: "present" + +###############################################} +{% if os10_uplink is defined and os10_uplink %} + {% if os10_uplink.uplink_state_group is defined and os10_uplink.uplink_state_group %} + {% for uplink_val in os10_uplink.uplink_state_group %} + {% if uplink_val.id is defined %} + {% if uplink_val.state is defined and uplink_val.state == "absent" %} +no uplink-state-group {{ uplink_val.id }} + {% else %} +uplink-state-group {{ uplink_val.id }} + {% if uplink_val.enable is defined %} + {% if uplink_val.enable == True %} + enable + {% else %} + no enable + {% endif %} + {% endif %} + {% if uplink_val.downstream is defined and uplink_val.downstream %} + {% if uplink_val.downstream.auto_recover is defined %} + {% if uplink_val.downstream.auto_recover %} + downstream auto-recover + {% else %} + no downstream auto-recover + {% endif %} + {% endif %} + {% if uplink_val.downstream.disable_links is defined %} + {% if uplink_val.downstream.disable_links %} + downstream disable-links {{ uplink_val.downstream.disable_links }} + {% else %} + no downstream disable-links + {% endif %} + {% endif %} + {% endif %} + {% if uplink_val.uplink_type is defined and uplink_val.uplink_type %} + {% for uplink in uplink_val.uplink_type %} + {% if uplink.type is defined and uplink.type %} + {% if uplink.state is defined and uplink.state == "absent" %} + {% if uplink.intf is defined and uplink.intf %} + {% if uplink.type == "downstream" %} + no downstream {{ uplink.intf }} + {% elif uplink.type == "upstream" %} + no upstream {{ uplink.intf }} + {% endif %} + {% endif %} + {% else %} + {% if uplink.intf is defined and uplink.intf %} + {% if uplink.type == "downstream" %} + downstream {{ uplink.intf }} + {% elif uplink.type == "upstream" %} + upstream {{ uplink.intf }} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% if uplink_val.defer_time is defined %} + {% if uplink_val.defer_time %} + defer-time {{ uplink_val.defer_time }} + {% else %} + no defer-time + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} +{% endif %} diff --git a/ansible_collections/dellemc/os10/roles/os10_uplink/tests/inventory.yaml b/ansible_collections/dellemc/os10/roles/os10_uplink/tests/inventory.yaml new file mode 100644 index 00000000..b1ff63e6 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_uplink/tests/inventory.yaml @@ -0,0 +1,22 @@ +--- +spine1 ansible_host=10.11.182.25 ansible_network_os="dellemc.os10.os10" +spine2 ansible_host=10.16.151.220 ansible_network_os="dellemc.os10.os10" + +leaf1 ansible_host=10.11.182.23 ansible_network_os="dellemc.os10.os10" +leaf2 ansible_host=10.11.182.16 ansible_network_os="dellemc.os10.os10" +leaf3 ansible_host=10.11.182.17 ansible_network_os="dellemc.os10.os10" +leaf4 ansible_host=10.16.148.79 ansible_network_os="dellemc.os10.os10" + +[spine] +spine1 +spine2 + +[leaf] +leaf1 +leaf2 +leaf3 +leaf4 + +[datacenter:children] +spine +leaf diff --git a/ansible_collections/dellemc/os10/roles/os10_uplink/tests/main.yaml b/ansible_collections/dellemc/os10/roles/os10_uplink/tests/main.yaml new file mode 100644 index 00000000..90afe008 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_uplink/tests/main.yaml @@ -0,0 +1,16 @@ +--- +# vars file for dellemc.os10.os10_uplink, +# below gives a sample configuration +# Sample variables for OS10 device +os10_uplink: + uplink_state_group: + - id: 1 + enable: True + uplink_type: + - type: "upstream" + intf: "port-channel1" + state: "present" + - type: "downstream" + intf: "ethernet1/1/2-1/1/5" + state: "present" + state: "present" diff --git a/ansible_collections/dellemc/os10/roles/os10_uplink/tests/test.yaml b/ansible_collections/dellemc/os10/roles/os10_uplink/tests/test.yaml new file mode 100644 index 00000000..92c99613 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_uplink/tests/test.yaml @@ -0,0 +1,5 @@ +--- +- hosts: datacenter + connection: network_cli + roles: + - dellemc.os10.os10_uplink diff --git a/ansible_collections/dellemc/os10/roles/os10_uplink/vars/main.yml b/ansible_collections/dellemc/os10/roles/os10_uplink/vars/main.yml new file mode 100644 index 00000000..a376eeb1 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_uplink/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for dellemc.os10.os10_uplink diff --git a/ansible_collections/dellemc/os10/roles/os10_users/LICENSE b/ansible_collections/dellemc/os10/roles/os10_users/LICENSE new file mode 100644 index 00000000..2c9b8e1f --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_users/LICENSE @@ -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) 2020, Dell Inc. All rights reserved. + + 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) 2020, Dell Inc. All rights reserved. + 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>. diff --git a/ansible_collections/dellemc/os10/roles/os10_users/README.md b/ansible_collections/dellemc/os10/roles/os10_users/README.md new file mode 100644 index 00000000..09d55f1d --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_users/README.md @@ -0,0 +1,89 @@ +Users role +========== + +This role facilitates the configuration of global system user attributes, and it supports the configuration of CLI users. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. + +The Users role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. + +Role variables +-------------- + +- Role is abstracted using the `ansible_network_os` variable that can take `dellemc.os10.os10` as the value +- If `os10_cfg_generate` is set to true, the variable generates the role configuration commands in a file +- Any role variable with a corresponding state variable set to absent negates the configuration of that variable +- Setting an empty value for any variable negates the corresponding configuration +- Variables and values are case-sensitive + +**os10_users list keys** + +| Key | Type | Description | Support | +|------------|---------------------------|---------------------------------------------------------|-----------------------| +| ``username`` | string (required) | Configures the username which must adhere to specific format guidelines (valid usernames begin with A-Z, a-z, or 0-9 and can also contain `@#$%^&*-_= +;<>,.~` characters) | os10 | +| ``password`` | string | Configures the password set for the username; password length must be at least eight characters | os10 | +| ``role`` | string | Configures the role assigned to the user | os10 | +| ``state`` | string: absent,present\* | Deletes a user account if set to absent | os10 | + +> **NOTE**: Asterisk (\*) denotes the default value if none is specified. + +Connection variables +-------------------- + +Ansible Dell EMC network roles require connection information to establish communication with the nodes in your inventory. This information can exist in the Ansible *group_vars* or *host_vars* directories, or inventory or in the playbook itself. + +| Key | Required | Choices | Description | +|-------------|----------|------------|-----------------------------------------------------| +| ``ansible_host`` | yes | | Specifies the hostname or address for connecting to the remote device over the specified transport | +| ``ansible_port`` | no | | Specifies the port used to build the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_PORT` option is used; it defaults to 22 | +| ``ansible_ssh_user`` | no | | Specifies the username that authenticates the CLI login for the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_USER` environment variable value is used | +| ``ansible_ssh_pass`` | no | | Specifies the password that authenticates the connection to the remote device | +| ``ansible_become`` | no | yes, no\* | Instructs the module to enter privileged mode on the remote device before sending any commands; if value is unspecified, the `ANSIBLE_BECOME` environment variable value is used, and the device attempts to execute all commands in non-privileged mode | +| ``ansible_become_method`` | no | enable, sudo\* | Instructs the module to allow the become method to be specified for handling privilege escalation; if value is unspecified, the `ANSIBLE_BECOME_METHOD` environment variable value is used | +| ``ansible_become_pass`` | no | | Specifies the password to use if required to enter privileged mode on the remote device; if ``ansible_become`` is set to no this key is not applicable | +| ``ansible_network_os`` | yes | os10, null\* | Loads the correct terminal and cliconf plugins to communicate with the remote device | + +> **NOTE**: Asterisk (\*) denotes the default value if none is specified. + + +Example playbook +---------------- + +This example uses the *os10_users* role to configure global system user attributes. It creates a hosts file with the switch details and corresponding variables. The hosts file should define the `ansible_network_os` variable with the corresponding Dell EMC OS10 name. + +When `os10_cfg_generate` is set to true, the variable generates the role configuration commands in a file. It writes a simple playbook that only references the *os10_users* role. By including the role, you automatically get access to all of the tasks to configure user features. + +**Sample hosts file** + + leaf1 ansible_host= <ip_address> + +**Sample host_vars/leaf1** + + hostname: leaf1 + ansible_become: yes + ansible_become_method: xxxxx + ansible_become_pass: xxxxx + ansible_ssh_user: xxxxx + ansible_ssh_pass: xxxxx + ansible_network_os: dellemc.os10.os10 + build_dir: ../temp/temp_os10 + + os10_users: + - username: test + password: a1a2a3a4!@#$ + role: sysadmin + state: present + - username: u1 + password: a1a2a3a4!@#$ + role: netadmin + state: present + +**Simple playbook to setup users — leaf.yaml** + + - hosts: leaf1 + roles: + - dellemc.os10.os10_users + +**Run** + + ansible-playbook -i hosts leaf.yaml + +(c) 2017-2020 Dell Inc. or its subsidiaries. All rights reserved. diff --git a/ansible_collections/dellemc/os10/roles/os10_users/defaults/main.yml b/ansible_collections/dellemc/os10/roles/os10_users/defaults/main.yml new file mode 100644 index 00000000..668eefac --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_users/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for dellemc.os10.os10_users diff --git a/ansible_collections/dellemc/os10/roles/os10_users/handlers/main.yml b/ansible_collections/dellemc/os10/roles/os10_users/handlers/main.yml new file mode 100644 index 00000000..e73b341b --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_users/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for dellemc.os10.os10_users diff --git a/ansible_collections/dellemc/os10/roles/os10_users/meta/main.yml b/ansible_collections/dellemc/os10/roles/os10_users/meta/main.yml new file mode 100644 index 00000000..c73b755e --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_users/meta/main.yml @@ -0,0 +1,18 @@ +# Copyright (c) 2020 Dell Inc. +--- +galaxy_info: + author: Dell EMC Networking Engineering + description: The os10_users role facilitates the configuration of user attributes in devices running Dell EMC SmartFabric OS10. + company: Dell Technologies + license: GPLv3 + min_ansible_version: 2.9.6 + + platforms: + - name: os10 + + galaxy_tags: + - networking + - dell + - emc + - dellemc + - os10 diff --git a/ansible_collections/dellemc/os10/roles/os10_users/tasks/main.yml b/ansible_collections/dellemc/os10/roles/os10_users/tasks/main.yml new file mode 100644 index 00000000..eb870a13 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_users/tasks/main.yml @@ -0,0 +1,16 @@ +--- +# tasks file for os10 + - name: "Generating users configuration for os10" + template: + src: os10_users.j2 + dest: "{{ build_dir }}/users10_{{ hostname }}.conf.part" + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") and ((os10_cfg_generate | default('False')) | bool) +# notify: save config os10 + register: generate_output + + - name: "Provisioning users configuration for os10" + os10_config: + src: os10_users.j2 + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") +# notify: save config os10 + register: output diff --git a/ansible_collections/dellemc/os10/roles/os10_users/templates/os10_users.j2 b/ansible_collections/dellemc/os10/roles/os10_users/templates/os10_users.j2 new file mode 100644 index 00000000..080f6a59 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_users/templates/os10_users.j2 @@ -0,0 +1,27 @@ +#jinja2: trim_blocks: True,lstrip_blocks: True +{############################################# +Purpose: +Configure users commands for os10 Devices +os10_users: + - username: test + password: test + role: sysadmin + state: present +###############################################} +{% if os10_users is defined and os10_users %} + {% for item in os10_users %} + {% if item.username is defined and item.username %} + {% if item.state is defined and item.state == "absent" %} +no username {{ item.username }} + {% else %} + {% if item.password is defined and item.password %} + {% if item.role is defined and item.role %} +username {{ item.username }} password {{ item.password }} role {{ item.role }} + {% else %} +username {{ item.username }} password {{ item.password }} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endfor %} +{% endif %} diff --git a/ansible_collections/dellemc/os10/roles/os10_users/tests/inventory.yaml b/ansible_collections/dellemc/os10/roles/os10_users/tests/inventory.yaml new file mode 100644 index 00000000..b1ff63e6 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_users/tests/inventory.yaml @@ -0,0 +1,22 @@ +--- +spine1 ansible_host=10.11.182.25 ansible_network_os="dellemc.os10.os10" +spine2 ansible_host=10.16.151.220 ansible_network_os="dellemc.os10.os10" + +leaf1 ansible_host=10.11.182.23 ansible_network_os="dellemc.os10.os10" +leaf2 ansible_host=10.11.182.16 ansible_network_os="dellemc.os10.os10" +leaf3 ansible_host=10.11.182.17 ansible_network_os="dellemc.os10.os10" +leaf4 ansible_host=10.16.148.79 ansible_network_os="dellemc.os10.os10" + +[spine] +spine1 +spine2 + +[leaf] +leaf1 +leaf2 +leaf3 +leaf4 + +[datacenter:children] +spine +leaf diff --git a/ansible_collections/dellemc/os10/roles/os10_users/tests/main.os10.yaml b/ansible_collections/dellemc/os10/roles/os10_users/tests/main.os10.yaml new file mode 100644 index 00000000..0bbc0633 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_users/tests/main.os10.yaml @@ -0,0 +1,13 @@ +--- +# vars file for dellemc.os10.os10_users, +# below gives a sample configuration +# Sample variables for OS10 device +os10_users: + - username: test + password: a1a2a3a4!@#$ + role: sysadmin + state: present + - username: u1 + password: a1a2a3a4!@#$ + role: netadmin + state: present diff --git a/ansible_collections/dellemc/os10/roles/os10_users/tests/test.yaml b/ansible_collections/dellemc/os10/roles/os10_users/tests/test.yaml new file mode 100644 index 00000000..26812451 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_users/tests/test.yaml @@ -0,0 +1,5 @@ +--- +- hosts: datacenter + connection: network_cli + roles: + - dellemc.os10.os10_users diff --git a/ansible_collections/dellemc/os10/roles/os10_users/vars/main.yml b/ansible_collections/dellemc/os10/roles/os10_users/vars/main.yml new file mode 100644 index 00000000..49177b5b --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_users/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for dellemc.os10.os10_users diff --git a/ansible_collections/dellemc/os10/roles/os10_vlan/LICENSE b/ansible_collections/dellemc/os10/roles/os10_vlan/LICENSE new file mode 100644 index 00000000..2c9b8e1f --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vlan/LICENSE @@ -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) 2020, Dell Inc. All rights reserved. + + 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) 2020, Dell Inc. All rights reserved. + 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>. diff --git a/ansible_collections/dellemc/os10/roles/os10_vlan/README.md b/ansible_collections/dellemc/os10/roles/os10_vlan/README.md new file mode 100644 index 00000000..71a7adf9 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vlan/README.md @@ -0,0 +1,123 @@ +VLAN role +========= + +This role facilitates configuring virtual LAN (VLAN) attributes. It supports the creation and deletion of a VLAN and its member ports. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. + +The VLAN role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. + +Role variables +-------------- + +- Role is abstracted using the `ansible_network_os` variable that can take `dellemc.os10.os10` as the value +- If `os10_cfg_generate` is set to true, the variable generates the role configuration commands in a file +- Any role variable with a corresponding state variable set to absent negates the configuration of that variable +- For variables with no state variable, setting an empty value for the variable negates the corresponding configuration +- `os10_vlan` (dictionary) holds the key with the VLAN ID key and default-vlan key. +- VLAN ID key should be in format "vlan ID" (1 to 4094) +- Variables and values are case-sensitive + +**os10_vlan** + +| Key | Type | Notes | Support | +|------------|---------------------------|---------------------------------------------------------|-----------------------| +| ``default_vlan_id`` | integer | Configures the vlan-id as the default VLAN for an existing VLAN | os10 | + +**VLAN ID keys** + +| Key | Type | Notes | Support | +|------------|---------------------------|---------------------------------------------------------|-----------------------| +| ``description`` | string | Configures a single line description for the VLAN | os10 | +| ``tagged_members`` | list | Specifies the list of port members to be tagged to the corresponding VLAN (see ``tagged_members.*``) | os10 | +| ``tagged_members.port`` | string | Specifies valid device interface names to be tagged for each VLAN | os10 | +| ``tagged_members.state`` | string: absent,present | Deletes the tagged association for the VLAN if set to absent | os10 | +| ``untagged_members`` | list | Specifies the list of port members to be untagged to the corresponding VLAN (see ``untagged_members.*``) | os10 | +| ``untagged_members.port`` | string | Specifies valid device interface names to be untagged for each VLAN | os10 | +| ``untagged_members.state`` | string: absent,present | Deletes the untagged association for the VLAN if set to absent | os10 | +| ``state`` | string: absent,present\* | Deletes the VLAN corresponding to the ID if set to absent | os10 | +| ``virtual_gateway_ip`` | string | Configures an anycast gateway IPv4 address for VLAN interfaces| os10 | +| ``virtual_gateway_ipv6`` | string | Configures an anycast gateway IPv6 address for VLAN interfaces| os10 | +| ``ip_and_mask`` | string | Configures the specified IP address to the interface | os10 | + +> **NOTE**: Asterisk (\*) denotes the default value if none is specified. + +Connection variables +-------------------- + +Ansible Dell EMC network roles require connection information to establish communication with the nodes in your inventory. This information can exist in the Ansible *group_vars* or *host_vars directories* or inventory, or in the playbook itself. + +| Key | Required | Choices | Description | +|-------------|----------|------------|-----------------------------------------------------| +| ``ansible_host`` | yes | | Specifies the hostname or address for connecting to the remote device over the specified transport | +| ``ansible_port`` | no | | Specifies the port used to build the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_PORT` option is used; it defaults to 22 | +| ``ansible_ssh_user`` | no | | Specifies the username that authenticates the CLI login for the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_USER` environment variable value is used | +| ``ansible_ssh_pass`` | no | | Specifies the password that authenticates the connection to the remote device | +| ``ansible_become`` | no | yes, no\* | Instructs the module to enter privileged mode on the remote device before sending any commands; if value is unspecified, the `ANSIBLE_BECOME` environment variable value is used, and the device attempts to execute all commands in non-privileged mode | +| ``ansible_become_method`` | no | enable, sudo\* | Instructs the module to allow the become method to be specified for handling privilege escalation; if value is unspecified, the `ANSIBLE_BECOME_METHOD` environment variable value is used | +| ``ansible_become_pass`` | no | | Specifies the password to use if required to enter privileged mode on the remote device; if ``ansible_become`` is set to no this key is not applicable | +| ``ansible_network_os`` | yes | os10, null\* | Loads the correct terminal and cliconf plugins to communicate with the remote device | + +> **NOTE**: Asterisk (\*) denotes the default value if none is specified. + + +## Example playbook + +This example uses the *os10_vlan* role to setup the VLAN ID and name, and it configures tagged and untagged port members for the VLAN. You can also delete the VLAN with the ID or delete the members associated to it. It creates a *hosts* file with the switch details and corresponding variables. The hosts file should define the `ansible_network_os` variable with corresponding Dell EMC OS10 name. + +When `os10_cfg_generate` is set to true, the variable generates the configuration commands as a .part file in *build_dir* path. By default, the variable is set to false. It writes a simple playbook that only references the *os10_vlan* role. + +**Sample hosts file** + + leaf1 ansible_host= <ip_address> + +**Sample host_vars/leaf1** + + hostname: leaf1 + ansible_become: yes + ansible_become_method: xxxxx + ansible_become_pass: xxxxx + ansible_ssh_user: xxxxx + ansible_ssh_pass: xxxxx + ansible_network_os: dellemc.os10.os10 + build_dir: ../temp/temp_os10 + + os10_vlan: + default_vlan_id: 2 + vlan 100: + description: "Blue" + tagged_members: + - port: ethernet 1/1/32 + state: present + - port: ethernet 1/1/31 + state: present + untagged_members: + - port: ethernet 1/1/30 + state: present + - port: ethernet 1/1/29 + state: present + state: present + vlan 888: + description: "NSX_Cluster" + untagged_members: + - port: port-channel 1 + state: "present" + state: "present" + vlan 10: + description: "vlan with anycast GW" + ip_and_mask: "10.1.1.1/24" + virtual_gateway_ip: "10.1.1.254" + virtual_gateway_ipv6: "10:1:1::254" + state: "present" + +> **NOTE**: Interfaces should be created using the *os10_interface* role. + +**Simple playbook to setup system — leaf.yaml** + + - hosts: leaf1 + roles: + - dellemc.os10.os10_vlan + +**Run** + + ansible-playbook -i hosts leaf.yaml + +(c) 2017-2020 Dell Inc. or its subsidiaries. All rights reserved. diff --git a/ansible_collections/dellemc/os10/roles/os10_vlan/defaults/main.yml b/ansible_collections/dellemc/os10/roles/os10_vlan/defaults/main.yml new file mode 100644 index 00000000..7510d594 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vlan/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for dellemc.os10.os10_vlan diff --git a/ansible_collections/dellemc/os10/roles/os10_vlan/handlers/main.yml b/ansible_collections/dellemc/os10/roles/os10_vlan/handlers/main.yml new file mode 100644 index 00000000..acd66992 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vlan/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for dellemc.os10.os10_vlan diff --git a/ansible_collections/dellemc/os10/roles/os10_vlan/meta/main.yml b/ansible_collections/dellemc/os10/roles/os10_vlan/meta/main.yml new file mode 100644 index 00000000..03e7a180 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vlan/meta/main.yml @@ -0,0 +1,18 @@ +# Copyright (c) 2017-2020 Dell Inc. +--- +galaxy_info: + author: Dell EMC Networking Engineering + description: The os10_vlan role facilitates the configuration of VLAN attributes in devices running Dell EMC SmartFabric OS10. + company: Dell Technologies + license: GPLv3 + min_ansible_version: 2.9.6 + + platforms: + - name: os10 + + galaxy_tags: + - networking + - dell + - emc + - dellemc + - os10 diff --git a/ansible_collections/dellemc/os10/roles/os10_vlan/tasks/main.yml b/ansible_collections/dellemc/os10/roles/os10_vlan/tasks/main.yml new file mode 100644 index 00000000..f4d69bc9 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vlan/tasks/main.yml @@ -0,0 +1,16 @@ +--- +# tasks file for os10 + - name: "Generating VLAN configuration for os10" + template: + src: os10_vlan.j2 + dest: "{{ build_dir }}/vlan10_{{ hostname }}.conf.part" + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") and ((os10_cfg_generate | default('False')) | bool) +# notify: save config os10 + register: generate_output + + - name: "Provisioning VLAN configuration for os10" + os10_config: + src: os10_vlan.j2 + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") +# notify: save config os10 + register: output diff --git a/ansible_collections/dellemc/os10/roles/os10_vlan/templates/os10_vlan.j2 b/ansible_collections/dellemc/os10/roles/os10_vlan/templates/os10_vlan.j2 new file mode 100644 index 00000000..f07f10b3 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vlan/templates/os10_vlan.j2 @@ -0,0 +1,129 @@ +#jinja2: trim_blocks: True,lstrip_blocks: True +{########################################## +Purpose: +Configure VLAN Interface commands for os10 Devices +os10_vlan: + default_vlan_id : 4 + vlan 100: + description: "red" + tagged_members: + - port: ethernet 1/1/32 + state: present + - port: ethernet 1/1/31 + state: absent + untagged_members: + - port: ethernet 1/1/30 + state: present + - port: ethernet 1/1/29 + state: present + state: present + vlan 888: + description: "NSX_Cluster" + untagged_members: + - port: port-channel 1 + state: "present" + state: "present" + vlan 10: + description: "vlan with anycast GW" + ip_and_mask: "10.1.1.1/24" + virtual_gateway_ip: "10.1.1.254" + virtual_gateway_ipv6: "10:1:1::254" + state: "present" + +#########################################} +{% if os10_vlan is defined and os10_vlan %} +{% for key,value in os10_vlan.items() %} + {% if key == "default_vlan_id" %} + {% if value %} +default vlan-id {{ value }} + {% else %} +no default vlan-id + {% endif %} + {% else %} + + {% set vlan_id = key.split(" ") %} + {% set vlan_vars = os10_vlan[key] %} + + {% if vlan_vars.state is defined and vlan_vars.state == "absent" %} +no interface vlan{{ vlan_id[1] }} + {% else %} +interface vlan{{ vlan_id[1] }} + {% if vlan_vars.description is defined %} + {% if vlan_vars.description %} + {% if vlan_vars.description|wordcount > 1 %} + description "{{ vlan_vars.description }}" + {% else %} + description {{ vlan_vars.description }} + {% endif %} + {% else %} + no description + {% endif %} + {% endif %} + + {% if vlan_vars.ip_and_mask is defined %} + {% if vlan_vars.ip_and_mask %} + ip address {{ vlan_vars.ip_and_mask }} + {% else %} + no ip address + {% endif %} + {% endif %} + + {% if vlan_vars.virtual_gateway_ip is defined %} + {% if vlan_vars.virtual_gateway_ip %} + ip virtual-router address {{ vlan_vars.virtual_gateway_ip }} + {% else %} + no ip virtual-router address + {% endif %} + {% endif %} + + {% if vlan_vars.virtual_gateway_ipv6 is defined %} + {% if vlan_vars.virtual_gateway_ipv6 %} + ipv6 virtual-router address {{ vlan_vars.virtual_gateway_ipv6 }} + {% else %} + no ipv6 virtual-router address + {% endif %} + {% endif %} + + {# Keep member configs in the end as it switches to member interface context #} + {% if vlan_vars.untagged_members is defined %} + {% for ports in vlan_vars.untagged_members %} + {% if ports.port is defined and ports.port %} + {% if 'range' in ports.port %} +interface {{ ports.port }} + {% else %} +interface {{ ports.port.split() | join() }} + {% endif %} + {% if ports.state is defined and ports.state == "absent" %} + no switchport access vlan + {% else %} + switchport access vlan {{ vlan_id[1] }} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + + {% if vlan_vars.tagged_members is defined %} + {% for ports in vlan_vars.tagged_members %} + {% if ports.port is defined and ports.port %} + {% if 'range' in ports.port %} +interface {{ ports.port }} + {% else %} +interface {{ ports.port.split() | join() }} + {% endif %} + {% if ports.state is defined and ports.state == "absent" %} + no switchport trunk allowed vlan {{ vlan_id[1] }} + {% else %} + switchport mode trunk + switchport trunk allowed vlan {{ vlan_id[1] }} + {% endif %} + {% if ports.access_vlan is defined and ports.access_vlan == "false" %} + no switchport access vlan + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + + {% endif %} + {% endif %} +{% endfor %} +{% endif %} diff --git a/ansible_collections/dellemc/os10/roles/os10_vlan/tests/inventory.yaml b/ansible_collections/dellemc/os10/roles/os10_vlan/tests/inventory.yaml new file mode 100644 index 00000000..b1ff63e6 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vlan/tests/inventory.yaml @@ -0,0 +1,22 @@ +--- +spine1 ansible_host=10.11.182.25 ansible_network_os="dellemc.os10.os10" +spine2 ansible_host=10.16.151.220 ansible_network_os="dellemc.os10.os10" + +leaf1 ansible_host=10.11.182.23 ansible_network_os="dellemc.os10.os10" +leaf2 ansible_host=10.11.182.16 ansible_network_os="dellemc.os10.os10" +leaf3 ansible_host=10.11.182.17 ansible_network_os="dellemc.os10.os10" +leaf4 ansible_host=10.16.148.79 ansible_network_os="dellemc.os10.os10" + +[spine] +spine1 +spine2 + +[leaf] +leaf1 +leaf2 +leaf3 +leaf4 + +[datacenter:children] +spine +leaf diff --git a/ansible_collections/dellemc/os10/roles/os10_vlan/tests/main.os10.yaml b/ansible_collections/dellemc/os10/roles/os10_vlan/tests/main.os10.yaml new file mode 100644 index 00000000..78e24738 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vlan/tests/main.os10.yaml @@ -0,0 +1,31 @@ +--- +# vars file for dellemc.os10.os10_vlan, +# below gives a example configuration +# Sample variables for OS10 device +os10_vlan: + default_vlan_id: 2 + vlan 100: + description: "Blue" + tagged_members: + - port: ethernet 1/1/32 + state: present + - port: ethernet 1/1/31 + state: present + untagged_members: + - port: ethernet 1/1/30 + state: present + - port: ethernet 1/1/29 + state: present + state: present + vlan 888: + description: "NSX_Cluster" + untagged_members: + - port: port-channel 1 + state: "present" + state: "present" + vlan 10: + description: "vlan with anycast GW" + ip_and_mask: "10.1.1.1/24" + virtual_gateway_ip: "10.1.1.254" + virtual_gateway_ipv6: "10:1:1::254" + state: "present" diff --git a/ansible_collections/dellemc/os10/roles/os10_vlan/tests/test.yaml b/ansible_collections/dellemc/os10/roles/os10_vlan/tests/test.yaml new file mode 100644 index 00000000..13442eff --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vlan/tests/test.yaml @@ -0,0 +1,5 @@ +--- +- hosts: datacenter + connection: network_cli + roles: + - dellemc.os10.os10_vlan diff --git a/ansible_collections/dellemc/os10/roles/os10_vlan/vars/main.yml b/ansible_collections/dellemc/os10/roles/os10_vlan/vars/main.yml new file mode 100644 index 00000000..c856f302 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vlan/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for dellemc.os10.os10_vlan diff --git a/ansible_collections/dellemc/os10/roles/os10_vlt/LICENSE b/ansible_collections/dellemc/os10/roles/os10_vlt/LICENSE new file mode 100644 index 00000000..2c9b8e1f --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vlt/LICENSE @@ -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) 2020, Dell Inc. All rights reserved. + + 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) 2020, Dell Inc. All rights reserved. + 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>. diff --git a/ansible_collections/dellemc/os10/roles/os10_vlt/README.md b/ansible_collections/dellemc/os10/roles/os10_vlt/README.md new file mode 100644 index 00000000..85ed917a --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vlt/README.md @@ -0,0 +1,108 @@ +VLT role +======== + +This role facilitates the configuration of the basics of virtual link trunking (VLT) to provide a loop-free topology. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. + +The VLT role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables . + +Role variables +-------------- + +- Role is abstracted using the `ansible_network_os` variable that can take `dellemc.os10.os10` value +- If `os10_cfg_generate` is set to true, the variable generates the role configuration commands in a file +- Any role variable with a corresponding state variable set to absent negates the configuration of that variable +- Setting an empty value for any variable negates the corresponding configuration +- Variables and values are case-sensitive + +**os10_vlt keys** + +| Key | Type | Description | Support | +|------------|---------------------------|---------------------------------------------------------|-----------------------| +| ``domain`` | integer (required) | Configures the VLT domain identification number (1 to 1000) | os10 | +| ``backup_destination`` | string | Configures an IPv4 address for the VLT backup link (A.B.C.D format or X:X:X:X::X format) | os10 | +| ``destination_type`` | string | Configures the backup destination based on this destination type (IPv4 or IPv6)| os10 | +| ``backup_destination_vrf`` | string | Configures the virtual routing and forwarding (VRF) instance through which the backup destination IP is reachable (*vrfname* must be present) | os10 | +| ``discovery_intf`` | string | Configures the discovery interface for the VLT domain (range of interfaces)| os10 | +| ``discovery_intf_state`` | string: absent,present | Deletes the discovery interfaces for the VLT domain if set to absent | os10 | +| ``peer_routing`` | boolean | Configures VLT peer routing | os10 | +| ``priority`` | integer (default:32768) | Configures VLT priority | os10 | +| ``vlt_mac`` | string | Configures the VLT MAC address | os10 | +| ``vlt_peers`` | dictionary | Contains objects to configure the VLT peer port-channel (see ``vlt_peers.*``) | os10 | +| ``vlt_peers.<portchannelid>`` | dictionary | Configures the VLT peer port-channel (`Po <portchannelid> value`) | os10 | +| ``vlt_peers.<portchannelid>.peer_lag`` | integer | Configures the port-channel ID of the VLT peer lag | os10 | +| ``state`` | string: absent,present | Deletes the VLT instance if set to absent | os10 | + +> **NOTE**: Asterisk (\*) denotes the default value if none is specified. + +Connection variables +-------------------- + +Ansible Dell EMC network OS roles require connection information to establish communication with the nodes in your inventory. This information can exist in the Ansible *group_vars* or *host_vars* directories or inventory, or in the playbook itself. + +| Key | Required | Choices | Description | +|-------------|----------|------------|-----------------------------------------------------| +| ``ansible_host`` | yes | | Specifies the hostname or address for connecting to the remote device over the specified transport | +| ``ansible_port`` | no | | Specifies the port used to build the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_PORT` option is used; it defaults to 22 | +| ``ansible_ssh_user`` | no | | Specifies the username that authenticates the CLI login for the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_USER` environment variable value is used | +| ``ansible_ssh_pass`` | no | | Specifies the password that authenticates the connection to the remote device | +| ``ansible_become`` | no | yes, no\* | Instructs the module to enter privileged mode on the remote device before sending any commands; if value is unspecified, the `ANSIBLE_BECOME` environment variable value is used, and the device attempts to execute all commands in non-privileged mode | +| ``ansible_become_method`` | no | enable, sudo\* | Instructs the module to allow the become method to be specified for handling privilege escalation; if value is unspecified, the `ANSIBLE_BECOME_METHOD` environment variable value is used | +| ``ansible_become_pass`` | no | | Specifies the password to use if required to enter privileged mode on the remote device; if ``ansible_become`` is set to no this key is not applicable | +| ``ansible_network_os`` | yes | os10, null\* | Loads the correct terminal and cliconf plugins to communicate with the remote device | + +> **NOTE**: Asterisk (\*) denotes the default value if none is specified. + +Dependencies +------------ + +The *os10_vlt* role is built on modules included in the core Ansible code. These modules were added in ansible version 2.2.0. + +Example playbook +---------------- + +This example uses the *os10_vlt* role to setup a VLT-domain. It creates a *hosts* file with the switch details and corresponding variables.The hosts file should define the `ansible_network_os` variable with corresponding Dell EMC OS10 name. + +When `os10_cfg_generate` is set to true, the variable generates the configuration commands as a .part file in *build_dir* path. By default, the variable is set to false. It writes a simple playbook that only references the *os10_vlt* role. + +**Sample hosts file** + + leaf1 ansible_host= <ip_address> + +**Sample host_vars/leaf1** + + hostname: leaf1 + ansible_become: yes + ansible_become_method: xxxxx + ansible_become_pass: xxxxx + ansible_ssh_user: xxxxx + ansible_ssh_pass: xxxxx + ansible_network_os: dellemc.os10.os10 + build_dir: ../temp/temp_os10 + + os10_vlt: + domain: 1 + backup_destination: "192.168.211.175" + destination_type: "ipv4" + backup_destination_vrf: + discovery_intf: 1/1/12 + discovery_intf_state: present + peer_routing: True + vlt_mac: aa:aa:aa:aa:aa:aa + vlt_peers: + Po 12: + peer_lag: 13 + state: present + +> **NOTE**: Discovery interface must not be in switchport mode and can be configured using the *os10_interface* role. + +**Simple playbook to setup system — leaf.yaml** + + - hosts: leaf1 + roles: + - dellemc.os10.os10_vlt + +**Run** + + ansible-playbook -i hosts leaf.yaml + +(c) 2017-2020 Dell Inc. or its subsidiaries. All rights reserved. diff --git a/ansible_collections/dellemc/os10/roles/os10_vlt/defaults/main.yml b/ansible_collections/dellemc/os10/roles/os10_vlt/defaults/main.yml new file mode 100644 index 00000000..daa35993 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vlt/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for dellemc.os10.os10_vlt diff --git a/ansible_collections/dellemc/os10/roles/os10_vlt/handlers/main.yml b/ansible_collections/dellemc/os10/roles/os10_vlt/handlers/main.yml new file mode 100644 index 00000000..910f1fa8 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vlt/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for dellemc.os10.os10_vlt diff --git a/ansible_collections/dellemc/os10/roles/os10_vlt/meta/main.yml b/ansible_collections/dellemc/os10/roles/os10_vlt/meta/main.yml new file mode 100644 index 00000000..c3164f7d --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vlt/meta/main.yml @@ -0,0 +1,18 @@ +# Copyright (c) 2017-2020 Dell Inc. or its subsidiaries. All Rights Reserved. +--- +galaxy_info: + author: Dell EMC Networking Engineering + description: The os10_vlt role facilitates the configuration of VLT attributes in devices running Dell EMC SmartFabric OS10. + company: Dell Technologies + license: GPLv3 + min_ansible_version: 2.9.6 + + platforms: + - name: os10 + + galaxy_tags: + - networking + - dell + - emc + - dellemc + - os10 diff --git a/ansible_collections/dellemc/os10/roles/os10_vlt/tasks/main.yml b/ansible_collections/dellemc/os10/roles/os10_vlt/tasks/main.yml new file mode 100644 index 00000000..63fa380a --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vlt/tasks/main.yml @@ -0,0 +1,16 @@ +--- +# tasks file for os10 + - name: "Generating VLT configuration for os10" + template: + src: os10_vlt.j2 + dest: "{{ build_dir }}/vlt10_{{ hostname }}.conf.part" + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") and ((os10_cfg_generate | default('False')) | bool) +# notify: save config os10 + register: generate_output + + - name: "Provisioning VLT configuration for os10" + os10_config: + src: os10_vlt.j2 + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") +# notify: save config os10 + register: output diff --git a/ansible_collections/dellemc/os10/roles/os10_vlt/templates/os10_vlt.j2 b/ansible_collections/dellemc/os10/roles/os10_vlt/templates/os10_vlt.j2 new file mode 100644 index 00000000..4915ff71 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vlt/templates/os10_vlt.j2 @@ -0,0 +1,108 @@ +#jinja2: trim_blocks: True,lstrip_blocks: True +{################################ +Purpose: +Configure VLT commands fon os10 Devices. +os10_vlt: + domain: 1 + backup_destination: "192.168.1.1" + destination_type: "ipv4" + backup_destination_vrf: "management" + discovery_intf: 1/1/12 + discovery_intf_state: present + peer_routing: True + priority: 1 + vlt_mac: aa:aa:aa:aa:aa:aa + vlt_peers: + Po 12: + peer_lag: 13 + state: present +################################} +{% if os10_vlt is defined and os10_vlt %} + {% if os10_vlt.domain is defined and os10_vlt.domain %} + {% if os10_vlt.state is defined and os10_vlt.state == 'absent' %} +no vlt-domain {{ os10_vlt.domain }} + {% else %} +vlt-domain {{ os10_vlt.domain }} + {% if os10_vlt.backup_destination is defined %} + {% if os10_vlt.backup_destination %} + {% if os10_vlt.destination_type is defined %} + {% if os10_vlt.destination_type == "ipv6" %} + backup destination ipv6 {{ os10_vlt.backup_destination }} + {% elif os10_vlt.destination_type == "ipv4" %} + {% if os10_vlt.backup_destination_vrf is defined and os10_vlt.backup_destination_vrf %} + backup destination {{ os10_vlt.backup_destination }} vrf {{ os10_vlt.backup_destination_vrf }} + {% else %} + backup destination {{ os10_vlt.backup_destination }} + {% endif %} + {% endif %} + {% endif %} + {% else %} + no backup destination + {% endif %} + {% endif %} + {% if os10_vlt.discovery_intf_state is defined and os10_vlt.discovery_intf_state == "absent" %} + {% if os10_vlt.discovery_intf is defined and os10_vlt.discovery_intf %} + no discovery-interface ethernet{{ os10_vlt.discovery_intf }} + {% endif %} + {% else %} + {% if os10_vlt.discovery_intf is defined and os10_vlt.discovery_intf %} + discovery-interface ethernet{{ os10_vlt.discovery_intf }} + {% endif %} + {% endif %} + {% if os10_vlt.backup_destination is defined %} + {% if os10_vlt.backup_destination %} + {% if os10_vlt.destination_type is defined %} + {% if os10_vlt.destination_type == 'ipv6' %} + backup destination ipv6 {{ os10_vlt.backup_destination }} + {% elif os10_vlt.destination_type == 'ipv4' %} + {% if os10_vlt.backup_destination_vrf is defined and os10_vlt.backup_destination_vrf %} + backup destination {{ os10_vlt.backup_destination }} vrf {{ os10_vlt.backup_destination_vrf }} + {% else %} + backup destination {{ os10_vlt.backup_destination }} + {% endif %} + {% endif %} + {% endif %} + {% else %} + no backup destination + {% endif %} + {% endif %} + {% if os10_vlt.priority is defined %} + {% if os10_vlt.priority %} + primary-priority {{ os10_vlt.priority }} + {% else %} + no primary-priority + {% endif %} + {% endif %} + {% if os10_vlt.peer_routing is defined %} + {% if os10_vlt.peer_routing %} + peer-routing + {% else %} + no peer-routing + {% endif %} + {% endif %} + {% if os10_vlt.vlt_mac is defined %} + {% if os10_vlt.vlt_mac %} + vlt-mac {{ os10_vlt.vlt_mac }} + {% else %} + no vlt-mac + {% endif %} + {% endif %} + + {% endif %} + {% endif %} + {% if os10_vlt.vlt_peers is defined and os10_vlt.vlt_peers %} + {% for key in os10_vlt.vlt_peers.keys() %} + {% set channel_id = key.split(" ") %} + {% set peer_vars = os10_vlt.vlt_peers[key] %} +interface port-channel{{ channel_id[1] }} + {% if peer_vars.peer_lag is defined %} + {% if peer_vars.peer_lag %} + vlt-port-channel {{ peer_vars.peer_lag}} + {% else %} + no vlt-port-channel + {% endif %} + {% endif %} + + {% endfor %} + {% endif %} +{% endif %} diff --git a/ansible_collections/dellemc/os10/roles/os10_vlt/tests/inventory.yaml b/ansible_collections/dellemc/os10/roles/os10_vlt/tests/inventory.yaml new file mode 100644 index 00000000..b1ff63e6 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vlt/tests/inventory.yaml @@ -0,0 +1,22 @@ +--- +spine1 ansible_host=10.11.182.25 ansible_network_os="dellemc.os10.os10" +spine2 ansible_host=10.16.151.220 ansible_network_os="dellemc.os10.os10" + +leaf1 ansible_host=10.11.182.23 ansible_network_os="dellemc.os10.os10" +leaf2 ansible_host=10.11.182.16 ansible_network_os="dellemc.os10.os10" +leaf3 ansible_host=10.11.182.17 ansible_network_os="dellemc.os10.os10" +leaf4 ansible_host=10.16.148.79 ansible_network_os="dellemc.os10.os10" + +[spine] +spine1 +spine2 + +[leaf] +leaf1 +leaf2 +leaf3 +leaf4 + +[datacenter:children] +spine +leaf diff --git a/ansible_collections/dellemc/os10/roles/os10_vlt/tests/main.os10.yaml b/ansible_collections/dellemc/os10/roles/os10_vlt/tests/main.os10.yaml new file mode 100644 index 00000000..1c15f159 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vlt/tests/main.os10.yaml @@ -0,0 +1,17 @@ +--- +# vars file for dellemc.os10.os10_vlt, +# below gives a example configuration +# Sample variables for OS10 device +os10_vlt: + domain: 1 + backup_destination: "192.168.211.175" + destination_type: "ipv4" + backup_destination_vrf: + discovery_intf: 1/1/12 + discovery_intf_state: present + peer_routing: True + vlt_mac: aa:aa:aa:aa:aa:aa + vlt_peers: + Po 12: + peer_lag: 13 + state: present diff --git a/ansible_collections/dellemc/os10/roles/os10_vlt/tests/test.yaml b/ansible_collections/dellemc/os10/roles/os10_vlt/tests/test.yaml new file mode 100644 index 00000000..8f950f01 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vlt/tests/test.yaml @@ -0,0 +1,5 @@ +--- +- hosts: datacenter + connection: network_cli + roles: + - dellemc.os10.os10_vlt diff --git a/ansible_collections/dellemc/os10/roles/os10_vlt/vars/main.yml b/ansible_collections/dellemc/os10/roles/os10_vlt/vars/main.yml new file mode 100644 index 00000000..aee0f95b --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vlt/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for dellemc.os10.os10_vlt diff --git a/ansible_collections/dellemc/os10/roles/os10_vrf/LICENSE b/ansible_collections/dellemc/os10/roles/os10_vrf/LICENSE new file mode 100644 index 00000000..2c9b8e1f --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vrf/LICENSE @@ -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) 2020, Dell Inc. All rights reserved. + + 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) 2020, Dell Inc. All rights reserved. + 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>. diff --git a/ansible_collections/dellemc/os10/roles/os10_vrf/README.md b/ansible_collections/dellemc/os10/roles/os10_vrf/README.md new file mode 100644 index 00000000..464efc5b --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vrf/README.md @@ -0,0 +1,143 @@ +VRF role +======== + +This role facilitates to configure the basics of virtual routing and forwarding (VRF) that helps in the partition of physical routers to multiple virtual routers. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. + +The VRF role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. + +Role variables +-------------- + +- Role is abstracted using the variable `ansible_network_os` that can take the `dellemc.os10.os10` as the value +- If `os10_cfg_generate` is set to true, the variable generates the role configuration commands in a file +- Any role variable with a corresponding state variable set to absent negates the configuration of that variable +- Setting an empty value for any variable negates the corresponding configuration +- Variables and values are case-sensitive + +**os10_vrf keys** + +| Key | Type | Description | Support | +|------------|---------------------------|---------------------------------------------------------|-----------------------| +| ``vrfdetails`` | list | Configures the list of VRF instances (see ``instances.*``) | os10 | +| ``vrfdetails.vrf_name`` | string | Specifies the VRF instance name (default is management) | os10 | +| ``vrfdetails.state`` | string | Deletes the VRF instance name if set to absent | os10 | +| ``vrfdetails.ip_route_import`` | string | Configures VRF IP subcommands | os10 | +| ``ip_route_import.community_value`` | string | Configures the route community value | os10 | +| ``ip_route_import.route_map_value`` | string | Configures the route-map value | os10 | +| ``ip_route_import.state`` | string | Deletes the IP configuration if set to absent | os10 | +| ``vrfdetails.ip_route_export`` | string | Configures VRF IP subcommands | os10 | +| ``ip_route_export.community_value`` | string | Configures the route community value | os10 | +| ``ip_route_export.route_map_value`` | string | Configures the route-map value | os10 | +| ``ip_route_export.state`` | string | Deletes the IP config if set to absent | os10 | +| ``vrfdetails.ipv6_route_import`` | string | Configures VRF IPv6 subcommands | os10 | +| ``ipv6_route_import.community_value`` | string | Configures the route community value | os10 | +| ``ipv6_route_import.route_map_value`` | string | Configures the route-map value | os10 | +| ``ipv6_route_import.state`` | string | Deletes the IP config if set to absent | os10 | +| ``vrfdetails.ipv6_route_export`` | string | Configures VRF IPv6 subcommands | os10 | +| ``ipv6_route_import.community_value`` | string | Configures the route community value | os10 | +| ``ipv6_route_export.route_map_value`` | string | Configures the route-map value | os10 | +| ``ipv6_route_import.state`` | string | Deletes the IP config if set to absent | os10 | +| ``vrfdetails.map_ip_interface`` | list | Specifies a list of valid interface names | os10 | +| ``map_ip_interface.intf_id`` | string | Specifies a valid interface name | os10 | +| ``map_ip_interface.state`` | string | Deletes VRF association in the interface if set to absent | os10 | +| ``upd_src_ip_loopback_id`` | string | Configures the source IP for any leaked route in VRF from the provided loopback ID, delete if empty string| os10 | + +> **NOTE**: Asterisk (\*) denotes the default value if none is specified. + +Connection variables +-------------------- + +Ansible Dell EMC network roles require connection information to establish communication with the nodes in your inventory. This information can exist in the Ansible *group_vars* or *host_vars* directories, or inventory or in the playbook itself. + +| Key | Required | Choices | Description | +|-------------|----------|------------|-----------------------------------------------------| +| ``ansible_host`` | yes | | Specifies the hostname or address for connecting to the remote device over the specified transport | +| ``ansible_port`` | no | | Specifies the port used to build the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_PORT` option is used; it defaults to 22 | +| ``ansible_ssh_user`` | no | | Specifies the username that authenticates the CLI login for the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_USER` environment variable value is used | +| ``ansible_ssh_pass`` | no | | Specifies the password that authenticates the connection to the remote device | +| ``ansible_become`` | no | yes, no\* | Instructs the module to enter privileged mode on the remote device before sending any commands; if value is unspecified, the `ANSIBLE_BECOME` environment variable value is used, and the device attempts to execute all commands in non-privileged mode | +| ``ansible_become_method`` | no | enable, sudo\* | Instructs the module to allow the become method to be specified for handling privilege escalation; if value is unspecified, the `ANSIBLE_BECOME_METHOD` environment variable value is used | +| ``ansible_become_pass`` | no | | Specifies the password to use if required to enter privileged mode on the remote device; if ``ansible_become`` is set to no this key is not applicable | +| ``ansible_network_os`` | yes | os10, null\* | Loads the correct terminal and cliconf plugins to communicate with the remote device | + +> **NOTE**: Asterisk (\*) denotes the default value if none is specified. + +Dependencies +------------ + +The *os10_vrf* role is built on modules included in the core Ansible code. These modules were added in ansible version 2.2.0 + +Example playbook +---------------- + +This example uses the *os10_vrf* role to setup a VRF and associate it to an interface. It creates a *hosts* file with the switch details and corresponding variables. The hosts file should define the `ansible_network_os` variable with corresponding Dell EMC OS10 name. + +When `os10_cfg_generate` is set to true, the variable generates the configuration commands as a .part file in *build_dir* path. By default, the variable is set to false. It writes a simple playbook that references the *os10_vrf* role. +*upd_src_ip_loopback_id* has an dependency with association of the interface in a VRF, and the *os10_vrf* role needs to be invoked twice with different input dictionary one for the create and one for *upd_src_ip_loopback_id*. + +**Sample hosts file** + + leaf1 ansible_host= <ip_address> + +**Sample host_vars/leaf1** + + hostname: leaf1 + ansible_become: yes + ansible_become_method: xxxxx + ansible_become_pass: xxxxx + ansible_ssh_user: xxxxx + ansible_ssh_pass: xxxxx + ansible_network_os: dellemc.os10.os10 + build_dir: ../temp/os10 + os10_vrf: + vrfdetails: + - vrf_name: "os10vrf" + state: "present" + ip_route_import: + community_value: "10:20" + state: "present" + route_map_value: "test4" + ip_route_export: + community_value: "30:40" + state: "present" + route_map_value: "test3" + ipv6_route_import: + community_value: "40:50" + state: "absent" + route_map_value: "test2" + ipv6_route_export: + community_value: "60:70" + state: "absent" + route_map_value: "test2" + map_ip_interface: + - intf_id : "loopback11" + state : "present" + + os_vrf_upd_src_loopback: + vrfdetails: + - vrf_name: "os10vrf" + state: "present" + upd_src_ip_loopback_id: 11 + +**Simple playbook to setup system — leaf.yaml** + + - hosts: leaf1 + roles: + - dellemc.os10.os10_vrf + +**Simple playbook with `upd_src_ip_loopback_id` — leaf.yaml** + + - hosts: leaf1 + roles: + - dellemc.os10.os10_vrf + - hosts: leaf1 + vars: + os10_vrf: "{{ os_vrf_upd_src_loopback }}" + roles: + - dellemc.os10.os10_vrf + +**Run** + + ansible-playbook -i hosts leaf.yaml + +(c) 2017-2020 Dell Inc. or its subsidiaries. All rights reserved. diff --git a/ansible_collections/dellemc/os10/roles/os10_vrf/defaults/main.yml b/ansible_collections/dellemc/os10/roles/os10_vrf/defaults/main.yml new file mode 100644 index 00000000..e00abdd9 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vrf/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for dellemc.os10.os10_vrf diff --git a/ansible_collections/dellemc/os10/roles/os10_vrf/handlers/main.yml b/ansible_collections/dellemc/os10/roles/os10_vrf/handlers/main.yml new file mode 100644 index 00000000..7bd70e18 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vrf/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for dellemc.os10.os10_vrf diff --git a/ansible_collections/dellemc/os10/roles/os10_vrf/meta/main.yml b/ansible_collections/dellemc/os10/roles/os10_vrf/meta/main.yml new file mode 100644 index 00000000..db8f619d --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vrf/meta/main.yml @@ -0,0 +1,18 @@ +# Copyright (c) 2017-2020 Dell Inc. or its subsidiaries. All Rights Reserved. +--- +galaxy_info: + author: Dell EMC Networking Engineering + description: The os10_vrf role facilitates the configuration of VRF attributes in devices running Dell EMC SmartFabric OS10. + company: Dell Technologies + license: GPLv3 + min_ansible_version: 2.9.6 + + platforms: + - name: os10 + + galaxy_tags: + - networking + - dell + - emc + - dellemc + - os10 diff --git a/ansible_collections/dellemc/os10/roles/os10_vrf/tasks/main.yml b/ansible_collections/dellemc/os10/roles/os10_vrf/tasks/main.yml new file mode 100644 index 00000000..ef651579 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vrf/tasks/main.yml @@ -0,0 +1,16 @@ +--- +# tasks file for os10 + - name: "Generating vrf configuration for os10" + template: + src: os10_vrf.j2 + dest: "{{ build_dir }}/vrf10_{{ hostname }}.conf.part" + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") and ((os10_cfg_generate | default('False')) | bool) +# notify: save config os10 + register: generate_output + + - name: "Provisioning VRF configuration for os10" + os10_config: + src: os10_vrf.j2 + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") +# notify: save config os10 + register: output diff --git a/ansible_collections/dellemc/os10/roles/os10_vrf/templates/os10_vrf.j2 b/ansible_collections/dellemc/os10/roles/os10_vrf/templates/os10_vrf.j2 new file mode 100644 index 00000000..e77f6c14 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vrf/templates/os10_vrf.j2 @@ -0,0 +1,122 @@ +#jinja2: trim_blocks: True,lstrip_blocks: True +{################################ +Purpose: +Configure VRF on os10 Devices. +os10_vrf: + vrfdetails: + -vrf_name: "os10vrf" + state: "present" + ip_route_import: + community_value: 10:15 + state: "absent" + route_map_value: test1 + ip_route_export: + commnity_value: 20:30 + state: "present" + route_map_value: test2 + ipv6_route_import: + community_value: 10:15 + state: "present" + route_map_value: test3 + ipv6_route_export: + commnity_value: 20:30 + state: "present" + route_map_value: test4 + map_ip_interface: + -intf_id : loopback6 + state : "present" + upd_src_ip_loopback_id: 5 + -vrf_name: "os10vrf1" + state: "absent" +################################} +{% if (os10_vrf is defined and os10_vrf) %} +{% if os10_vrf.vrfdetails is defined %} + {% for vrf in os10_vrf.vrfdetails %} + {% if vrf.vrf_name is defined %} + {% if vrf.vrf_name %} + {% if vrf.state is defined and vrf.state == 'absent' %} +no ip vrf {{ vrf.vrf_name }} + {% else %} +ip vrf {{ vrf.vrf_name }} + {% if vrf.ip_route_import is defined and vrf.ip_route_import %} + {% set route_vars = vrf.ip_route_import %} + {% if route_vars.community_value is defined and route_vars.community_value %} + {% if route_vars.state == 'present' %} + {% if route_vars.route_map_value is defined and route_vars.route_map_value %} + ip route-import {{ route_vars.community_value }} route-map {{ route_vars.route_map_value }} + {% else %} + ip route-import {{ route_vars.community_value }} + {% endif %} + {% else %} + no ip route-import {{ route_vars.community_value }} + {% endif %} + {% endif %} + {% endif %} + {% if vrf.ipv6_route_import is defined and vrf.ipv6_route_import %} + {% set route_vars = vrf.ipv6_route_import %} + {% if route_vars.community_value is defined and route_vars.community_value %} + {% if route_vars.state == 'present' %} + {% if route_vars.route_map_value is defined and route_vars.route_map_value %} + ipv6 route-import {{ route_vars.community_value }} route-map {{ route_vars.route_map_value }} + {% else %} + ipv6 route-import {{ route_vars.community_value }} + {% endif %} + {% else %} + no ipv6 route-import {{ route_vars.community_value }} + {% endif %} + {% endif %} + {% endif %} + {% if vrf.ip_route_export is defined and vrf.ip_route_export %} + {% set route_vars = vrf.ip_route_export %} + {% if route_vars.community_value is defined and route_vars.community_value %} + {% if route_vars.state == 'present' %} + {% if route_vars.route_map_value is defined and route_vars.route_map_value %} + ip route-export {{ route_vars.community_value }} route-map {{ route_vars.route_map_value }} + {% else %} + ip route-export {{ route_vars.community_value }} + {% endif %} + {% else %} + no ip route-export {{ route_vars.community_value }} + {% endif %} + {% endif %} + {% endif %} + {% if vrf.ipv6_route_export is defined and vrf.ipv6_route_export %} + {% set route_vars = vrf.ipv6_route_export %} + {% if route_vars.community_value is defined and route_vars.community_value %} + {% if route_vars.state == 'present' %} + {% if route_vars.route_map_value is defined and route_vars.route_map_value %} + ipv6 route-export {{ route_vars.community_value }} route-map {{ route_vars.route_map_value }} + {% else %} + ipv6 route-export {{ route_vars.community_value }} + {% endif %} + {% else %} + no ipv6 route-export {{ route_vars.community_value }} + {% endif %} + {% endif %} + {% endif %} + {% if vrf.map_ip_interface is defined and vrf.map_ip_interface %} + exit + {% for map_ip_interface in vrf.map_ip_interface %} + {% if map_ip_interface.intf_id is defined and map_ip_interface.intf_id %} +interface {{ map_ip_interface.intf_id }} + {% if map_ip_interface.state is defined and map_ip_interface.state == "absent" %} + no ip vrf forwarding + {% else %} + ip vrf forwarding {{ vrf.vrf_name }} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% if vrf.upd_src_ip_loopback_id is defined %} + {% if vrf.upd_src_ip_loopback_id %} + update-source-ip loopback{{ vrf.upd_src_ip_loopback_id}} + {% else %} + no update-source-ip loopback + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endfor %} +{% endif %} +{% endif %} diff --git a/ansible_collections/dellemc/os10/roles/os10_vrf/tests/inventory.yaml b/ansible_collections/dellemc/os10/roles/os10_vrf/tests/inventory.yaml new file mode 100644 index 00000000..b1ff63e6 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vrf/tests/inventory.yaml @@ -0,0 +1,22 @@ +--- +spine1 ansible_host=10.11.182.25 ansible_network_os="dellemc.os10.os10" +spine2 ansible_host=10.16.151.220 ansible_network_os="dellemc.os10.os10" + +leaf1 ansible_host=10.11.182.23 ansible_network_os="dellemc.os10.os10" +leaf2 ansible_host=10.11.182.16 ansible_network_os="dellemc.os10.os10" +leaf3 ansible_host=10.11.182.17 ansible_network_os="dellemc.os10.os10" +leaf4 ansible_host=10.16.148.79 ansible_network_os="dellemc.os10.os10" + +[spine] +spine1 +spine2 + +[leaf] +leaf1 +leaf2 +leaf3 +leaf4 + +[datacenter:children] +spine +leaf diff --git a/ansible_collections/dellemc/os10/roles/os10_vrf/tests/main.os10.yaml b/ansible_collections/dellemc/os10/roles/os10_vrf/tests/main.os10.yaml new file mode 100644 index 00000000..b8a265d8 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vrf/tests/main.os10.yaml @@ -0,0 +1,33 @@ +--- +# vars file for dellemc.os10.os10_vrf, +# below gives a sample configuration +# Sample variables for OS10 device +os10_vrf: + vrfdetails: + - vrf_name: "os10vrf" + state: "present" + ip_route_import: + community_value: "10:20" + state: "present" + route_map_value: "test1" + ip_route_export: + community_value: "30:40" + state: "present" + route_map_value: "test2" + ipv6_route_import: + community_value: "40:50" + state: "absent" + route_map_value: "test3" + ipv6_route_export: + community_value: "60:70" + state: "absent" + route_map_value: "test4" + map_ip_interface: + - intf_id: "loopback11" + state: "present" + +os_vrf_upd_src_loopback: + vrfdetails: + - vrf_name: "os10vrf" + state: "present" + upd_src_ip_loopback_id: 11 diff --git a/ansible_collections/dellemc/os10/roles/os10_vrf/tests/test.yaml b/ansible_collections/dellemc/os10/roles/os10_vrf/tests/test.yaml new file mode 100644 index 00000000..6093a28f --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vrf/tests/test.yaml @@ -0,0 +1,5 @@ +--- +- hosts: datacenter + connection: network_cli + roles: + - dellemc.os10.os10_vrf diff --git a/ansible_collections/dellemc/os10/roles/os10_vrf/vars/main.yml b/ansible_collections/dellemc/os10/roles/os10_vrf/vars/main.yml new file mode 100644 index 00000000..5ed35d63 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vrf/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars for dellemc.os10.os10_vrf diff --git a/ansible_collections/dellemc/os10/roles/os10_vrrp/LICENSE b/ansible_collections/dellemc/os10/roles/os10_vrrp/LICENSE new file mode 100644 index 00000000..2c9b8e1f --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vrrp/LICENSE @@ -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) 2020, Dell Inc. All rights reserved. + + 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) 2020, Dell Inc. All rights reserved. + 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>. diff --git a/ansible_collections/dellemc/os10/roles/os10_vrrp/README.md b/ansible_collections/dellemc/os10/roles/os10_vrrp/README.md new file mode 100644 index 00000000..299166bf --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vrrp/README.md @@ -0,0 +1,139 @@ +VRRP role +========= + +This role facilitates configuring virtual router redundancy protocol (VRRP) attributes. It supports the creation of VRRP groups for interfaces and setting the VRRP group attributes. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. + +The VRRP role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. + +Role variables +-------------- + +- Role is abstracted using the `ansible_network_os` variable that can take `dellemc.os10.os10` as the value +- If `os10_cfg_generate` is set to true, the variable generates the role configuration commands in a file +- Any role variable with a corresponding state variable set to absent negates the configuration of that variable +- Setting an empty value for any variable negates the corresponding configuration +- `os10_vrrp` (dictionary) holds a dictionary with the interface name key +- Interface name can correspond to any of the valid OS10 interface with a unique interface identifier name +- Physical interfaces names must be in *<interfacename> <tuple>* format (for example *fortyGigE 1/1*) +- Variables and values are case-sensitive + +| Key | Type | Description | Support | +|------------|---------------------------|---------------------------------------------------------|-----------------------| +| ``vrrp`` | dictionary | Configures VRRP commands (see ``vrrp.*``) | os10 | +| ``version`` | dictionary | Configures VRRP version | os10 | +| ``vrrp_active_active_mode`` | dictionary | Configures VRRP active-active mode | os10 | +| ``delay_reload`` | integer | Configures the minimum delay timer applied after boot (0 to 900) | os10 | +| ``vrrp_group`` | list | Configures VRRP group commands (see ``vrrp_group.*``) | os10 | +| ``vrrp_group.type`` | string: ipv6,ipv4 | Specifies the type of the VRRP group | os10 | +| ``vrrp_group.group_id`` | integer (required) | Configures the ID for the VRRP group (1 to 255) | os10 | +| ``vrrp_group.virtual_address`` | string | Configures a virtual-address to the VRRP group (A.B.C.D format) | os10 | +| ``virtual_address.ip`` | string | Configures a virtual ip address (A.B.C.D format) | os10 | +| ``virtual_address.state`` | string: present\*,absent | Configures/unconfigures a virtual-address (A.B.C.D format) | os10 | +| ``vrrp_group.preempt`` | boolean: true\*,false | Configures preempt mode on the VRRP group | os10 | +| ``vrrp_group.priority`` |integer | Configures priority for the VRRP group (1 to 255; default 100) | os10 | +| ``vrrp_group.adv_interval_centisecs`` | integer | Configures the advertisement interval for the VRRP group in centiseconds (25 to 4075; default 100) and in multiple of 25; centisecs gets converted into seconds in version 2 | os10 | +| ``vrrp_group.track_interface`` | list | Configures the track interface of the VRRP group (see ``track.*``) | os10 | +| ``track_interface.resource_id`` | integer | Configures the object tracking resource ID of the VRRP group; mutually exclusive with *track.interface* | os10 | +| ``track_interface.interface`` | string | Configures the track interface of the VRRP group (<interface name> <interface number> format) | os10 | +| ``track_interface.priority_cost`` | integer | Configures the priority cost for track interface of the VRRP group (1 to 254; default 10) | os10 | +| ``track_interface.state`` | string: present\*,absent | Deletes the specific track interface from the VRRP group if set to absent | os10 | +| ``vrrp_group.track_interface.state`` | string: present*,absent | Deletes all track interfaces from the VRRP group if set to absent | os10 | +| ``vrrp_group.state`` | string: present\*,absent | Deletes the VRRP group from the interface if set to absent | os10 | + +> **NOTE**: Asterisk (\*) denotes the default value if none is specified. + +Connection variables +-------------------- + +Ansible Dell EMC network roles require connection information to establish communication with the nodes in your inventory. This information can exist in the Ansible *group_vars* or *host_vars* directories, or inventory or in the playbook itself. + +| Key | Required | Choices | Description | +|-------------|----------|------------|-----------------------------------------------------| +| ``ansible_host`` | yes | | Specifies the hostname or address for connecting to the remote device over the specified transport | +| ``ansible_port`` | no | | Specifies the port used to build the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_PORT` option is used; it defaults to 22 | +| ``ansible_ssh_user`` | no | | Specifies the username that authenticates the CLI login for the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_USER` environment variable value is used | +| ``ansible_ssh_pass`` | no | | Specifies the password that authenticates the connection to the remote device | +| ``ansible_become`` | no | yes, no\* | Instructs the module to enter privileged mode on the remote device before sending any commands; if value is unspecified, the `ANSIBLE_BECOME` environment variable value is used, and the device attempts to execute all commands in non-privileged mode | +| ``ansible_become_method`` | no | enable, sudo\* | Instructs the module to allow the become method to be specified for handling privilege escalation; if value is unspecified, the `ANSIBLE_BECOME_METHOD` environment variable value is used | +| ``ansible_become_pass`` | no | | Specifies the password to use if required to enter privileged mode on the remote device; if ``ansible_become`` is set to no this key is not applicable | +| ``ansible_network_os`` | yes | os10, null\* | Loads the correct terminal and cliconf plugins to communicate with the remote device | + +> **NOTE**: Asterisk (\*) denotes the default value if none is specified. + + +Example playbook +---------------- + +This example uses the *os10_vrrp* role to configure VRRP commands at the interfaces. It creates a *hosts* file with the switch details and corresponding variables. The hosts file should define the `ansible_network_os` variable with corresponding Dell EMC OS10 name. + +When `os10_cfg_generate` is set to true, the variable generates the configuration commands as a .part file in *build_dir* path. By default, the variable is set to false. It writes a simple playbook that only references the *os10_vrrp* role. + +**Sample hosts file** + + leaf1 ansible_host= <ip_address> + +**Sample host_vars/leaf1** + + hostname: leaf1 + ansible_become: yes + ansible_become_method: xxxxx + ansible_become_pass: xxxxx + ansible_ssh_user: xxxxx + ansible_ssh_pass: xxxxx + ansible_network_os: dellemc.os10.os10 + build_dir: ../temp/temp_os10 + os10_vrrp: + vrrp: + delay_reload: 2 + version: 3 + ethernet1/1/1: + vrrp_group: + - group_id: 2 + type: ipv6 + priority: 120 + preempt: false + track_interface: + - resource_id: 3 + priority_cost: 25 + state: present + virtual_address: + - ip: 2001:4828:5808:ffa3::9 + state: present + - ip: 3001:4828:5808:ffa3::9 + state: present + - ip: 4001:4828:5808:ffa3::9 + state: absent + adv_interval_centisecs: 200 + state: present + - group_id: 4 + virtual_address: + - ip: 4.1.1.1 + state: present + - ip: 4.1.1.2 + state: present + - ip: 4.1.1.3 + state: absent + priority: 120 + preempt: false + track_interface: + - resource_id: 3 + priority_cost: 25 + state: present + adv_interval_centisecs: 200 + state: present + vlan100: + vrrp_active_active_mode: true + +> **NOTE**: Interface VRRP cannot exist with L2 modes and can be configured using the *os10_interface* role. + +**Simple playbook to setup system — leaf.yaml** + + - hosts: leaf1 + roles: + - dellemc.os10.os10_vrrp + +**Run** + + ansible-playbook -i hosts leaf.yaml + +(c) 2017-2020 Dell Inc. or its subsidiaries. All rights reserved. diff --git a/ansible_collections/dellemc/os10/roles/os10_vrrp/defaults/main.yml b/ansible_collections/dellemc/os10/roles/os10_vrrp/defaults/main.yml new file mode 100644 index 00000000..089bfddc --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vrrp/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for dellemc.os10.os10_vrrp diff --git a/ansible_collections/dellemc/os10/roles/os10_vrrp/handlers/main.yml b/ansible_collections/dellemc/os10/roles/os10_vrrp/handlers/main.yml new file mode 100644 index 00000000..aef7df3b --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vrrp/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for dellemc.os10.os10_vrrp diff --git a/ansible_collections/dellemc/os10/roles/os10_vrrp/meta/main.yml b/ansible_collections/dellemc/os10/roles/os10_vrrp/meta/main.yml new file mode 100644 index 00000000..38560f94 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vrrp/meta/main.yml @@ -0,0 +1,19 @@ +# Copyright (c) 2020 Dell Inc. +--- +galaxy_info: + author: Dell EMC Networking Engineering + description: > + The os10_vrrp role facilitates the configuration of Virtual Router Redundancy Protocol (VRRP) attributes in + devices running Dell EMC SmartFabric OS10. + license: GPLv3 + min_ansible_version: 2.9.6 + + platforms: + - name: os10 + + galaxy_tags: + - networking + - dell + - dellemc + - emc + - os10 diff --git a/ansible_collections/dellemc/os10/roles/os10_vrrp/tasks/main.yml b/ansible_collections/dellemc/os10/roles/os10_vrrp/tasks/main.yml new file mode 100644 index 00000000..3d8a1a6c --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vrrp/tasks/main.yml @@ -0,0 +1,16 @@ +--- +# tasks file for os10 + - name: "Generating VRRP configuration for os10" + template: + src: os10_vrrp.j2 + dest: "{{ build_dir }}/vrrp10_{{ hostname }}.conf.part" + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") and ((os10_cfg_generate | default('False')) | bool) +# notify: save config os10 + register: generate_output + + - name: "Provisioning VRRP configuration for os10" + os10_config: + src: os10_vrrp.j2 + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") +# notify: save config os10 + register: output diff --git a/ansible_collections/dellemc/os10/roles/os10_vrrp/templates/os10_vrrp.j2 b/ansible_collections/dellemc/os10/roles/os10_vrrp/templates/os10_vrrp.j2 new file mode 100644 index 00000000..a1c75b6a --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vrrp/templates/os10_vrrp.j2 @@ -0,0 +1,154 @@ +#jinja2: trim_blocks: True, lstrip_blocks: True +{########################################## +Purpose: +Configure VRRP commands for os10 Devices +os10_vrrp: + vrrp: + delay_reload: 2 + version: 3 + ethernet1/1/1: + vrrp_group: + - group_id: 2 + type: ipv6 + priority: 120 + preempt: false + track_interface: + - resource_id: 3 + priority_cost: 25 + state: present + virtual_address: + - ip: 2001:4828:5808:ffa3::9 + state: present + - ip: 3001:4828:5808:ffa3::9 + state: present + - ip: 4001:4828:5808:ffa3::9 + state: absent + adv_interval_centisecs: 200 + state: present + - group_id: 4 + virtual_address: + - ip: 4.1.1.1 + state: present + - ip: 4.1.1.2 + state: present + - ip: 4.1.1.3 + state: absent + priority: 120 + preempt: false + track_interface: + - resource_id: 3 + priority_cost: 25 + state: present + adv_interval_centisecs: 200 + state: present + vlan100: + vrrp_active_active_mode: True +#########################################} +{% if os10_vrrp is defined and os10_vrrp %} +{% for key,value in os10_vrrp.items() %} +{% if key == "vrrp" %} + {% if value.delay_reload is defined %} + {% if value.delay_reload >=0 %} +vrrp delay reload {{ value.delay_reload }} + {% else %} +vrrp delay reload {{ value.delay_reload }} + {% endif %} + {% endif %} + {% if value.version is defined %} + {% if value.version %} +vrrp version {{ value.version }} + {% else %} +no vrrp version + {% endif %} + {% endif %} +{% else %} +interface {{ key }} + {% if value %} + {% if key.startswith("vlan") %} + {% if value.vrrp_active_active_mode is defined and value.vrrp_active_active_mode %} + vrrp mode active-active + {% else %} + no vrrp mode active-active + {% endif %} + {% endif %} + {% if value.vrrp_group is defined and value.vrrp_group %} + {% for group in value.vrrp_group %} + {% if group.group_id is defined and group.group_id %} + {% if group.state is defined and group.state == "absent" %} + {% if group.type is defined and group.type == "ipv6" %} + no vrrp-ipv6-group {{ group.group_id }} + {% else %} + no vrrp-group {{ group.group_id }} + {% endif %} + {% else %} + {% if group.type is defined and group.type == "ipv6" %} + vrrp-ipv6-group {{ group.group_id }} + {% else %} + vrrp-group {{ group.group_id }} + {% endif %} + {% if group.adv_interval_centisecs is defined %} + {% if group.adv_interval_centisecs %} + advertise-interval centisecs {{ group.adv_interval_centisecs }} + {% else %} + no advertise-interval centisecs + {% endif %} + {% endif %} + {% if group.adv_interval_secs is defined %} + {% if group.adv_interval_secs %} + advertise-interval secs {{ group.adv_interval_secs }} + {% else %} + no advertise-interval secs + {% endif %} + {% endif %} + {% if group.track_interface is defined and group.track_interface %} + {% for track_item in group.track_interface %} + {% if track_item.state is defined and track_item.state == "absent" %} + {% if track_item.resource_id is defined and track_item.resource_id %} + no track {{ track_item.resource_id }} + {% endif %} + {% else %} + {% if track_item.resource_id is defined and track_item.resource_id %} + {% if track_item.priority_cost is defined and track_item.priority_cost %} + track {{ track_item.resource_id }} priority-cost {{ track_item.priority_cost }} + {% else %} + track {{ track_item.resource_id }} + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% if group.virtual_address is defined and group.virtual_address %} + {% for virtual_interface in group.virtual_address %} + {% if virtual_interface.state is defined and virtual_interface.state == "absent" %} + {% if virtual_interface.ip is defined and virtual_interface.ip %} + no virtual-address {{ virtual_interface.ip }} + {% endif %} + {% else %} + {% if virtual_interface.ip is defined and virtual_interface.ip %} + virtual-address {{ virtual_interface.ip }} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% if group.preempt is defined %} + {% if group.preempt %} + preempt + {% else %} + no preempt + {% endif %} + {% endif %} + {% if group.priority is defined %} + {% if group.priority %} + priority {{ group.priority }} + {% else %} + no priority + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% endif %} +{% endif %} +{% endfor %} +{% endif %} diff --git a/ansible_collections/dellemc/os10/roles/os10_vrrp/tests/inventory.yaml b/ansible_collections/dellemc/os10/roles/os10_vrrp/tests/inventory.yaml new file mode 100644 index 00000000..b1ff63e6 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vrrp/tests/inventory.yaml @@ -0,0 +1,22 @@ +--- +spine1 ansible_host=10.11.182.25 ansible_network_os="dellemc.os10.os10" +spine2 ansible_host=10.16.151.220 ansible_network_os="dellemc.os10.os10" + +leaf1 ansible_host=10.11.182.23 ansible_network_os="dellemc.os10.os10" +leaf2 ansible_host=10.11.182.16 ansible_network_os="dellemc.os10.os10" +leaf3 ansible_host=10.11.182.17 ansible_network_os="dellemc.os10.os10" +leaf4 ansible_host=10.16.148.79 ansible_network_os="dellemc.os10.os10" + +[spine] +spine1 +spine2 + +[leaf] +leaf1 +leaf2 +leaf3 +leaf4 + +[datacenter:children] +spine +leaf diff --git a/ansible_collections/dellemc/os10/roles/os10_vrrp/tests/main.os10.yaml b/ansible_collections/dellemc/os10/roles/os10_vrrp/tests/main.os10.yaml new file mode 100644 index 00000000..97475170 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vrrp/tests/main.os10.yaml @@ -0,0 +1,45 @@ +--- +# vars file for dellemc.os10.os10_vrrp, +# below gives a example configuration +# Sample variables for OS10 device +os10_vrrp: + vrrp: + delay_reload: 2 + version: 3 + ethernet1/1/1: + vrrp_group: + - group_id: 2 + type: ipv6 + priority: 120 + preempt: false + track_interface: + - resource_id: 3 + priority_cost: 25 + state: present + virtual_address: + - ip: 2001:4828:5808:ffa3::9 + state: present + - ip: 3001:4828:5808:ffa3::9 + state: present + - ip: 4001:4828:5808:ffa3::9 + state: absent + adv_interval_centisecs: 200 + state: present + - group_id: 4 + virtual_address: + - ip: 4.1.1.1 + state: present + - ip: 4.1.1.2 + state: present + - ip: 4.1.1.3 + state: absent + priority: 120 + preempt: false + track_interface: + - resource_id: 3 + priority_cost: 25 + state: present + adv_interval_centisecs: 200 + state: present + vlan100: + vrrp_active_active_mode: true diff --git a/ansible_collections/dellemc/os10/roles/os10_vrrp/tests/test.yaml b/ansible_collections/dellemc/os10/roles/os10_vrrp/tests/test.yaml new file mode 100644 index 00000000..2ed5ab8e --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vrrp/tests/test.yaml @@ -0,0 +1,5 @@ +--- +- hosts: datacenter + connection: network_cli + roles: + - dellemc.os10.os10_vrrp diff --git a/ansible_collections/dellemc/os10/roles/os10_vrrp/vars/main.yml b/ansible_collections/dellemc/os10/roles/os10_vrrp/vars/main.yml new file mode 100644 index 00000000..aa78d677 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vrrp/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for dellemc.os10.os10_vrrp diff --git a/ansible_collections/dellemc/os10/roles/os10_vxlan/LICENSE b/ansible_collections/dellemc/os10/roles/os10_vxlan/LICENSE new file mode 100644 index 00000000..2c9b8e1f --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vxlan/LICENSE @@ -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) 2020, Dell Inc. All rights reserved. + + 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) 2020, Dell Inc. All rights reserved. + 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>. diff --git a/ansible_collections/dellemc/os10/roles/os10_vxlan/README.md b/ansible_collections/dellemc/os10/roles/os10_vxlan/README.md new file mode 100644 index 00000000..09b23bb3 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vxlan/README.md @@ -0,0 +1,259 @@ +VxLAN role +======== + +This role facilitates the configuration of virtual extensible LAN (VxLAN) attributes. It supports the configuration of virtual networks, Ethernet virtual private network (EVPN), and network virtualization edge (NVE). This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. + +The VxLAN role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. + +Role variables +-------------- + +- Role is abstracted using the `ansible_network_os` variable that can take `dellemc.os10.os10` as the value +- If `os10_cfg_generate` is set to true, it generates the role configuration commands in a file +- Any role variable with a corresponding state variable setting to absent negates the configuration of that variable +- Setting an empty value for any variable negates the corresponding configuration +- Variables and values are case-sensitive + +**os10_vxlan keys** + +| Key | Type | Description | Support | +|------------|---------------------------|---------------------------------------------------------|-----------------------| +| ``anycast_gateway_mac`` | string | Configures an anycast gateway IP address for a VxLAN virtual network | os10 | +| ``loopback`` | dictionary | Configures the loopback interface (see ``loopback.*``) | os10 | +| ``loopback.loopback_id`` | integer | Configures the loopback interface number (0 to 16383) | os10 | +| ``loopback.description`` | string | Configures the interface description | os10 | +| ``loopback.ip_address`` | string | Configure the IP address | os10 | +| ``loopback.state`` | string: absent,present\* | Removes loopback interface if set to absent | os10 | +| ``nve`` | dictionary | Configures network virtualization edge (see ``nve.*``) | os10 | +| ``nve.source_interface`` | integer | Configures source loopback interface | os10 | +| ``nve.controller`` | dictionary | Configures controller; supports only one controller connection at a time (see ``controller.*``) | os10 | +| ``controller.name`` | string: NSX, ovsdb | Configures the NVE controller | os10 | +| ``controller.max_backoff`` | integer | Configures max_backoff value (setting an empty value negates the corresponding configuration) | os10 | +| ``controller.control_cfg`` | list | Configures the controller IP and port (see ``control_cfg.*``) | os10 | +| ``control_cfg.ip_addr`` | string | Configures the controller IP | os10 | +| ``control_cfg.port`` | integer | Configures the controller port | os10 | +| ``control_cfg.state`` | string: absent,present\* | Removes the controller IP and port configuration if set to absent | os10 | +| ``controller.state`` | string: absent,present\* | Removes the controller if set to absent | os10 | +| ``nve.state`` | string: absent,present\* | Removes the NVE if set to absent | os10 | +| ``evpn`` | dictionary | Enables EVPN in control plane (see ``evpn.*``) | os10 | +| ``evpn.autoevi`` | boolean: True, False | Configures auto-EVI; no further manual configuration is allowed in auto-EVI mode | os10 | +| ``evpn.rmac`` | string | Configures router MAC address | os10 | +| ``evpn.evi`` | list | Configures EVPN instance (see ``evi.*``)| os10 | +| ``evpn.dis_rt_asn`` | boolean | Enables/disables AS number usage in route target | os10 | +| ``evpn.vrf`` | dictionary | Enables VRF for EVPN| os10 | +| ``vrf.name`` | string | Configures VRF name | os10 | +| ``vrf.state`` | string(present,absent) | Configures/removes VRF for EVPN | os10 | +| ``vrf.vni`` | integer | Configures VNI for the VRF | os10 | +| ``vrf.rd`` | string | Configures RD for the VRF | os10 | +| ``vrf.route_target`` | dictionary | Enables route target for the VRF | os10 | +| ``route_target.type`` | string (manual, auto) | Configures the route target type | os10 | +| ``route_target.asn_value`` | string | Configure AS number | os10 | +| ``route_target.state`` | string (present,absent) | Configures/unconfigures the route target | os10 | +| ``route_target.route_target_type`` | string | Configures the route target type | os10 | +| ``vrf.adv_ipv4`` | dictionary | Enables IPv4 advertisement VRF | os10 | +| ``adv_ipv4.type`` | string | Configures IPv4 advertisement type | os10 | +| ``adv_ipv4.rmap_name`` | string | Configures route-map for advertisement | os10 | +| ``adv_ipv4.unconfig`` | boolean | Configures/unconfigures route-map for advertisement | os10 | +| ``evi.id`` | integer | Configures the EVPN instance ID (1 to 65535) | os10 | +| ``evi.rd`` | string | Configures the route distinguisher | os10 | +| ``evi.vni`` | dictionary | Configures VNI value (see ``vni.*``) | os10 | +| ``vni.id`` | integer | Configures VNI value; configure the same VNI value configured for the VxLAN virtual network | os10 | +| ``vni.state`` | string: absent,present\* | Removes the VNI if set to absent | os10 | +| ``evi.route_target`` | list | Configures route target (see ``route_target.*``) | os10 | +| ``route_target.type`` | string: manual,auto | Configures the route target (auto mode auto-configures an import and export value for EVPN routes) | os10 | +| ``route_target.asn_value`` | string | Configures the route target ASN value | os10 | +| ``route_target.route_target_type`` | string: import,export,both | Configures the route target type | os10 | +| ``route_target.state`` | string: absent,present\* | Removes the route target if set to absent | os10 | +| ``evi.state`` | string: absent,present\* | Removes EVPN instance ID if set to absent | os10 | +| ``evpn.state`` | string: absent,present\* | Removes the EVPN configuration if set to absent | os10 | +| ``virtual_network`` | dictionary | Configures the virtual network attributes (see ``virtual_network.*``) | os10 | +| ``virtual_network.untagged_vlan`` | integer | Configures the reserved untagged VLAN ID (1 to 4093) | os10 | +| ``virtual_network.virtual_net`` | list | Configures the virtual network attributes for VxLAN tunneling (see ``virtual_net.*``) | os10 | +| ``virtual_net.id`` | integer | Configures a virtual network ( virtual-network ID, from 1 to 65535) | os10 | +| ``virtual_net.description`` | string | Configures the description for virtual network | os10 | +| ``virtual_net.vlt_vlan_id`` | integer | Configures the VLTi VLAN ID | os10 | +| ``virtual_net.member_interface`` | list | Configures the trunk member interface attributes to the virtual network (see ``member_interface.*``) | os10 | +| ``member_interface.ifname`` | string | Configures interface name to provision the virtual network member interface | os10 | +| ``member_interface.type`` | string: tagged,untagged | Configures the type to provision the virtual network member interface | os10 | +| ``member_interface.vlanid`` | integer | Configures the VLAN ID to provision the virtual network member interface | os10 | +| ``member_interface.state`` | string: absent,present\* | Removes the virtual network member interface if set to absent | os10 | +| ``virtual_net.vxlan_vni`` | dictionary | Configures the VxLAN attributes to virtual network (see ``vxlan_vni.*``) | os10 | +| ``vxlan_vni.id`` | integer | Configures the VxLAN ID to a virtual network | os10 | +| ``vxlan_vni.remote_endpoint`` | list | Configures the IP address of a remote tunnel endpoint in a VxLAN network (see ``remote_endpoint.*``) | os10 | +| ``remote_endpoint.ip`` | string | Configures the IP address of a remote tunnel endpoint (1.1.1.1) | os10 | +| ``remote_endpoint.state`` | string: absent,present\* | Removes the remote tunnel endpoint in a VxLAN network if set to absent | os10 | +| ``vxlan_vni.state`` | string: absent,present\* | Removes the VxLAN ID if set to absent | os10 | +| ``virtual_net.state`` | string: absent,present\* | Removes a virtual network if set to absent | os10 | +| ``vlan_association`` | list | Configures the VLAN association with virtual network (see ``vlan_association.*``) | os10 | +| ``vlan_association.vlan_id`` | integer | Specifies the VLAN ID | os10 | +| ``vlan_association.virtual_net`` | integer | Specifies the virtual netwrok ID which is to be associated with VLAN | os10 | + + +> **NOTE**: Asterisk (\*) denotes the default value if none is specified. + +Connection variables +-------------------- + +Ansible Dell EMC network roles require connection information to establish communication with the nodes in your inventory. This information can exist in the Ansible *group_vars* or *host_vars* directories or inventory, or in the playbook itself. + +| Key | Required | Choices | Description | +|-------------|----------|------------|-----------------------------------------------------| +| ``ansible_host`` | yes | | Specifies the hostname or address for connecting to the remote device over the specified transport | +| ``ansible_port`` | no | | Specifies the port used to build the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_PORT` option is used; it defaults to 22 | +| ``ansible_ssh_user`` | no | | Specifies the username that authenticates the CLI login for the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_USER` environment variable value is used | +| ``ansible_ssh_pass`` | no | | Specifies the password that authenticates the connection to the remote device | +| ``ansible_become`` | no | yes, no\* | Instructs the module to enter privileged mode on the remote device before sending any commands; if value is unspecified, the `ANSIBLE_BECOME` environment variable value is used, and the device attempts to execute all commands in non-privileged mode | +| ``ansible_become_method`` | no | enable, sudo\* | Instructs the module to allow the become method to be specified for handling privilege escalation; if value is unspecified, the `ANSIBLE_BECOME_METHOD` environment variable value is used | +| ``ansible_become_pass`` | no | | Specifies the password to use if required to enter privileged mode on the remote device; if ``ansible_become`` is set to no this key is not applicable | +| ``ansible_network_os`` | yes | os10, null\* | Loads the correct terminal and cliconf plugins to communicate with the remote device | + +> **NOTE**: Asterisk (\*) denotes the default value if none is specified. + + +Example playbook +---------------- + +This example uses the *os10_vxlan* role to configure the VxLAN network, source IP address on VxLAN tunnel endpoint and virtual networks. It creates a *hosts* file with the switch details, a *host_vars* file with connection variables and the corresponding role variables. The hosts file should define the ansible_network_os variable with the corresponding Dell EMC OS10 name. + +When `os10_cfg_generate` is set to true, the variable generates the configuration commands as a .part file in *build_dir* path. By default, the variable is set to false. This example writes a simple playbook that only references the *os10_vxlan* role. + +**Sample hosts file** + + leaf1 ansible_host= <ip_address> + +**Sample host_vars/leaf1** + + hostname: leaf1 + ansible_become: yes + ansible_become_method: xxxxx + ansible_become_pass: xxxxx + ansible_ssh_user: xxxxx + ansible_ssh_pass: xxxxx + ansible_network_os: dellemc.os10.os10 + build_dir: ../temp/os10 + + os10_vxlan: + anycast_gateway_mac: "00:22:33:44:55:66" + loopback: + loopback_id: 10 + description: "HARDWARE_VXLAN" + ip_address: "10.8.0.1/32" + state: "present" + nve: + source_interface: 10 + controller: + name: "ovsdb" + max_backoff: 2000 + control_cfg: + - ip_addr: "1.2.3.4" + port: 30 + state: "present" + state: "present" + state: "present" + evpn: + autoevi: False + evi: + - id: 111 + rd: "auto" + vni: + id: 111 + state: "present" + route_target: + - type: "manual" + asn_value: "111:111" + route_target_type: "both" + state: "present" + - type: "manual" + asn_value: "11:11" + route_target_type: "export" + state: "present" + state: "present" + - id: 222 + rd: "2.2.2.2:222" + vni: + id: 222 + state: "present" + route_target: + - type: "auto" + asn_value: + route_target_type: + state: "present" + state: "present" + vrf: + - name: "test" + vni: 1000 + adv_ipv4: + - type: "connected" + state: "present" + - type: "bgp" + state: "present" + route_target: + - type: "manual" + asn_value: "65530:65534" + route_target_type: "both" + state: "present" + - name: "blue" + state: "absent" + rmac: 00:11:11:11:11:11 + dis_rt_asn: "true" + state: "present" + virtual_network: + untagged_vlan: 1001 + virtual_net: + - id: 111 + description: "NSX_Cluster_VNI_111" + vlt_vlan_id: 11 + member_interface: + - ifname: "ethernet 1/1/15" + type: "tagged" + vlanid: 15 + state: "present" + - ifname: "port-channel 12" + type: "tagged" + vlanid: 11 + state: "present" + vxlan_vni: + id: 111 + remote_endpoint: + - ip: "1.1.1.1" + state: "present" + - ip: "11.11.11.11" + state: "present" + - ip: "111.111.111.111" + state: "present" + state: "present" + state: "present" + - id: 222 + description: "NSX_Cluster_VNI_222" + vlt_vlan_id: 22 + member_interface: + - ifname: "ethernet 1/1/16" + type: "tagged" + vlanid: 16 + state: "present" + vxlan_vni: + id: 222 + remote_endpoint: + - ip: "2.2.2.2" + state: "present" + - ip: "22.22.22.22" + state: "present" + state: "present" + state: "present" + vlan_association: + - vlain_id: 111 + virtual_net: 111 + +> **NOTE**: Member interfaces should be in switchport trunk mode which can be configured using the *os10_interface* role. + +**Simple playbook to configure VxLAN — leaf.yaml** + + - hosts: leaf1 + roles: + - dellemc.os10.os10_vxlan + +**Run** + + ansible-playbook -i hosts leaf.yaml + +(c) 2017-2020 Dell Inc. or its subsidiaries. All rights reserved. diff --git a/ansible_collections/dellemc/os10/roles/os10_vxlan/defaults/main.yml b/ansible_collections/dellemc/os10/roles/os10_vxlan/defaults/main.yml new file mode 100644 index 00000000..adeae550 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vxlan/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for dellemc.os10.os10_vxlan diff --git a/ansible_collections/dellemc/os10/roles/os10_vxlan/handlers/main.yml b/ansible_collections/dellemc/os10/roles/os10_vxlan/handlers/main.yml new file mode 100644 index 00000000..a6b6bc57 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vxlan/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for dellemc.os10.os10_vxlan diff --git a/ansible_collections/dellemc/os10/roles/os10_vxlan/meta/main.yml b/ansible_collections/dellemc/os10/roles/os10_vxlan/meta/main.yml new file mode 100644 index 00000000..87908f3c --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vxlan/meta/main.yml @@ -0,0 +1,20 @@ +# Copyright (c) 2020 Dell Inc. or its subsidiaries. All Rights Reserved. +--- +galaxy_info: + role_name: os10_vxlan + author: Dell EMC Networking Engineering + description: > + The os10_vxlan role facilitates the configuration of nve evpn and virtual network attributes in devices + running Dell EMC SmartFabric OS10. + license: GPLv3 + min_ansible_version: 2.9.6 + + platforms: + - name: os10 + + galaxy_tags: + - networking + - dell + - emc + - dellemc + - os10 diff --git a/ansible_collections/dellemc/os10/roles/os10_vxlan/tasks/main.yml b/ansible_collections/dellemc/os10/roles/os10_vxlan/tasks/main.yml new file mode 100644 index 00000000..f90be2d7 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vxlan/tasks/main.yml @@ -0,0 +1,16 @@ +--- +# tasks file for os10 + - name: "Generating vxlan configuration for os10" + template: + src: os10_vxlan.j2 + dest: "{{ build_dir }}/vxlan10_{{ hostname }}.conf.part" + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") and ((os10_cfg_generate | default('False')) | bool) +# notify: save config os10 + register: generate_output + + - name: "Provisioning vxlan configuration for os10" + os10_config: + src: os10_vxlan.j2 + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") +# notify: save config os10 + register: output diff --git a/ansible_collections/dellemc/os10/roles/os10_vxlan/templates/os10_vxlan.j2 b/ansible_collections/dellemc/os10/roles/os10_vxlan/templates/os10_vxlan.j2 new file mode 100644 index 00000000..b56da068 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vxlan/templates/os10_vxlan.j2 @@ -0,0 +1,434 @@ +#jinja2: trim_blocks: True,lstrip_blocks: True +{############################################# +#Purpose: +Configure VXLAN commands for os10 Devices +os10_vxlan: + anycast_gateway_mac: "00:22:33:44:55:66" + loopback: + loopback_id: 10 + description: "HARDWARE_VXLAN" + ip_address: "10.8.0.1/32" + state: "present" + nve: + source_interface: 10 + controller: + name: "ovsdb" + max_backoff: 2000 + control_cfg: + - ip_addr: "1.2.3.4" + port: 30 + state: "present" + state: "present" + state: "present" + evpn: + autoevi: False + evi: + - id: 111 + rd: "auto" + vni: + id: 111 + state: "present" + route_target: + - type: "manual" + asn_value: "111:111" + route_target_type: "both" + state: "present" + - type: "manual" + asn_value: "11:11" + route_target_type: "export" + state: "present" + state: "present" + - id: 222 + rd: "2.2.2.2:222" + vni: + id: 222 + state: "present" + route_target: + - type: "auto" + asn_value: + route_target_type: + state: "present" + state: "present" + vrf: + - name: "test" + vni: 1000 + adv_ipv4: + - type: "connected" + state: "present" + - type: "bgp" + state: "present" + route_target: + - type: "manual" + asn_value: "65530:65534" + route_target_type: "both" + state: "present" + - name: "blue" + state: "absent" + rmac: 00:11:11:11:11:11 + dis_rt_asn: "true" + state: "present" + virtual_network: + untagged_vlan: 1001 + virtual_net: + - id: 111 + description: "NSX_Cluster_VNI_111" + vlt_vlan_id: 11 + member_interface: + - ifname: "ethernet 1/1/15" + type: "tagged" + vlanid: 15 + state: "present" + - ifname: "port-channel 12" + type: "tagged" + vlanid: 11 + state: "present" + vxlan_vni: + id: 111 + remote_endpoint: + - ip: "1.1.1.1" + state: "present" + - ip: "11.11.11.11" + state: "present" + - ip: "111.111.111.111" + state: "present" + state: "present" + state: "present" + - id: 222 + description: "NSX_Cluster_VNI_222" + vlt_vlan_id: 22 + member_interface: + - ifname: "ethernet 1/1/16" + type: "tagged" + vlanid: 16 + state: "present" + vxlan_vni: + id: 222 + remote_endpoint: + - ip: "2.2.2.2" + state: "present" + - ip: "22.22.22.22" + state: "present" + state: "present" + state: "present" + vlan_association: + - vlain_id: 111 + virtual_net: 111 +###############################################} +{% if os10_vxlan is defined and os10_vxlan %} + {% if os10_vxlan.anycast_gateway_mac is defined %} + {% if os10_vxlan.anycast_gateway_mac %} +ip virtual-router mac-address {{ os10_vxlan.anycast_gateway_mac }} + {% else %} +no ip virtual-router mac-address + {% endif %} + {% endif %} + {% if os10_vxlan.loopback is defined %} + {% set loopback = os10_vxlan.loopback %} + {% if loopback.state is defined and loopback.state == "absent" %} + {% if loopback.loopback_id is defined and loopback.loopback_id %} +no interface loopback {{ loopback.loopback_id }} + {% endif %} + {% else %} + {% if loopback.loopback_id is defined and loopback.loopback_id %} +interface loopback {{ loopback.loopback_id }} + {% endif %} + {% if loopback.description is defined %} + {% if loopback.description %} + description {{ loopback.description }} + {% else %} + no description {{ loopback.description }} + {% endif %} + {% endif %} + {% if loopback.ip_address is defined %} + {% if loopback.ip_address %} + ip address {{ loopback.ip_address }} + {% else %} + no ip address + {% endif %} + {% endif %} + {% endif %} + {% endif %} + + {% if os10_vxlan.nve is defined and os10_vxlan.nve %} + {% set nve = os10_vxlan.nve %} + {% if nve.state is defined and nve.state == "absent" %} +no nve + {% else %} +nve + {% if nve.source_interface is defined %} + {% if nve.source_interface >= 0 %} + source-interface loopback{{ nve.source_interface }} + {% else %} + no source-interface + {% endif %} + {% endif %} + {% if nve.controller is defined %} + {% set controller = os10_vxlan.nve.controller %} + {% if controller.state is defined and controller.state == "absent" %} + no controller + {% else %} + {% if controller.name is defined and controller.name %} + controller {{ controller.name }} + {% endif %} + {% if controller.max_backoff is defined %} + {% if controller.max_backoff %} + max-backoff {{ controller.max_backoff }} + {% else %} + no max-backoff + {% endif %} + {% endif %} + {% if controller.control_cfg is defined and controller.control_cfg %} + {% for ctrl_cfg in controller.control_cfg %} + {% if ctrl_cfg.ip_addr is defined and ctrl_cfg.ip_addr %} + {% if ctrl_cfg.port is defined and ctrl_cfg.port %} + {% if ctrl_cfg.state is defined and ctrl_cfg.state == "absent" %} + {% if controller.name == "ovsdb" %} + no ip {{ ctrl_cfg.ip_addr }} port {{ ctrl_cfg.port }} ssl + {% else %} + no ip {{ ctrl_cfg.ip_addr }} port {{ ctrl_cfg.port }} + {% endif %} + {% else %} + {% if controller.name == "ovsdb" %} + ip {{ ctrl_cfg.ip_addr }} port {{ ctrl_cfg.port }} ssl + {% else %} + ip {{ ctrl_cfg.ip_addr }} port {{ ctrl_cfg.port }} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + + {% if os10_vxlan.evpn is defined and os10_vxlan.evpn %} + {% set evpn = os10_vxlan.evpn %} + {% if evpn.state is defined and evpn.state == "absent" %} +no evpn + {% else %} +evpn + {% if evpn.rmac is defined %} + {% if evpn.rmac %} + router-mac {{ evpn.rmac }} + {% else %} + no router-mac + {% endif %} + {% endif %} + {% if evpn.dis_rt_asn is defined and evpn.dis_rt_asn == "true" %} + disable-rt-asn + {% else %} + no disable-rt-asn + {% endif %} + {% if evpn.evi is defined and evpn.evi %} + {% for evi in evpn.evi %} + {% if evi.id is defined and evi.id %} + {% if evi.state is defined and evi.state == "absent" %} + no evi {{ evi.id }} + {% else %} + evi {{ evi.id }} + {% if evi.vni is defined and evi.vni %} + {% if evi.vni.id is defined and evi.vni.id %} + {% if evi.vni.state is defined and evi.vni.state == "absent" %} + no vni {{ evi.vni.id }} + {% else %} + vni {{ evi.vni.id }} + {% endif %} + {% endif %} + {% endif %} + {% if evi.rd is defined %} + {% if evi.rd %} + rd {{ evi.rd }} + {% else %} + no rd + {% endif %} + {% endif %} + {% if evi.route_target is defined and evi.route_target %} + {% for rt in evi.route_target %} + {% if rt.type is defined and rt.type == "manual" %} + {% if rt.asn_value is defined and rt.asn_value %} + {% if rt.state is defined and rt.state == "absent" %} + no route-target {{ rt.asn_value }} + {% else %} + {% if rt.route_target_type is defined and rt.route_target_type %} + route-target {{ rt.asn_value }} {{ rt.route_target_type }} + {% endif %} + {% endif %} + {% endif %} + {% elif rt.type is defined and rt.type == "auto" %} + {% if rt.state is defined and rt.state == "absent" %} + no route-target auto + {% else %} + route-target auto + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% if evpn.vrf is defined %} + {% for evpn_vrf in evpn.vrf %} + {% if evpn_vrf.state is defined and evpn_vrf.state == "absent" and evpn_vrf.name %} + no vrf {{ evpn_vrf.name }} + {% elif evpn_vrf.name %} + vrf {{ evpn_vrf.name }} + {% if evpn_vrf.vni is defined %} + {% if evpn_vrf.vni %} + vni {{ evpn_vrf.vni }} + {% else %} + no vni + {% endif %} + {% endif %} + {% if evpn_vrf.rd is defined %} + {% if evpn_vrf.rd %} + rd {{ evpn_vrf.rd }} + {% else %} + no rd + {% endif %} + {% endif %} + {% if evpn_vrf.route_target is defined and evpn_vrf.route_target %} + {% for rt in evpn_vrf.route_target %} + {% if rt.type is defined and rt.type == "manual" %} + {% if rt.asn_value is defined and rt.asn_value %} + {% if rt.state is defined and rt.state == "absent" %} + no route-target {{ rt.asn_value }} + {% else %} + {% if rt.route_target_type is defined and rt.route_target_type %} + route-target {{ rt.asn_value }} {{ rt.route_target_type }} + {% endif %} + {% endif %} + {% endif %} + {% elif rt.type is defined and rt.type == "auto" %} + {% if rt.state is defined and rt.state == "absent" %} + no route-target auto + {% else %} + route-target auto + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% if evpn_vrf.adv_ipv4 is defined and evpn_vrf.adv_ipv4 %} + {% for rt in evpn_vrf.adv_ipv4 %} + {% if rt.unconfig is defined and rt.unconfig == "true" and rt.type is defined and rt.rmap_name is defined %} + no advertise ipv4 {{ rt.type }} route-map {{ rt.rmap_name }} + {% elif rt.type is defined and rt.rmap_name is defined %} + advertise ipv4 {{ rt.type }} route-map {{ rt.rmap_name }} + {% elif rt.unconfig is defined and rt.unconfig == "true" and rt.type is defined %} + no advertise ipv4 {{ rt.type }} + {% elif rt.type is defined %} + advertise ipv4 {{ rt.type }} + {% endif %} + {% endfor %} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + + {% if evpn.autoevi is defined %} + {% if evpn.autoevi == True %} + auto-evi + {% else %} + no auto-evi + {% endif %} + {% endif %} + {% endif %} + {% endif %} + + {% if os10_vxlan.virtual_network is defined and os10_vxlan.virtual_network %} + {% set vir_net = os10_vxlan.virtual_network %} + {% if vir_net.untagged_vlan is defined %} + {% if vir_net.untagged_vlan %} +virtual-network untagged-vlan {{ vir_net.untagged_vlan }} + {% else %} +no virtual-network untagged-vlan + {% endif %} + {% endif %} + {% if vir_net.virtual_net is defined and vir_net.virtual_net %} + {% for v_net in vir_net.virtual_net %} + {% if v_net.id is defined and v_net.id %} + {% if v_net.state is defined and v_net.state == "absent" %} +no interface virtual-network {{ v_net.id }} +no virtual-network {{ v_net.id }} + {% else %} +virtual-network {{ v_net.id }} + {% if v_net.description is defined %} + {% if v_net.description %} + description {{ v_net.description }} + {% else %} + no description + {% endif %} + {% endif %} + {% if v_net.vlt_vlan_id is defined %} + {% if v_net.vlt_vlan_id %} + vlti-vlan {{ v_net.vlt_vlan_id }} + {% else %} + no vlti-vlan + {% endif %} + {% endif %} + {% if v_net.member_interface is defined and v_net.member_interface %} + {% for member_intf in v_net.member_interface %} + {% if member_intf.ifname is defined and member_intf.ifname %} + {% if member_intf.type is defined %} + {% if member_intf.type == "tagged" %} + {% if member_intf.vlanid is defined and member_intf.vlanid %} + {% if member_intf.state is defined and member_intf.state == "absent" %} + no member-interface {{ member_intf.ifname }} vlan-tag {{ member_intf.vlanid }} + {% else %} + member-interface {{ member_intf.ifname }} vlan-tag {{ member_intf.vlanid }} + {% endif %} + {% endif %} + {% elif member_intf.type == "untagged" %} + {% if member_intf.state is defined and member_intf.state == "absent" %} + no member-interface {{ member_intf.ifname }} untagged + {% else %} + member-interface {{ member_intf.ifname }} untagged + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% if v_net.vxlan_vni is defined and v_net.vxlan_vni %} + {% set vxlan_vni = v_net.vxlan_vni %} + {% if vxlan_vni.id is defined and vxlan_vni.id %} + {% if vxlan_vni.state is defined and vxlan_vni.state == "absent" %} + no vxlan-vni {{ vxlan_vni.id }} + {% else %} + vxlan-vni {{ vxlan_vni.id }} + {% if vxlan_vni.remote_endpoint is defined and vxlan_vni.remote_endpoint %} + {% for remote_endpt in vxlan_vni.remote_endpoint %} + {% if remote_endpt.ip is defined and remote_endpt.ip %} + {% if remote_endpt.state is defined and remote_endpt.state == "absent" %} + no remote-vtep {{ remote_endpt.ip }} + {% else %} + remote-vtep {{ remote_endpt.ip }} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% endif %} + {% if os10_vxlan.vlan_association is defined and os10_vxlan.vlan_association %} + {% for vlan in os10_vxlan.vlan_association %} + {% if vlan.vlan_id is defined and vlan.vlan_id %} +interface vlan{{ vlan.vlan_id }} + {% if vlan.virtual_net is defined %} + {% if vlan.virtual_net %} + virtual-network {{ vlan.virtual_net }} + {% else %} + no virtual-network + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} +{% endif %} diff --git a/ansible_collections/dellemc/os10/roles/os10_vxlan/tests/inventory.yaml b/ansible_collections/dellemc/os10/roles/os10_vxlan/tests/inventory.yaml new file mode 100644 index 00000000..b1ff63e6 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vxlan/tests/inventory.yaml @@ -0,0 +1,22 @@ +--- +spine1 ansible_host=10.11.182.25 ansible_network_os="dellemc.os10.os10" +spine2 ansible_host=10.16.151.220 ansible_network_os="dellemc.os10.os10" + +leaf1 ansible_host=10.11.182.23 ansible_network_os="dellemc.os10.os10" +leaf2 ansible_host=10.11.182.16 ansible_network_os="dellemc.os10.os10" +leaf3 ansible_host=10.11.182.17 ansible_network_os="dellemc.os10.os10" +leaf4 ansible_host=10.16.148.79 ansible_network_os="dellemc.os10.os10" + +[spine] +spine1 +spine2 + +[leaf] +leaf1 +leaf2 +leaf3 +leaf4 + +[datacenter:children] +spine +leaf diff --git a/ansible_collections/dellemc/os10/roles/os10_vxlan/tests/main.yaml b/ansible_collections/dellemc/os10/roles/os10_vxlan/tests/main.yaml new file mode 100644 index 00000000..d326e635 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vxlan/tests/main.yaml @@ -0,0 +1,112 @@ +--- +os10_vxlan: + anycast_gateway_mac: "00:22:33:44:55:66" + loopback: + loopback_id: 10 + description: "HARDWARE_VXLAN" + ip_address: "10.8.0.1/32" + state: "present" + nve: + source_interface: 10 + controller: + name: "ovsdb" + max_backoff: 2000 + control_cfg: + - ip_addr: "1.2.3.4" + port: 30 + state: "present" + state: "present" + state: "present" + evpn: + autoevi: False + evi: + - id: 111 + rd: "auto" + vni: + id: 111 + state: "present" + route_target: + - type: "manual" + asn_value: "111:111" + route_target_type: "both" + state: "present" + - type: "manual" + asn_value: "11:11" + route_target_type: "export" + state: "present" + state: "present" + - id: 222 + rd: "2.2.2.2:222" + vni: + id: 222 + state: "present" + route_target: + - type: "auto" + asn_value: + route_target_type: + state: "present" + state: "present" + vrf: + - name: "test" + vni: 1000 + adv_ipv4: + - type: "connected" + state: "present" + - type: "bgp" + state: "present" + route_target: + - type: "manual" + asn_value: "65530:65534" + route_target_type: "both" + state: "present" + - name: "blue" + state: "absent" + rmac: 00:11:11:11:11:11 + dis_rt_asn: "true" + state: "present" + virtual_network: + untagged_vlan: 1001 + virtual_net: + - id: 111 + description: "NSX_Cluster_VNI_111" + vlt_vlan_id: 11 + member_interface: + - ifname: "ethernet 1/1/15" + type: "tagged" + vlanid: 15 + state: "present" + - ifname: "port-channel 12" + type: "tagged" + vlanid: 11 + state: "present" + vxlan_vni: + id: 111 + remote_endpoint: + - ip: "1.1.1.1" + state: "present" + - ip: "11.11.11.11" + state: "present" + - ip: "111.111.111.111" + state: "present" + state: "present" + state: "present" + - id: 222 + description: "NSX_Cluster_VNI_222" + vlt_vlan_id: 22 + member_interface: + - ifname: "ethernet 1/1/16" + type: "tagged" + vlanid: 16 + state: "present" + vxlan_vni: + id: 222 + remote_endpoint: + - ip: "2.2.2.2" + state: "present" + - ip: "22.22.22.22" + state: "present" + state: "present" + state: "present" + vlan_association: + - vlain_id: 111 + virtual_net: 111 diff --git a/ansible_collections/dellemc/os10/roles/os10_vxlan/tests/test.yml b/ansible_collections/dellemc/os10/roles/os10_vxlan/tests/test.yml new file mode 100644 index 00000000..f5e4a6c1 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vxlan/tests/test.yml @@ -0,0 +1,5 @@ +--- +- hosts: os10host + connection: network_cli + roles: + - dellemc.os10.os10_vxlan diff --git a/ansible_collections/dellemc/os10/roles/os10_vxlan/vars/main.yml b/ansible_collections/dellemc/os10/roles/os10_vxlan/vars/main.yml new file mode 100644 index 00000000..0373f0aa --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_vxlan/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for dellemc.os10.os10_vxlan diff --git a/ansible_collections/dellemc/os10/roles/os10_xstp/LICENSE b/ansible_collections/dellemc/os10/roles/os10_xstp/LICENSE new file mode 100644 index 00000000..2c9b8e1f --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_xstp/LICENSE @@ -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) 2020, Dell Inc. All rights reserved. + + 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) 2020, Dell Inc. All rights reserved. + 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>. diff --git a/ansible_collections/dellemc/os10/roles/os10_xstp/README.md b/ansible_collections/dellemc/os10/roles/os10_xstp/README.md new file mode 100644 index 00000000..0dd919b2 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_xstp/README.md @@ -0,0 +1,196 @@ +# xSTP role + +This role facilitates the configuration of xSTP attributes. It supports multiple version of spanning-tree protocol (STP), rapid spanning-tree (RSTP), rapid per-VLAN spanning-tree (Rapid PVST+), multiple spanning-tree (MST), and per-VLAN spanning-tree (PVST). It supports the configuration of bridge priority, enabling and disabling spanning-tree, creating and deleting instances, and mapping virtual LAN (VLAN) to instances. This role is abstracted for Dell EMC PowerSwitch platforms running Dell EMC SmartFabric OS10. + +The xSTP role requires an SSH connection for connectivity to a Dell EMC SmartFabric OS10 device. You can use any of the built-in OS connection variables. + +Role variables +-------------- + +- Role is abstracted using the `ansible_network_os` variable that can take `dellemc.os10.os10` as the value +- If `os10_cfg_generate` is set to true, the variable generates the role configuration commands in a file +- `os10_xstp` (dictionary) contains the hostname (dictionary) +- Hostname is the value of the *hostname* variable that corresponds to the name of the device +- Any role variable with a corresponding state variable set to absent negates the configuration of that variable +- Setting an empty value to any variable negates the corresponding configuration +- Variables and values are case-sensitive + +**hostname keys** + +| Key | Type | Description | Support | +|------------|---------------------------|---------------------------------------------------------|----------------------| +| ``type`` | string (required) | Configures the type of spanning-tree mode specified that can vary according to the device including RSTP, rapid-PVST, and MST | os10 | +| ``enable`` | boolean: true,false | Enables/disables the spanning-tree protocol specified in the type variable | os10 | +| ``mac_flush_timer`` | integer | Configures the mac_flush_timer value (0 to 500) | os10 | +| ``rstp`` | dictionary | Configures rapid spanning-tree (see ``rstp.*``) | os10 | +| ``rstp.bridge_priority`` | integer | Configures bridge-priority for the spanning-tree (0 to 61440 in multiples of 4096) | os10 | +| ``rstp.max_age`` | integer | Configures the max_age timer for RSTP (6 to 40) | os10 | +| ``rstp.hello_time`` | integer | Configures the hello-time for RSTP (1 to 10) | os10 | +| ``rstp.forward_time`` | integer | Configures the forward-time for RSTP (4 to 30) | os10 | +| ``rstp.force_version`` | string: stp | Configures the force version for the BPDUs transmitted by RSTP | os10 | +| ``rstp.mac_flush_threshold`` | integer | Configures the MAC flush threshold for RSTP (1 to 65535) | os10 | +| ``pvst`` | dictionary | Configures per-VLAN spanning-tree protocol (see ``pvst.*``) | os10 | +| ``pvst.vlan`` | list | Configures the VLAN for PVST (see ``vlan.*``) | os10 | +| ``vlan.range_or_id`` | string | Configures a VLAN/range of VLANs for the per-VLAN spanning-tree protocol | os10 | +| ``vlan.max_age`` | integer | Configures the max_age timer for a VLAN (6 to 40) | os10 | +| ``vlan.hello_time`` | integer | Configures the hello-time for a VLAN (1 to 10) | os10 | +| ``vlan.forward_time`` | integer | Configures the forward-time for a VLAN (4 to 30) | os10 | +| ``vlan.enable`` | boolean: true,false | Enables/disables spanning-tree for the associated VLAN range_or_id | os10 | +| ``vlan.mac_flush_threshold`` | integer | Configures the MAC flush threshold for a VLAN (1 to 65535) | os10 | +| ``vlan.root`` | string: primary,secondary | Designates the primary or secondary root for the associated VLAN range_or_id; mutually exclusive with *vlan.bridge_priority* | os10 | +| ``vlan.bridge_priority`` | integer | Configures bridge-priority for the per-VLAN spanning-tree (0 to 61440 in multiples of 4096); mutually exclusive with *vlan.root* | os10 | +| ``mstp`` | dictionary | Configures multiple spanning-tree protocol (see ``mstp.*``) | os10 | +| ``mstp.max_age`` | integer | Configures the max_age timer for MSTP (6 to 40) | os10 | +| ``mstp.max_hops`` | integer | Configures the max-hops for MSTP (6 to 40) | os10 | +| ``mstp.hello_time`` | integer | Configures the hello-time for MSTP (1 to 10) | os10 | +| ``mstp.forward_time`` | integer | Configures the forward-time for MSTP (4 to 30) | os10 | +| ``mstp.force_version`` | string: stp,rstp | Configures the force-version for the BPDUs transmitted by MSTP | os10 | +| ``mstp.mstp_instances`` | list | Configures a MSTP instance (see ``mstp_instances.*``) | os10 | +| ``mstp_instances.number_or_range`` | integer | Configures the multiple spanning-tree instance number| os10 | +| ``mstp_instances.bridge_priority`` | integer | Configures the bridge-priority for the spanning-tree (0 to 61440 in multiples of 4096); mutually exclusive with *mstp_instances.root* | os10 | +| ``mstp_instances.enable`` | boolean: true,false | Enables/disables spanning-tree for the associated MSTP instance | os10 | +| ``mstp_instances.mac_flush_threshold`` | integer | Configures the MAC flush-threshold for an MSTP instance (1 to 65535) | os10 | +| ``mstp_instances.root`` | string: primary,secondary | Designates the primary or secondary root for the associated MSTP instance; mutually exclusive with *mstp_instances.bridge_priority* | os10 | +| ``mstp.mst_config`` | dictionary | Configures multiple spanning-tree (see ``mstp.mst_config.*``); supported | os10 | +| ``mst_config.name`` | string | Configures the name which is specified for the MSTP | os10 | +| ``mst_config.revision`` | integer | Configures the revision number for MSTP | os10 | +| ``mst_config.cfg_list`` | list | Configures the multiple spanning-tree list (see ``mst_config.cfg_list.*``) | os10 | +| ``cfg_list.number`` | integer | Specifies the MSTP instance number | os10 | +| ``cfg_list.vlans`` | string | Configures a VLAN/range of VLANs by mapping it to an instance number | os10 | +| ``cfg_list.vlans_state`` | string: absent,present\* | Deletes a set of VLANs mapped to the spanning-tree instance if set to absent | os10 | +| ``intf`` | list | Configures multiple spanning-tree in an interface (see ``intf.*``) | os10 | +| ``intf <interface name>``| dictionary | Configures the interface name (see ``intf.<interface name>.*``) | os10 | +| ``intf.<interface name>.edge_port`` | boolean: true,false | Configures the EdgePort as dynamic if set to true | os10 | +| ``intf.<interface name>.bpdu_filter``| boolean: true,false | Enables/disables bpdufilter at the interface | os10 | +| ``intf.<interface name>.bpdu_guard``| boolean: true,false | Enables/disables bpduguard at the interface | os10 | +| ``intf.<interface name>.guard``| string: loop,root,none | Configures guard on the interface | os10 | +| ``intf.<interface name>.enable`` | boolean: true,false | Enables/disables spanning-tree at the interface level | os10 | +| ``intf.<interface name>.link_type``| string: auto,point-to-point,shared | Configures the link type at the interface | os10 | +| ``intf.<interface name>.rstp`` | dictionary | Configures the RSTP interface name (see ``intf.<interface name>.rstp.*``) | os10 | +| ``rstp.priority``| integer | Configures the RSTP priority value at the interface | os10 | +| ``rstp.cost`` | integer | Configures the RSTP cost value at the interface | os10 | +| ``intf.<interface name>.msti`` | list | Configures the MSTi interface name (see ``intf.<interface name>.msti``) | os10 | +| ``msti.instance_number`` | integer or range | Specifies the MSTP instance number or range | os10 | +| ``msti.priority`` | integer | Specifies the priority value to be configured at the interface | os10 | +| ``msti.cost`` | integer | Specifies the cost value to be configured at the interface | os10 | +| ``intf.<interface name>.vlan`` | list | Configures the VLAN interface name (see ``intf.<interface name>.vlan``) | os10 | +| ``vlan.range_or_id`` | integer or range | Specifies the VLAN ID or range | os10 | +| ``vlan.priority`` | integer | Specifies the priority value to be configured at the interface | os10 | +| ``vlan.cost`` | integer | Specifies the cost value to be configured at the interface | os10 | + +> **NOTE**: Asterisk (_*_) denotes the default value if none is specified. + +Connection variables +-------------------- + +Ansible Dell EMC network roles require connection information to establish communication with the nodes in your inventory. This information can exist in the Ansible *group_vars* or *host_vars* directories or inventory or in the playbook itself. + +| Key | Required | Choices | Description | +|-------------|----------|------------|-------------------------------------------------------| +| ``ansible_host`` | yes | | Specifies the hostname or address for connecting to the remote device over the specified transport | +| ``ansible_port`` | no | | Specifies the port used to build the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_PORT` option is used; it defaults to 22 | +| ``ansible_ssh_user`` | no | | Specifies the username that authenticates the CLI login for the connection to the remote device; if value is unspecified, the `ANSIBLE_REMOTE_USER` environment variable value is used | +| ``ansible_ssh_pass`` | no | | Specifies the password that authenticates the connection to the remote device | +| ``ansible_become`` | no | yes, no\* | Instructs the module to enter privileged mode on the remote device before sending any commands; if value is unspecified, the `ANSIBLE_BECOM`E environment variable value is used, and the device attempts to execute all commands in non-privileged mode | +| ``ansible_become_method`` | no | enable, sudo\* | Instructs the module to allow the become method to be specified for handling privilege escalation; if value is unspecified, the `ANSIBLE_BECOME_METHOD` environment variable value is used | +| ``ansible_become_pass`` | no | | Specifies the password to use if required to enter privileged mode on the remote device; if ``ansible_become`` is set to no this key is not applicable | +| ``ansible_network_os`` | yes | os10, null\* | Loads the correct terminal and cliconf plugins to communicate with the remote device | + +> **NOTE**: Asterisk (\*) denotes the default value if none is specified. + + +Example playbook +---------------- + +This example uses the *os10_xstp* role to configure different variants of spanning-tree. Based on the type of STP and defined objects, VLANs are associated and bridge priorities are assigned. It creates a *hosts* file with the switch details, and a *host_vars* file with connection variables. The corresponding role variables are defined in the *vars/main.yml* file at the role path. + +It writes a simple playbook that only references the *os10_xstp* role. By including the role, you automatically get access to all of the tasks to configure xSTP. + +**Sample hosts file** + + spine1 ansible_host= <ip_address> + +**Sample host_vars/spine1** + + hostname: spine1 + ansible_become: yes + ansible_become_method: xxxxx + ansible_become_pass: xxxxx + ansible_ssh_user: xxxxx + ansible_ssh_pass: xxxxx + ansible_network_os: dellemc.os10.os10 + build_dir: ../temp/temp_os10 + +**Sample vars/main.yml** + + os10_xstp: + type: rstp + enable: true + path_cost: true + mac_flush_timer: 4 + rstp: + max_age: 6 + hello_time: 7 + forward_time: 7 + force_version: stp + bridge_priority: 4096 + mac_flush_threshold: 5 + pvst: + vlan: + - range_or_id: 10 + max_age: 6 + enable: true + hello_time: 7 + forward_time: 7 + bridge_priority: 4096 + mac_flush_threshold: 9 + mstp: + max_age: 6 + max_hops: 6 + hello_time: 7 + forward_time: 7 + force_version: stp + mstp_instances: + - number_or_range: 1 + enable: true + mac_flush_threshold: 9 + bridge_priority: 4096 + mst_config: + name: cfg1 + revision: 5 + cfg_list: + - number: 1 + vlans: 10,12 + vlans_state: present + intf: + ethernet 1/1/8: + edge_port: true + bpdu_filter: true + bpdu_guard: true + guard: loop + enable: true + link_type: point-to-point + msti: + - instance_number: 1 + priority: 32 + cost: 1 + rstp: + priority: 32 + cost: 7 + vlan: + - range_or_id: 6 + priority: 16 + cost: 8 + + +**Simple playbook to setup system — spine.yml** + + - hosts: spine + roles: + - dellemc.os10.os10_xstp + +**Run** + + ansible-playbook -i hosts spine.yml + +(c) 2017-2020 Dell Inc. or its subsidiaries. All rights reserved. diff --git a/ansible_collections/dellemc/os10/roles/os10_xstp/defaults/main.yml b/ansible_collections/dellemc/os10/roles/os10_xstp/defaults/main.yml new file mode 100644 index 00000000..daaf0f8f --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_xstp/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for dellemc.os10.os10_xstp diff --git a/ansible_collections/dellemc/os10/roles/os10_xstp/handlers/main.yml b/ansible_collections/dellemc/os10/roles/os10_xstp/handlers/main.yml new file mode 100644 index 00000000..645522da --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_xstp/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for dellemc.os10.os10_xstp diff --git a/ansible_collections/dellemc/os10/roles/os10_xstp/meta/main.yml b/ansible_collections/dellemc/os10/roles/os10_xstp/meta/main.yml new file mode 100644 index 00000000..8a63b500 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_xstp/meta/main.yml @@ -0,0 +1,18 @@ +# Copyright (c) 2020 Dell Inc. +--- +galaxy_info: + author: Dell EMC Networking Engineering + description: The os10_xstp role facilitates the configuration of STP attributes in devices running Dell EMC SmartFabric OS10. + company: Dell Technologies + license: GPLv3 + min_ansible_version: 2.9.6 + + platforms: + - name: os10 + + galaxy_tags: + - networking + - dell + - dellemc + - emc + - os10 diff --git a/ansible_collections/dellemc/os10/roles/os10_xstp/tasks/main.yml b/ansible_collections/dellemc/os10/roles/os10_xstp/tasks/main.yml new file mode 100644 index 00000000..e14eb0f7 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_xstp/tasks/main.yml @@ -0,0 +1,16 @@ +--- +# tasks file for os10 + - name: "Generating xSTP configuration for os10" + template: + src: os10_xstp.j2 + dest: "{{ build_dir }}/xstp10_{{ hostname }}.conf.part" + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") and ((os10_cfg_generate | default('False')) | bool) +# notify: save config os10 + register: generate_output + + - name: "Provisioning xSTP configuration for os10" + os10_config: + src: os10_xstp.j2 + when: (ansible_network_os is defined and ansible_network_os == "dellemc.os10.os10") +# notify: save config os10 + register: output diff --git a/ansible_collections/dellemc/os10/roles/os10_xstp/templates/os10_xstp.j2 b/ansible_collections/dellemc/os10/roles/os10_xstp/templates/os10_xstp.j2 new file mode 100644 index 00000000..dc7456ba --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_xstp/templates/os10_xstp.j2 @@ -0,0 +1,398 @@ +#jinja2: trim_blocks: True, lstrip_blocks: True +{############################################### +PURPOSE: Configure xSTP commands for OS10 devices +os10_xstp: + type: rstp + enable: true + mac_flush_timer: 4 + rstp: + max_age: 6 + hello_time: 7 + forward_time: 7 + force_version: stp + bridge_priority: 4096 + mac_flush_threshold: 5 + pvst: + vlan: + - range_or_id: 10 + max_age: 6 + enable: true + hello_time: 7 + forward_time: 7 + bridge_priority: 4096 + mac_flush_threshold: 9 + mstp: + max_age: 6 + max_hops: 6 + hello_time: 7 + forward_time: 7 + force_version: stp + mstp_instances: + - number_or_range: 1 + enable: true + mac_flush_threshold: 9 + bridge_priority: 4096 + mst_config: + name: cfg1 + revision: 5 + cfg_list: + - number: 1 + vlans: 10,12 + vlans_state: present + intf: + ethernet 1/1/8: + edge_port: true + bpdu_filter: true + bpdu_guard: true + guard: loop + enable: true + link_type: point-to-point + msti: + - instance_number: 1 + priority: 32 + cost: 1 + rstp: + priority: 32 + cost: 7 + vlan: + - range_or_id: 6 + priority: 16 + cost: 8 +#################################################} +{% if os10_xstp is defined and os10_xstp %} +{% set xstp_vars = os10_xstp %} +{% if xstp_vars.type is defined %} + {% if xstp_vars.type %} +spanning-tree mode {{ xstp_vars.type }} + {% else %} +no spanning-tree mode r + {% endif %} +{% endif %} +{% if xstp_vars.enable is defined %} + {% if xstp_vars.enable %} +no spanning-tree disable + {% else %} +spanning-tree disable + {% endif %} +{% endif %} +{% if xstp_vars.mac_flush_timer is defined %} + {% if xstp_vars.mac_flush_timer == 0 or xstp_vars.mac_flush_timer %} +spanning-tree mac-flush-timer {{ xstp_vars.mac_flush_timer }} + {% else %} +no spanning-tree mac-flush-timer + {% endif %} +{% endif %} + +{% if xstp_vars.rstp is defined and xstp_vars.rstp %} + {% set val = xstp_vars.rstp %} + {% if val.bridge_priority is defined %} + {% if val.bridge_priority == 0 or val.bridge_priority %} +spanning-tree rstp priority {{ val.bridge_priority }} + {% else %} +no spanning-tree rstp priority + {% endif %} + {% endif %} + {% if val.forward_time is defined %} + {% if val.forward_time %} +spanning-tree rstp forward-time {{ val.forward_time }} + {% else %} +no spanning-tree rstp forward-time + {% endif %} + {% endif %} + {% if val.hello_time is defined %} + {% if val.hello_time %} +spanning-tree rstp hello-time {{ val.hello_time }} + {% else %} +no spanning-tree rstp hello-time + {% endif %} + {% endif %} + {% if val.max_age is defined %} + {% if val.max_age %} +spanning-tree rstp max-age {{ val.max_age }} + {% else %} +no spanning-tree rstp max-age + {% endif %} + {% endif %} + {% if val.mac_flush_threshold is defined %} + {% if val.mac_flush_threshold %} +spanning-tree rstp mac-flush-threshold {{ val.mac_flush_threshold }} + {% else %} +no spanning-tree rstp mac-flush-threshold + {% endif %} + {% endif %} + {% if val.force_version is defined %} + {% if val.force_version %} +spanning-tree rstp force-version {{ val.force_version }} + {% else %} +no spanning-tree rstp force-version + {% endif %} + {% endif %} +{% endif %} + +{% if xstp_vars.pvst is defined and xstp_vars.pvst %} + {% set val = xstp_vars.pvst %} + {% if val.vlan is defined and val.vlan %} + {% for vlan in val.vlan %} + {% if vlan.range_or_id is defined and vlan.range_or_id %} + {% if vlan.bridge_priority is defined %} + {% if vlan.bridge_priority == 0 or vlan.bridge_priority %} +spanning-tree vlan {{ vlan.range_or_id }} priority {{ vlan.bridge_priority }} + {% else %} +no spanning-tree vlan {{ vlan.range_or_id }} priority + {% endif %} + {% endif %} + {% if vlan.enable is defined %} + {% if vlan.enable %} +no spanning-tree vlan {{ vlan.range_or_id }} disable + {% else %} +spanning-tree vlan {{ vlan.range_or_id }} disable + {% endif %} + {% endif %} + + {% if vlan.forward_time is defined %} + {% if vlan.forward_time %} +spanning-tree vlan {{ vlan.range_or_id }} forward-time {{ vlan.forward_time }} + {% else %} +no spanning-tree vlan {{ vlan.range_or_id }} forward-time + {% endif %} + {% endif %} + {% if vlan.hello_time is defined %} + {% if vlan.hello_time %} +spanning-tree vlan {{ vlan.range_or_id }} hello-time {{ vlan.hello_time }} + {% else %} +no spanning-tree vlan {{ vlan.range_or_id }} hello-time + {% endif %} + {% endif %} + {% if vlan.max_age is defined %} + {% if vlan.max_age %} +spanning-tree vlan {{ vlan.range_or_id }} max-age {{ vlan.max_age }} + {% else %} +no spanning-tree vlan {{ vlan.range_or_id }} max-age + {% endif %} + {% endif %} + {% if vlan.mac_flush_threshold is defined %} + {% if vlan.mac_flush_threshold %} +spanning-tree vlan {{ vlan.range_or_id }} mac-flush-threshold {{ vlan.mac_flush_threshold }} + {% else %} +no spanning-tree vlan {{ vlan.range_or_id }} mac-flush-threshold + {% endif %} + {% endif %} + {% if vlan.root is defined %} + {% if vlan.root %} +spanning-tree vlan {{ vlan.range_or_id }} root {{ vlan.root }} + {% else %} +no spanning-tree vlan {{ vlan.range_or_id }} root p + {% endif %} + {% endif %} + + {% endif %} + {% endfor %} + {% endif %} +{% endif %} +{% if xstp_vars.mstp is defined and xstp_vars.mstp %} + {% set val = xstp_vars.mstp %} + {% if val.forward_time is defined %} + {% if val.forward_time %} +spanning-tree mst forward-time {{ val.forward_time }} + {% else %} +no spanning-tree mst forward-time + {% endif %} + {% endif %} + {% if val.hello_time is defined %} + {% if val.hello_time %} +spanning-tree mst hello-time {{ val.hello_time }} + {% else %} +no spanning-tree mst hello-time + {% endif %} + {% endif %} + {% if val.max_age is defined %} + {% if val.max_age %} +spanning-tree mst max-age {{ val.max_age }} + {% else %} +no spanning-tree mst max-age + {% endif %} + {% endif %} + {% if val.max_hops is defined %} + {% if val.max_hops %} +spanning-tree mst max-hops {{ val.max_hops }} + {% else %} +no spanning-tree mst max-hops + {% endif %} + {% endif %} + {% if val.force_version is defined %} + {% if val.force_version %} +spanning-tree mst force-version {{ val.force_version }} + {% else %} +no spanning-tree mst force-version + {% endif %} + {% endif %} + + {% if val.mstp_instances is defined and val.mstp_instances %} + {% for instance in val.mstp_instances %} + {% if instance.number_or_range is defined and instance.number_or_range %} + {% if instance.bridge_priority is defined %} + {% if instance.bridge_priority ==0 or instance.bridge_priority %} +spanning-tree mst {{ instance.number_or_range }} priority {{ instance.bridge_priority }} + {% else %} +no spanning-tree mst {{ instance.number_or_range }} priority + {% endif %} + {% endif %} + {% if instance.enable is defined %} + {% if instance.enable %} +no spanning-tree mst {{ instance.number_or_range }} disable + {% else %} +spanning-tree mst {{ instance.number_or_range }} disable + {% endif %} + {% endif %} + {% if instance.mac_flush_threshold is defined %} + {% if instance.mac_flush_threshold %} +spanning-tree mst {{ instance.number_or_range }} mac-flush-threshold {{ instance.mac_flush_threshold }} + {% else %} +no spanning-tree mst {{ instance.number_or_range }} mac-flush-threshold + {% endif %} + {% endif %} + {% if instance.root is defined %} + {% if instance.root %} +spanning-tree mst {{ instance.number_or_range }} root {{ instance.root }} + {% else %} +no spanning-tree mst {{ instance.number_or_range }} root p + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% if val.mst_config is defined and val.mst_config %} +spanning-tree mst configuration + {% if val.mst_config.name is defined %} + {% if val.mst_config.name %} + name {{ val.mst_config.name }} + {% else %} + no name + {% endif %} + {% endif %} + {% if val.mst_config.revision is defined %} + {% if val.mst_config.revision %} + revision {{ val.mst_config.revision }} + {% else %} + no revision + {% endif %} + {% endif %} + {% for instance in val.mst_config.cfg_list %} + {% if instance.number is defined and instance.number %} + {% if instance.vlans is defined and instance.vlans %} + {% if instance.vlans_state is defined and instance.vlans_state == "absent" %} + no instance {{ instance.number }} vlan {{ instance.vlans }} + {% else %} + instance {{ instance.number }} vlan {{ instance.vlans }} + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} +{% endif %} +{% if xstp_vars.intf is defined and xstp_vars.intf %} + {% for intr in xstp_vars.intf.keys() %} + {% set intf_vars = xstp_vars.intf[intr] %} +interface {{ intr }} + {% if intf_vars.edge_port is defined %} + {% if not intf_vars.edge_port %} + no spanning-tree port type edge + {% else %} + spanning-tree port type edge + {% endif %} + {% endif %} + {% if intf_vars.bpdu_filter is defined %} + {% if intf_vars.bpdu_filter %} + spanning-tree bpdufilter enable + {% else %} + spanning-tree bpdufilter disable + {% endif %} + {% endif %} + {% if intf_vars.bpdu_guard is defined %} + {% if intf_vars.bpdu_guard %} + spanning-tree bpduguard enable + {% else %} + spanning-tree bpduguard disable + {% endif %} + {% endif %} + {% if intf_vars.guard is defined %} + {% if intf_vars.guard %} + spanning-tree guard {{ intf_vars.guard }} + {% else %} + spanning-tree guard none + {% endif %} + {% endif %} + {% if intf_vars.enable is defined %} + {% if intf_vars.enable %} + no spanning-tree disable + {% else %} + spanning-tree disable + {% endif %} + {% endif %} + {% if intf_vars.link_type is defined %} + {% if intf_vars.link_type %} + spanning-tree link-type {{ intf_vars.link_type }} + {% else %} + no spanning-tree link-type + {% endif %} + {% endif %} + {% if intf_vars.rstp is defined and intf_vars.rstp %} + {% if intf_vars.rstp.priority is defined %} + {% if intf_vars.rstp.priority %} + spanning-tree rstp priority {{ intf_vars.rstp.priority }} + {% else %} + no spanning-tree rstp priority + {% endif %} + {% endif %} + {% if intf_vars.rstp.cost is defined %} + {% if intf_vars.rstp.cost %} + spanning-tree rstp cost {{ intf_vars.rstp.cost }} + {% else %} + no spanning-tree rstp cost + {% endif %} + {% endif %} + {% endif %} + {% if intf_vars.msti is defined and intf_vars.msti %} + {% for inst in intf_vars.msti %} + {% if inst.instance_number is defined and inst.instance_number==0 or inst.instance_number %} + {% if inst.priority is defined %} + {% if inst.priority %} + spanning-tree msti {{ inst.instance_number }} priority {{ inst.priority }} + {% else %} + no spanning-tree msti {{ inst.instance_number }} priority 1 + {% endif %} + {% endif %} + {% if inst.cost is defined %} + {% if inst.cost %} + spanning-tree msti {{ inst.instance_number }} cost {{ inst.cost }} + {% else %} + no spanning-tree msti {{ inst.instance_number }} cost 1 + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% if intf_vars.vlan is defined and intf_vars.vlan %} + {% for inst in intf_vars.vlan %} + {% if inst.range_or_id is defined and inst.range_or_id %} + {% if inst.priority is defined %} + {% if inst.priority %} + spanning-tree vlan {{ inst.range_or_id }} priority {{ inst.priority }} + {% else %} + no spanning-tree vlan {{ inst.range_or_id }} priority 1 + {% endif %} + {% endif %} + {% if inst.cost is defined %} + {% if inst.cost %} + spanning-tree vlan {{ inst.range_or_id }} cost {{ inst.cost }} + {% else %} + no spanning-tree vlan {{ inst.range_or_id }} cost 1 + {% endif %} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% endfor %} +{% endif %} + +{% endif %} diff --git a/ansible_collections/dellemc/os10/roles/os10_xstp/tests/inventory.yaml b/ansible_collections/dellemc/os10/roles/os10_xstp/tests/inventory.yaml new file mode 100644 index 00000000..b1ff63e6 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_xstp/tests/inventory.yaml @@ -0,0 +1,22 @@ +--- +spine1 ansible_host=10.11.182.25 ansible_network_os="dellemc.os10.os10" +spine2 ansible_host=10.16.151.220 ansible_network_os="dellemc.os10.os10" + +leaf1 ansible_host=10.11.182.23 ansible_network_os="dellemc.os10.os10" +leaf2 ansible_host=10.11.182.16 ansible_network_os="dellemc.os10.os10" +leaf3 ansible_host=10.11.182.17 ansible_network_os="dellemc.os10.os10" +leaf4 ansible_host=10.16.148.79 ansible_network_os="dellemc.os10.os10" + +[spine] +spine1 +spine2 + +[leaf] +leaf1 +leaf2 +leaf3 +leaf4 + +[datacenter:children] +spine +leaf diff --git a/ansible_collections/dellemc/os10/roles/os10_xstp/tests/main.yaml b/ansible_collections/dellemc/os10/roles/os10_xstp/tests/main.yaml new file mode 100644 index 00000000..7b55af45 --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_xstp/tests/main.yaml @@ -0,0 +1,74 @@ +--- +# vars file for dellemc.os10.os10_xstp, +# below gives a sample configuration +# Sample variables for OS10 device +os10_xstp: + type: rstp + enable: true + path_cost: true + mac_flush_timer: 4 + rstp: + max_age: 6 + hello_time: 7 + forward_time: 7 + force_version: stp + bridge_priority: 4096 + mac_flush_threshold: 5 + pvst: + vlan: + - range_or_id: 10 + max_age: 6 + enable: true + hello_time: 7 + forward_time: 7 + bridge_priority: 4096 + mac_flush_threshold: 9 + mstp: + max_age: 6 + max_hops: 6 + hello_time: 7 + forward_time: 7 + force_version: stp + mstp_instances: + - number_or_range: 1 + enable: true + mac_flush_threshold: 9 + bridge_priority: 4096 + mst_config: + name: cfg1 + revision: 5 + cfg_list: + - number: 1 + vlans: 10,12 + vlans_state: present + intf: + ethernet 1/1/8: + edge_port: true + bpdu_filter: true + bpdu_guard: true + guard: loop + enable: true + link_type: point-to-point + msti: + - instance_number: 1 + priority: 32 + cost: 1 + rstp: + priority: 32 + cost: 7 + vlan: + - range_or_id: 6 + priority: 16 + cost: 8 + +# Sample variables for OS10 devices to configure root in pvst and mst +#--- +#os10_xstp: +# pvst: +# vlan: +# - range_or_id: 10 +# root: primary +# mstp: +# mstp_instances: +# - number_or_range: 1 +# root: secondary diff --git a/ansible_collections/dellemc/os10/roles/os10_xstp/tests/test.yaml b/ansible_collections/dellemc/os10/roles/os10_xstp/tests/test.yaml new file mode 100644 index 00000000..438212ca --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_xstp/tests/test.yaml @@ -0,0 +1,5 @@ +--- +- hosts: datacenter + connection: network_cli + roles: + - dellemc.os10.os10_xstp diff --git a/ansible_collections/dellemc/os10/roles/os10_xstp/vars/main.yml b/ansible_collections/dellemc/os10/roles/os10_xstp/vars/main.yml new file mode 100644 index 00000000..b3eb721a --- /dev/null +++ b/ansible_collections/dellemc/os10/roles/os10_xstp/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for dellemc.os10.os10_xstp |