| @@ -0,0 +1,674 @@ | |||||
| GNU GENERAL PUBLIC LICENSE | |||||
| Version 3, 29 June 2007 | |||||
| Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> | |||||
| Everyone is permitted to copy and distribute verbatim copies | |||||
| of this license document, but changing it is not allowed. | |||||
| Preamble | |||||
| The GNU General Public License is a free, copyleft license for | |||||
| software and other kinds of works. | |||||
| The licenses for most software and other practical works are designed | |||||
| to take away your freedom to share and change the works. By contrast, | |||||
| the GNU General Public License is intended to guarantee your freedom to | |||||
| share and change all versions of a program--to make sure it remains free | |||||
| software for all its users. We, the Free Software Foundation, use the | |||||
| GNU General Public License for most of our software; it applies also to | |||||
| any other work released this way by its authors. You can apply it to | |||||
| your programs, too. | |||||
| When we speak of free software, we are referring to freedom, not | |||||
| price. Our General Public Licenses are designed to make sure that you | |||||
| have the freedom to distribute copies of free software (and charge for | |||||
| them if you wish), that you receive source code or can get it if you | |||||
| want it, that you can change the software or use pieces of it in new | |||||
| free programs, and that you know you can do these things. | |||||
| To protect your rights, we need to prevent others from denying you | |||||
| these rights or asking you to surrender the rights. Therefore, you have | |||||
| certain responsibilities if you distribute copies of the software, or if | |||||
| you modify it: responsibilities to respect the freedom of others. | |||||
| For example, if you distribute copies of such a program, whether | |||||
| gratis or for a fee, you must pass on to the recipients the same | |||||
| freedoms that you received. You must make sure that they, too, receive | |||||
| or can get the source code. And you must show them these terms so they | |||||
| know their rights. | |||||
| Developers that use the GNU GPL protect your rights with two steps: | |||||
| (1) assert copyright on the software, and (2) offer you this License | |||||
| giving you legal permission to copy, distribute and/or modify it. | |||||
| For the developers' and authors' protection, the GPL clearly explains | |||||
| that there is no warranty for this free software. For both users' and | |||||
| authors' sake, the GPL requires that modified versions be marked as | |||||
| changed, so that their problems will not be attributed erroneously to | |||||
| authors of previous versions. | |||||
| Some devices are designed to deny users access to install or run | |||||
| modified versions of the software inside them, although the manufacturer | |||||
| can do so. This is fundamentally incompatible with the aim of | |||||
| protecting users' freedom to change the software. The systematic | |||||
| pattern of such abuse occurs in the area of products for individuals to | |||||
| use, which is precisely where it is most unacceptable. Therefore, we | |||||
| have designed this version of the GPL to prohibit the practice for those | |||||
| products. If such problems arise substantially in other domains, we | |||||
| stand ready to extend this provision to those domains in future versions | |||||
| of the GPL, as needed to protect the freedom of users. | |||||
| Finally, every program is threatened constantly by software patents. | |||||
| States should not allow patents to restrict development and use of | |||||
| software on general-purpose computers, but in those that do, we wish to | |||||
| avoid the special danger that patents applied to a free program could | |||||
| make it effectively proprietary. To prevent this, the GPL assures that | |||||
| patents cannot be used to render the program non-free. | |||||
| The precise terms and conditions for copying, distribution and | |||||
| modification follow. | |||||
| TERMS AND CONDITIONS | |||||
| 0. Definitions. | |||||
| "This License" refers to version 3 of the GNU General Public License. | |||||
| "Copyright" also means copyright-like laws that apply to other kinds of | |||||
| works, such as semiconductor masks. | |||||
| "The Program" refers to any copyrightable work licensed under this | |||||
| License. Each licensee is addressed as "you". "Licensees" and | |||||
| "recipients" may be individuals or organizations. | |||||
| To "modify" a work means to copy from or adapt all or part of the work | |||||
| in a fashion requiring copyright permission, other than the making of an | |||||
| exact copy. The resulting work is called a "modified version" of the | |||||
| earlier work or a work "based on" the earlier work. | |||||
| A "covered work" means either the unmodified Program or a work based | |||||
| on the Program. | |||||
| To "propagate" a work means to do anything with it that, without | |||||
| permission, would make you directly or secondarily liable for | |||||
| infringement under applicable copyright law, except executing it on a | |||||
| computer or modifying a private copy. Propagation includes copying, | |||||
| distribution (with or without modification), making available to the | |||||
| public, and in some countries other activities as well. | |||||
| To "convey" a work means any kind of propagation that enables other | |||||
| parties to make or receive copies. Mere interaction with a user through | |||||
| a computer network, with no transfer of a copy, is not conveying. | |||||
| An interactive user interface displays "Appropriate Legal Notices" | |||||
| to the extent that it includes a convenient and prominently visible | |||||
| feature that (1) displays an appropriate copyright notice, and (2) | |||||
| tells the user that there is no warranty for the work (except to the | |||||
| extent that warranties are provided), that licensees may convey the | |||||
| work under this License, and how to view a copy of this License. If | |||||
| the interface presents a list of user commands or options, such as a | |||||
| menu, a prominent item in the list meets this criterion. | |||||
| 1. Source Code. | |||||
| The "source code" for a work means the preferred form of the work | |||||
| for making modifications to it. "Object code" means any non-source | |||||
| form of a work. | |||||
| A "Standard Interface" means an interface that either is an official | |||||
| standard defined by a recognized standards body, or, in the case of | |||||
| interfaces specified for a particular programming language, one that | |||||
| is widely used among developers working in that language. | |||||
| The "System Libraries" of an executable work include anything, other | |||||
| than the work as a whole, that (a) is included in the normal form of | |||||
| packaging a Major Component, but which is not part of that Major | |||||
| Component, and (b) serves only to enable use of the work with that | |||||
| Major Component, or to implement a Standard Interface for which an | |||||
| implementation is available to the public in source code form. A | |||||
| "Major Component", in this context, means a major essential component | |||||
| (kernel, window system, and so on) of the specific operating system | |||||
| (if any) on which the executable work runs, or a compiler used to | |||||
| produce the work, or an object code interpreter used to run it. | |||||
| The "Corresponding Source" for a work in object code form means all | |||||
| the source code needed to generate, install, and (for an executable | |||||
| work) run the object code and to modify the work, including scripts to | |||||
| control those activities. However, it does not include the work's | |||||
| System Libraries, or general-purpose tools or generally available free | |||||
| programs which are used unmodified in performing those activities but | |||||
| which are not part of the work. For example, Corresponding Source | |||||
| includes interface definition files associated with source files for | |||||
| the work, and the source code for shared libraries and dynamically | |||||
| linked subprograms that the work is specifically designed to require, | |||||
| such as by intimate data communication or control flow between those | |||||
| subprograms and other parts of the work. | |||||
| The Corresponding Source need not include anything that users | |||||
| can regenerate automatically from other parts of the Corresponding | |||||
| Source. | |||||
| The Corresponding Source for a work in source code form is that | |||||
| same work. | |||||
| 2. Basic Permissions. | |||||
| All rights granted under this License are granted for the term of | |||||
| copyright on the Program, and are irrevocable provided the stated | |||||
| conditions are met. This License explicitly affirms your unlimited | |||||
| permission to run the unmodified Program. The output from running a | |||||
| covered work is covered by this License only if the output, given its | |||||
| content, constitutes a covered work. This License acknowledges your | |||||
| rights of fair use or other equivalent, as provided by copyright law. | |||||
| You may make, run and propagate covered works that you do not | |||||
| convey, without conditions so long as your license otherwise remains | |||||
| in force. You may convey covered works to others for the sole purpose | |||||
| of having them make modifications exclusively for you, or provide you | |||||
| with facilities for running those works, provided that you comply with | |||||
| the terms of this License in conveying all material for which you do | |||||
| not control copyright. Those thus making or running the covered works | |||||
| for you must do so exclusively on your behalf, under your direction | |||||
| and control, on terms that prohibit them from making any copies of | |||||
| your copyrighted material outside their relationship with you. | |||||
| Conveying under any other circumstances is permitted solely under | |||||
| the conditions stated below. Sublicensing is not allowed; section 10 | |||||
| makes it unnecessary. | |||||
| 3. Protecting Users' Legal Rights From Anti-Circumvention Law. | |||||
| No covered work shall be deemed part of an effective technological | |||||
| measure under any applicable law fulfilling obligations under article | |||||
| 11 of the WIPO copyright treaty adopted on 20 December 1996, or | |||||
| similar laws prohibiting or restricting circumvention of such | |||||
| measures. | |||||
| When you convey a covered work, you waive any legal power to forbid | |||||
| circumvention of technological measures to the extent such circumvention | |||||
| is effected by exercising rights under this License with respect to | |||||
| the covered work, and you disclaim any intention to limit operation or | |||||
| modification of the work as a means of enforcing, against the work's | |||||
| users, your or third parties' legal rights to forbid circumvention of | |||||
| technological measures. | |||||
| 4. Conveying Verbatim Copies. | |||||
| You may convey verbatim copies of the Program's source code as you | |||||
| receive it, in any medium, provided that you conspicuously and | |||||
| appropriately publish on each copy an appropriate copyright notice; | |||||
| keep intact all notices stating that this License and any | |||||
| non-permissive terms added in accord with section 7 apply to the code; | |||||
| keep intact all notices of the absence of any warranty; and give all | |||||
| recipients a copy of this License along with the Program. | |||||
| You may charge any price or no price for each copy that you convey, | |||||
| and you may offer support or warranty protection for a fee. | |||||
| 5. Conveying Modified Source Versions. | |||||
| You may convey a work based on the Program, or the modifications to | |||||
| produce it from the Program, in the form of source code under the | |||||
| terms of section 4, provided that you also meet all of these conditions: | |||||
| a) The work must carry prominent notices stating that you modified | |||||
| it, and giving a relevant date. | |||||
| b) The work must carry prominent notices stating that it is | |||||
| released under this License and any conditions added under section | |||||
| 7. This requirement modifies the requirement in section 4 to | |||||
| "keep intact all notices". | |||||
| c) You must license the entire work, as a whole, under this | |||||
| License to anyone who comes into possession of a copy. This | |||||
| License will therefore apply, along with any applicable section 7 | |||||
| additional terms, to the whole of the work, and all its parts, | |||||
| regardless of how they are packaged. This License gives no | |||||
| permission to license the work in any other way, but it does not | |||||
| invalidate such permission if you have separately received it. | |||||
| d) If the work has interactive user interfaces, each must display | |||||
| Appropriate Legal Notices; however, if the Program has interactive | |||||
| interfaces that do not display Appropriate Legal Notices, your | |||||
| work need not make them do so. | |||||
| A compilation of a covered work with other separate and independent | |||||
| works, which are not by their nature extensions of the covered work, | |||||
| and which are not combined with it such as to form a larger program, | |||||
| in or on a volume of a storage or distribution medium, is called an | |||||
| "aggregate" if the compilation and its resulting copyright are not | |||||
| used to limit the access or legal rights of the compilation's users | |||||
| beyond what the individual works permit. Inclusion of a covered work | |||||
| in an aggregate does not cause this License to apply to the other | |||||
| parts of the aggregate. | |||||
| 6. Conveying Non-Source Forms. | |||||
| You may convey a covered work in object code form under the terms | |||||
| of sections 4 and 5, provided that you also convey the | |||||
| machine-readable Corresponding Source under the terms of this License, | |||||
| in one of these ways: | |||||
| a) Convey the object code in, or embodied in, a physical product | |||||
| (including a physical distribution medium), accompanied by the | |||||
| Corresponding Source fixed on a durable physical medium | |||||
| customarily used for software interchange. | |||||
| b) Convey the object code in, or embodied in, a physical product | |||||
| (including a physical distribution medium), accompanied by a | |||||
| written offer, valid for at least three years and valid for as | |||||
| long as you offer spare parts or customer support for that product | |||||
| model, to give anyone who possesses the object code either (1) a | |||||
| copy of the Corresponding Source for all the software in the | |||||
| product that is covered by this License, on a durable physical | |||||
| medium customarily used for software interchange, for a price no | |||||
| more than your reasonable cost of physically performing this | |||||
| conveying of source, or (2) access to copy the | |||||
| Corresponding Source from a network server at no charge. | |||||
| c) Convey individual copies of the object code with a copy of the | |||||
| written offer to provide the Corresponding Source. This | |||||
| alternative is allowed only occasionally and noncommercially, and | |||||
| only if you received the object code with such an offer, in accord | |||||
| with subsection 6b. | |||||
| d) Convey the object code by offering access from a designated | |||||
| place (gratis or for a charge), and offer equivalent access to the | |||||
| Corresponding Source in the same way through the same place at no | |||||
| further charge. You need not require recipients to copy the | |||||
| Corresponding Source along with the object code. If the place to | |||||
| copy the object code is a network server, the Corresponding Source | |||||
| may be on a different server (operated by you or a third party) | |||||
| that supports equivalent copying facilities, provided you maintain | |||||
| clear directions next to the object code saying where to find the | |||||
| Corresponding Source. Regardless of what server hosts the | |||||
| Corresponding Source, you remain obligated to ensure that it is | |||||
| available for as long as needed to satisfy these requirements. | |||||
| e) Convey the object code using peer-to-peer transmission, provided | |||||
| you inform other peers where the object code and Corresponding | |||||
| Source of the work are being offered to the general public at no | |||||
| charge under subsection 6d. | |||||
| A separable portion of the object code, whose source code is excluded | |||||
| from the Corresponding Source as a System Library, need not be | |||||
| included in conveying the object code work. | |||||
| A "User Product" is either (1) a "consumer product", which means any | |||||
| tangible personal property which is normally used for personal, family, | |||||
| or household purposes, or (2) anything designed or sold for incorporation | |||||
| into a dwelling. In determining whether a product is a consumer product, | |||||
| doubtful cases shall be resolved in favor of coverage. For a particular | |||||
| product received by a particular user, "normally used" refers to a | |||||
| typical or common use of that class of product, regardless of the status | |||||
| of the particular user or of the way in which the particular user | |||||
| actually uses, or expects or is expected to use, the product. A product | |||||
| is a consumer product regardless of whether the product has substantial | |||||
| commercial, industrial or non-consumer uses, unless such uses represent | |||||
| the only significant mode of use of the product. | |||||
| "Installation Information" for a User Product means any methods, | |||||
| procedures, authorization keys, or other information required to install | |||||
| and execute modified versions of a covered work in that User Product from | |||||
| a modified version of its Corresponding Source. The information must | |||||
| suffice to ensure that the continued functioning of the modified object | |||||
| code is in no case prevented or interfered with solely because | |||||
| modification has been made. | |||||
| If you convey an object code work under this section in, or with, or | |||||
| specifically for use in, a User Product, and the conveying occurs as | |||||
| part of a transaction in which the right of possession and use of the | |||||
| User Product is transferred to the recipient in perpetuity or for a | |||||
| fixed term (regardless of how the transaction is characterized), the | |||||
| Corresponding Source conveyed under this section must be accompanied | |||||
| by the Installation Information. But this requirement does not apply | |||||
| if neither you nor any third party retains the ability to install | |||||
| modified object code on the User Product (for example, the work has | |||||
| been installed in ROM). | |||||
| The requirement to provide Installation Information does not include a | |||||
| requirement to continue to provide support service, warranty, or updates | |||||
| for a work that has been modified or installed by the recipient, or for | |||||
| the User Product in which it has been modified or installed. Access to a | |||||
| network may be denied when the modification itself materially and | |||||
| adversely affects the operation of the network or violates the rules and | |||||
| protocols for communication across the network. | |||||
| Corresponding Source conveyed, and Installation Information provided, | |||||
| in accord with this section must be in a format that is publicly | |||||
| documented (and with an implementation available to the public in | |||||
| source code form), and must require no special password or key for | |||||
| unpacking, reading or copying. | |||||
| 7. Additional Terms. | |||||
| "Additional permissions" are terms that supplement the terms of this | |||||
| License by making exceptions from one or more of its conditions. | |||||
| Additional permissions that are applicable to the entire Program shall | |||||
| be treated as though they were included in this License, to the extent | |||||
| that they are valid under applicable law. If additional permissions | |||||
| apply only to part of the Program, that part may be used separately | |||||
| under those permissions, but the entire Program remains governed by | |||||
| this License without regard to the additional permissions. | |||||
| When you convey a copy of a covered work, you may at your option | |||||
| remove any additional permissions from that copy, or from any part of | |||||
| it. (Additional permissions may be written to require their own | |||||
| removal in certain cases when you modify the work.) You may place | |||||
| additional permissions on material, added by you to a covered work, | |||||
| for which you have or can give appropriate copyright permission. | |||||
| Notwithstanding any other provision of this License, for material you | |||||
| add to a covered work, you may (if authorized by the copyright holders of | |||||
| that material) supplement the terms of this License with terms: | |||||
| a) Disclaiming warranty or limiting liability differently from the | |||||
| terms of sections 15 and 16 of this License; or | |||||
| b) Requiring preservation of specified reasonable legal notices or | |||||
| author attributions in that material or in the Appropriate Legal | |||||
| Notices displayed by works containing it; or | |||||
| c) Prohibiting misrepresentation of the origin of that material, or | |||||
| requiring that modified versions of such material be marked in | |||||
| reasonable ways as different from the original version; or | |||||
| d) Limiting the use for publicity purposes of names of licensors or | |||||
| authors of the material; or | |||||
| e) Declining to grant rights under trademark law for use of some | |||||
| trade names, trademarks, or service marks; or | |||||
| f) Requiring indemnification of licensors and authors of that | |||||
| material by anyone who conveys the material (or modified versions of | |||||
| it) with contractual assumptions of liability to the recipient, for | |||||
| any liability that these contractual assumptions directly impose on | |||||
| those licensors and authors. | |||||
| All other non-permissive additional terms are considered "further | |||||
| restrictions" within the meaning of section 10. If the Program as you | |||||
| received it, or any part of it, contains a notice stating that it is | |||||
| governed by this License along with a term that is a further | |||||
| restriction, you may remove that term. If a license document contains | |||||
| a further restriction but permits relicensing or conveying under this | |||||
| License, you may add to a covered work material governed by the terms | |||||
| of that license document, provided that the further restriction does | |||||
| not survive such relicensing or conveying. | |||||
| If you add terms to a covered work in accord with this section, you | |||||
| must place, in the relevant source files, a statement of the | |||||
| additional terms that apply to those files, or a notice indicating | |||||
| where to find the applicable terms. | |||||
| Additional terms, permissive or non-permissive, may be stated in the | |||||
| form of a separately written license, or stated as exceptions; | |||||
| the above requirements apply either way. | |||||
| 8. Termination. | |||||
| You may not propagate or modify a covered work except as expressly | |||||
| provided under this License. Any attempt otherwise to propagate or | |||||
| modify it is void, and will automatically terminate your rights under | |||||
| this License (including any patent licenses granted under the third | |||||
| paragraph of section 11). | |||||
| However, if you cease all violation of this License, then your | |||||
| license from a particular copyright holder is reinstated (a) | |||||
| provisionally, unless and until the copyright holder explicitly and | |||||
| finally terminates your license, and (b) permanently, if the copyright | |||||
| holder fails to notify you of the violation by some reasonable means | |||||
| prior to 60 days after the cessation. | |||||
| Moreover, your license from a particular copyright holder is | |||||
| reinstated permanently if the copyright holder notifies you of the | |||||
| violation by some reasonable means, this is the first time you have | |||||
| received notice of violation of this License (for any work) from that | |||||
| copyright holder, and you cure the violation prior to 30 days after | |||||
| your receipt of the notice. | |||||
| Termination of your rights under this section does not terminate the | |||||
| licenses of parties who have received copies or rights from you under | |||||
| this License. If your rights have been terminated and not permanently | |||||
| reinstated, you do not qualify to receive new licenses for the same | |||||
| material under section 10. | |||||
| 9. Acceptance Not Required for Having Copies. | |||||
| You are not required to accept this License in order to receive or | |||||
| run a copy of the Program. Ancillary propagation of a covered work | |||||
| occurring solely as a consequence of using peer-to-peer transmission | |||||
| to receive a copy likewise does not require acceptance. However, | |||||
| nothing other than this License grants you permission to propagate or | |||||
| modify any covered work. These actions infringe copyright if you do | |||||
| not accept this License. Therefore, by modifying or propagating a | |||||
| covered work, you indicate your acceptance of this License to do so. | |||||
| 10. Automatic Licensing of Downstream Recipients. | |||||
| Each time you convey a covered work, the recipient automatically | |||||
| receives a license from the original licensors, to run, modify and | |||||
| propagate that work, subject to this License. You are not responsible | |||||
| for enforcing compliance by third parties with this License. | |||||
| An "entity transaction" is a transaction transferring control of an | |||||
| organization, or substantially all assets of one, or subdividing an | |||||
| organization, or merging organizations. If propagation of a covered | |||||
| work results from an entity transaction, each party to that | |||||
| transaction who receives a copy of the work also receives whatever | |||||
| licenses to the work the party's predecessor in interest had or could | |||||
| give under the previous paragraph, plus a right to possession of the | |||||
| Corresponding Source of the work from the predecessor in interest, if | |||||
| the predecessor has it or can get it with reasonable efforts. | |||||
| You may not impose any further restrictions on the exercise of the | |||||
| rights granted or affirmed under this License. For example, you may | |||||
| not impose a license fee, royalty, or other charge for exercise of | |||||
| rights granted under this License, and you may not initiate litigation | |||||
| (including a cross-claim or counterclaim in a lawsuit) alleging that | |||||
| any patent claim is infringed by making, using, selling, offering for | |||||
| sale, or importing the Program or any portion of it. | |||||
| 11. Patents. | |||||
| A "contributor" is a copyright holder who authorizes use under this | |||||
| License of the Program or a work on which the Program is based. The | |||||
| work thus licensed is called the contributor's "contributor version". | |||||
| A contributor's "essential patent claims" are all patent claims | |||||
| owned or controlled by the contributor, whether already acquired or | |||||
| hereafter acquired, that would be infringed by some manner, permitted | |||||
| by this License, of making, using, or selling its contributor version, | |||||
| but do not include claims that would be infringed only as a | |||||
| consequence of further modification of the contributor version. For | |||||
| purposes of this definition, "control" includes the right to grant | |||||
| patent sublicenses in a manner consistent with the requirements of | |||||
| this License. | |||||
| Each contributor grants you a non-exclusive, worldwide, royalty-free | |||||
| patent license under the contributor's essential patent claims, to | |||||
| make, use, sell, offer for sale, import and otherwise run, modify and | |||||
| propagate the contents of its contributor version. | |||||
| In the following three paragraphs, a "patent license" is any express | |||||
| agreement or commitment, however denominated, not to enforce a patent | |||||
| (such as an express permission to practice a patent or covenant not to | |||||
| sue for patent infringement). To "grant" such a patent license to a | |||||
| party means to make such an agreement or commitment not to enforce a | |||||
| patent against the party. | |||||
| If you convey a covered work, knowingly relying on a patent license, | |||||
| and the Corresponding Source of the work is not available for anyone | |||||
| to copy, free of charge and under the terms of this License, through a | |||||
| publicly available network server or other readily accessible means, | |||||
| then you must either (1) cause the Corresponding Source to be so | |||||
| available, or (2) arrange to deprive yourself of the benefit of the | |||||
| patent license for this particular work, or (3) arrange, in a manner | |||||
| consistent with the requirements of this License, to extend the patent | |||||
| license to downstream recipients. "Knowingly relying" means you have | |||||
| actual knowledge that, but for the patent license, your conveying the | |||||
| covered work in a country, or your recipient's use of the covered work | |||||
| in a country, would infringe one or more identifiable patents in that | |||||
| country that you have reason to believe are valid. | |||||
| If, pursuant to or in connection with a single transaction or | |||||
| arrangement, you convey, or propagate by procuring conveyance of, a | |||||
| covered work, and grant a patent license to some of the parties | |||||
| receiving the covered work authorizing them to use, propagate, modify | |||||
| or convey a specific copy of the covered work, then the patent license | |||||
| you grant is automatically extended to all recipients of the covered | |||||
| work and works based on it. | |||||
| A patent license is "discriminatory" if it does not include within | |||||
| the scope of its coverage, prohibits the exercise of, or is | |||||
| conditioned on the non-exercise of one or more of the rights that are | |||||
| specifically granted under this License. You may not convey a covered | |||||
| work if you are a party to an arrangement with a third party that is | |||||
| in the business of distributing software, under which you make payment | |||||
| to the third party based on the extent of your activity of conveying | |||||
| the work, and under which the third party grants, to any of the | |||||
| parties who would receive the covered work from you, a discriminatory | |||||
| patent license (a) in connection with copies of the covered work | |||||
| conveyed by you (or copies made from those copies), or (b) primarily | |||||
| for and in connection with specific products or compilations that | |||||
| contain the covered work, unless you entered into that arrangement, | |||||
| or that patent license was granted, prior to 28 March 2007. | |||||
| Nothing in this License shall be construed as excluding or limiting | |||||
| any implied license or other defenses to infringement that may | |||||
| otherwise be available to you under applicable patent law. | |||||
| 12. No Surrender of Others' Freedom. | |||||
| If conditions are imposed on you (whether by court order, agreement or | |||||
| otherwise) that contradict the conditions of this License, they do not | |||||
| excuse you from the conditions of this License. If you cannot convey a | |||||
| covered work so as to satisfy simultaneously your obligations under this | |||||
| License and any other pertinent obligations, then as a consequence you may | |||||
| not convey it at all. For example, if you agree to terms that obligate you | |||||
| to collect a royalty for further conveying from those to whom you convey | |||||
| the Program, the only way you could satisfy both those terms and this | |||||
| License would be to refrain entirely from conveying the Program. | |||||
| 13. Use with the GNU Affero General Public License. | |||||
| Notwithstanding any other provision of this License, you have | |||||
| permission to link or combine any covered work with a work licensed | |||||
| under version 3 of the GNU Affero General Public License into a single | |||||
| combined work, and to convey the resulting work. The terms of this | |||||
| License will continue to apply to the part which is the covered work, | |||||
| but the special requirements of the GNU Affero General Public License, | |||||
| section 13, concerning interaction through a network will apply to the | |||||
| combination as such. | |||||
| 14. Revised Versions of this License. | |||||
| The Free Software Foundation may publish revised and/or new versions of | |||||
| the GNU General Public License from time to time. Such new versions will | |||||
| be similar in spirit to the present version, but may differ in detail to | |||||
| address new problems or concerns. | |||||
| Each version is given a distinguishing version number. If the | |||||
| Program specifies that a certain numbered version of the GNU General | |||||
| Public License "or any later version" applies to it, you have the | |||||
| option of following the terms and conditions either of that numbered | |||||
| version or of any later version published by the Free Software | |||||
| Foundation. If the Program does not specify a version number of the | |||||
| GNU General Public License, you may choose any version ever published | |||||
| by the Free Software Foundation. | |||||
| If the Program specifies that a proxy can decide which future | |||||
| versions of the GNU General Public License can be used, that proxy's | |||||
| public statement of acceptance of a version permanently authorizes you | |||||
| to choose that version for the Program. | |||||
| Later license versions may give you additional or different | |||||
| permissions. However, no additional obligations are imposed on any | |||||
| author or copyright holder as a result of your choosing to follow a | |||||
| later version. | |||||
| 15. Disclaimer of Warranty. | |||||
| THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY | |||||
| APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT | |||||
| HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY | |||||
| OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, | |||||
| THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |||||
| PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM | |||||
| IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF | |||||
| ALL NECESSARY SERVICING, REPAIR OR CORRECTION. | |||||
| 16. Limitation of Liability. | |||||
| IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING | |||||
| WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS | |||||
| THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY | |||||
| GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE | |||||
| USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF | |||||
| DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD | |||||
| PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), | |||||
| EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF | |||||
| SUCH DAMAGES. | |||||
| 17. Interpretation of Sections 15 and 16. | |||||
| If the disclaimer of warranty and limitation of liability provided | |||||
| above cannot be given local legal effect according to their terms, | |||||
| reviewing courts shall apply local law that most closely approximates | |||||
| an absolute waiver of all civil liability in connection with the | |||||
| Program, unless a warranty or assumption of liability accompanies a | |||||
| copy of the Program in return for a fee. | |||||
| END OF TERMS AND CONDITIONS | |||||
| How to Apply These Terms to Your New Programs | |||||
| If you develop a new program, and you want it to be of the greatest | |||||
| possible use to the public, the best way to achieve this is to make it | |||||
| free software which everyone can redistribute and change under these terms. | |||||
| To do so, attach the following notices to the program. It is safest | |||||
| to attach them to the start of each source file to most effectively | |||||
| state the exclusion of warranty; and each file should have at least | |||||
| the "copyright" line and a pointer to where the full notice is found. | |||||
| <one line to give the program's name and a brief idea of what it does.> | |||||
| Copyright (C) <year> <name of author> | |||||
| This program is free software: you can redistribute it and/or modify | |||||
| it under the terms of the GNU General Public License as published by | |||||
| the Free Software Foundation, either version 3 of the License, or | |||||
| (at your option) any later version. | |||||
| This program is distributed in the hope that it will be useful, | |||||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
| GNU General Public License for more details. | |||||
| You should have received a copy of the GNU General Public License | |||||
| along with this program. If not, see <https://www.gnu.org/licenses/>. | |||||
| Also add information on how to contact you by electronic and paper mail. | |||||
| If the program does terminal interaction, make it output a short | |||||
| notice like this when it starts in an interactive mode: | |||||
| <program> Copyright (C) <year> <name of author> | |||||
| This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. | |||||
| This is free software, and you are welcome to redistribute it | |||||
| under certain conditions; type `show c' for details. | |||||
| The hypothetical commands `show w' and `show c' should show the appropriate | |||||
| parts of the General Public License. Of course, your program's commands | |||||
| might be different; for a GUI interface, you would use an "about box". | |||||
| You should also get your employer (if you work as a programmer) or school, | |||||
| if any, to sign a "copyright disclaimer" for the program, if necessary. | |||||
| For more information on this, and how to apply and follow the GNU GPL, see | |||||
| <https://www.gnu.org/licenses/>. | |||||
| The GNU General Public License does not permit incorporating your program | |||||
| into proprietary programs. If your program is a subroutine library, you | |||||
| may consider it more useful to permit linking proprietary applications with | |||||
| the library. If this is what you want to do, use the GNU Lesser General | |||||
| Public License instead of this License. But first, please read | |||||
| <https://www.gnu.org/licenses/why-not-lgpl.html>. | |||||
| @@ -0,0 +1,2 @@ | |||||
| # azure_ag | |||||
| Manage Azure application gateway | |||||
| @@ -0,0 +1,83 @@ | |||||
| --- | |||||
| #agws: | |||||
| # - name: | |||||
| # authentication_certificates: | |||||
| # - name: | |||||
| # data: #Certificate public data - base64 encoded pfx. | |||||
| # cert_validation_mode: validate #ignore | |||||
| # backend_address_pools: | |||||
| # - name: | |||||
| # backend_addresses: | |||||
| # - ip1 | |||||
| # - ip2 | |||||
| # - ... | |||||
| # - fqdn | |||||
| # backend_http_settings_collection | |||||
| # - name: | |||||
| # cookie_based_affinity: | |||||
| # affinity_cookie_name: | |||||
| # host_name: | |||||
| # path: | |||||
| # pick_host_name_from_backend_address: false | |||||
| # port: | |||||
| # probe: | |||||
| # protocol: | |||||
| # request_timeout: 300 #seconds | |||||
| # frontend_ip_configurations: | |||||
| # - name: | |||||
| # private_ip_allocation_method: 'Dynamic' #Static, Dynamic | |||||
| # private_ip_address: | |||||
| # public_ip_address: | |||||
| # subnet: | |||||
| # frontend_ports: | |||||
| # - name: | |||||
| # port: | |||||
| # gateway_ip_configurations: | |||||
| # - name: | |||||
| # subnet: | |||||
| # http_listeners: | |||||
| # - name: | |||||
| # frontend_ip_configuration: | |||||
| # frontend_port: | |||||
| # host_name: | |||||
| # protocol: | |||||
| # require_sni: | |||||
| # ssl_certificate: | |||||
| # probes: | |||||
| # - name: | |||||
| # interval: 10 #1 to 86400 seconds | |||||
| # host: | |||||
| # path: | |||||
| # protocol: 'http' #http, https | |||||
| # unhealthy_threshold: 5 #1 to 20 seconds | |||||
| # redirect_configurations: | |||||
| # - name: | |||||
| # include_path: | |||||
| # include_query_string: | |||||
| # redirect_type: permanent #found, see_other, temporary | |||||
| # target_listener: | |||||
| # request_routing_rules: | |||||
| # - name: | |||||
| # backend_address_pool: | |||||
| # backend_http_settings: | |||||
| # http_listener: | |||||
| # redirect_configuration: | |||||
| # rule_type: basic #path_based_routing | |||||
| # location: | |||||
| # sku: | |||||
| # name: | |||||
| # capacity: | |||||
| # tier: | |||||
| # ssl_certificates: | |||||
| # ssl_policy: | |||||
| # cipher_suites: [] | |||||
| # disabled_ssl_protocols: [] #[tls_v1_0, tls_v1_1, tls_v1_2] | |||||
| # min_protocol_version: tls_v1_0 #tls_v1_1, tls_v1_2 | |||||
| # policy_name: #predefined policy: ssl_policy20150501, ssl_policy20170401, ssl_policy20170401_s | |||||
| # policy_type: #predefined, custom | |||||
| # resource_group: | |||||
| # state: | |||||
| # tags: | |||||
| # "env": "prod" | |||||
| # "provisioner": "ansible" | |||||
| ... | |||||
| @@ -0,0 +1,14 @@ | |||||
| --- | |||||
| - name: Delete application gateway | |||||
| azure_rm_appgateway: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| name: "{{ agw.name }}" | |||||
| resource_group: "{{ agw.resource_group }}" | |||||
| state: "absent" | |||||
| register: deletedagw | |||||
| ... | |||||
| @@ -0,0 +1,30 @@ | |||||
| --- | |||||
| - name: In application gateway state | |||||
| include: "{{ item.state | default('present', true) }}.yml" | |||||
| vars: | |||||
| agw: "{{ item }}" | |||||
| when: | |||||
| - action is undefined | |||||
| - (agws | default([], true) | length) > 0 | |||||
| with_items: "{{ agws }}" | |||||
| - name: Update/create application gateway | |||||
| include: present.yml | |||||
| vars: | |||||
| agw: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'present' | |||||
| - (agws | default([], true) | length) > 0 | |||||
| with_items: "{{ agws }}" | |||||
| - name: Delete application gateway | |||||
| include: absent.yml | |||||
| vars: | |||||
| agw: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'absent' | |||||
| - (agws | default([], true) | length) > 0 | |||||
| with_items: "{{ agws }}" | |||||
| ... | |||||
| @@ -0,0 +1,44 @@ | |||||
| --- | |||||
| - name: Build tags list | |||||
| set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', ag.tags | default({}, true)) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Clear ip configuration list | |||||
| set_fact: | |||||
| ip_configurations: [] | |||||
| - name: Set subnet id | |||||
| include: subnetid.yml | |||||
| loop: "{{ agw.frontend_ip_configurations }}" | |||||
| loop_control: | |||||
| loop_var: "fipc" | |||||
| - name: load template | |||||
| template: | |||||
| src: azure_application_gateway.j2 | |||||
| dest: /tmp/azure_application_gateway_body.json | |||||
| changed_when: false | |||||
| - name: Create application gateway | |||||
| azure_rm_resource: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| resource_name: "{{ agw.name | urlencode }}" | |||||
| resource_type: "applicationGateways" | |||||
| resource_group: "{{ agw.resource_group }}" | |||||
| provider: "Network" | |||||
| idempotency: true | |||||
| body: "{{ lookup('file', '/tmp/azure_application_gateway_body.json') }}" | |||||
| method: "{{ agw.method | default(omit, true) }}" | |||||
| subresource: "{{ agw.subresource | default(omit, true) }}" | |||||
| status_code: "{{ agw.status_code | default(omit, true) }}" | |||||
| state: "present" | |||||
| register: createres | |||||
| ... | |||||
| @@ -0,0 +1,39 @@ | |||||
| --- | |||||
| - name: Set subnet id | |||||
| set_fact: | |||||
| cfipc: {} | |||||
| - name: Get subnet | |||||
| azure_rm_subnet_facts: | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| resource_group: "{{ fipc.resource_group | default(lb.resource_group, true) }}" | |||||
| virtual_network_name: "{{ fipc.virtual_network_name }}" | |||||
| name: "{{ fipc.subnet_name }}" | |||||
| register: azure_subnet_facts | |||||
| when: | |||||
| - fipc.subnet_name is defined | |||||
| - name: Clean ip configuration | |||||
| set_fact: | |||||
| cfipc: "{{ cfipc | combine({field.key: field.value}) }}" | |||||
| with_dict: "{{ fipc }}" | |||||
| loop_control: | |||||
| loop_var: "field" | |||||
| when: | |||||
| - field.key not in ['virtual_network_name', 'subnet_name', 'resource_group'] | |||||
| - name: Set subnet id | |||||
| set_fact: | |||||
| cfipc: "{{ cfipc | combine({'subnet': azure_subnet_facts.subnets[0].id}) }}" | |||||
| when: | |||||
| - azure_subnet_facts is defined | |||||
| - azure_subnet_facts.subnets is defined | |||||
| - (azure_subnet_facts.subnets | length) == 1 | |||||
| - name: Build ip configuration list | |||||
| set_fact: | |||||
| ip_configurations: "{{ ip_configurations | default([], true) | union([cfipc]) }}" | |||||
| ... | |||||
| @@ -1,2 +1,2 @@ | |||||
| # azure_avs | |||||
| Manage Azure availability set | |||||
| # azure_avs | |||||
| Manage Azure availability set | |||||
| @@ -1,13 +1,13 @@ | |||||
| ass: | |||||
| - name: | |||||
| platform_fault_domain_count: 2 | |||||
| platform_update_domain_count: 2 | |||||
| location: | |||||
| resource_group: | |||||
| sku: "Classic" | |||||
| state: | |||||
| tags: | |||||
| "env": "prod" | |||||
| "provisioner": "ansible" | |||||
| ... | |||||
| --- | |||||
| #avss: | |||||
| # - name: | |||||
| # platform_fault_domain_count: 2 | |||||
| # platform_update_domain_count: 2 | |||||
| # location: | |||||
| # resource_group: | |||||
| # sku: "Classic" | |||||
| # state: | |||||
| # tags: | |||||
| # "env": "prod" | |||||
| # "provisioner": "ansible" | |||||
| ... | |||||
| @@ -1,34 +1,34 @@ | |||||
| - set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | | |||||
| union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', avs.tags | default({})) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get availability set | |||||
| azure_rm_availabilityset_facts: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| resource_group: "{{ avs.resource_group }}" | |||||
| tags: "{{ tags_list | default(omit, true) }}" | |||||
| name: "{{ avs.name | default(omit) }}" | |||||
| register: azure_avs_facts | |||||
| - name: Delete availability set | |||||
| azure_rm_availabilityset: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| name: "{{ avs.name }}" | |||||
| resource_group: "{{ avs.resource_group }}" | |||||
| state: "absent" | |||||
| register: deletedavs | |||||
| ... | |||||
| --- | |||||
| - name: Build tags list | |||||
| set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', avs.tags | default({})) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get availability set | |||||
| azure_rm_availabilityset_info: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ avs.azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| resource_group: "{{ avs.resource_group }}" | |||||
| tags: "{{ tags_list | default(omit, true) }}" | |||||
| name: "{{ avs.name | default(omit) }}" | |||||
| register: azure_avs_facts | |||||
| - name: Delete availability set | |||||
| azure_rm_availabilityset: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ avs.azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| name: "{{ avs.name }}" | |||||
| resource_group: "{{ avs.resource_group }}" | |||||
| state: "absent" | |||||
| register: deletedavs | |||||
| ... | |||||
| @@ -1,25 +1,25 @@ | |||||
| - set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | | |||||
| union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', avs.tags | default({})) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get availability set | |||||
| azure_rm_availabilityset_facts: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| resource_group: "{{ avs.resource_group }}" | |||||
| tags: "{{ tags_list | default(omit, true) }}" | |||||
| name: "{{ avs.name | default(omit, true) }}" | |||||
| register: azure_avs_facts | |||||
| - name: Print availability set | |||||
| debug: | |||||
| var: azure_avs_facts.azure_availabilityset | |||||
| ... | |||||
| --- | |||||
| - name: Build tags list | |||||
| set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', avs.tags | default({})) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get availability set | |||||
| azure_rm_availabilityset_info: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ avs.azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| resource_group: "{{ avs.resource_group }}" | |||||
| tags: "{{ tags_list | default(omit, true) }}" | |||||
| name: "{{ avs.name | default(omit, true) }}" | |||||
| register: azure_avs_facts | |||||
| - name: Print availability set | |||||
| debug: | |||||
| var: azure_avs_facts.azure_availabilityset | |||||
| ... | |||||
| @@ -1,42 +1,40 @@ | |||||
| - name: list availability set | |||||
| include: list.yml | |||||
| vars: | |||||
| avs: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'list' | |||||
| - (avss | default([], true) | length) > 0 | |||||
| with_items: "{{ avss }}" | |||||
| - name: In availability set state | |||||
| include: "{{ item.state | default('present', true) }}.yml" | |||||
| vars: | |||||
| avs: "{{ item }}" | |||||
| when: | |||||
| - action is undefined | |||||
| - (avss | default([], true) | length) > 0 | |||||
| with_items: "{{ avss }}" | |||||
| - name: Update/create availability set | |||||
| include: present.yml | |||||
| vars: | |||||
| avs: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'present' | |||||
| - item.state is undefined | |||||
| - (avss | default([], true) | length) > 0 | |||||
| with_items: "{{ avss }}" | |||||
| - name: Delete availability set | |||||
| include: absent.yml | |||||
| vars: | |||||
| avs: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'absent' | |||||
| - item.state is undefined | |||||
| - (avss | default([], true) | length) > 0 | |||||
| with_items: "{{ avss }}" | |||||
| ... | |||||
| --- | |||||
| - name: list availability set | |||||
| include: list.yml | |||||
| vars: | |||||
| avs: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'list' | |||||
| - (avss | default([], true) | length) > 0 | |||||
| with_items: "{{ avss }}" | |||||
| - name: In availability set state | |||||
| include: "{{ item.state | default('present', true) }}.yml" | |||||
| vars: | |||||
| avs: "{{ item }}" | |||||
| when: | |||||
| - action is undefined | |||||
| - (avss | default([], true) | length) > 0 | |||||
| with_items: "{{ avss }}" | |||||
| - name: Update/create availability set | |||||
| include: present.yml | |||||
| vars: | |||||
| avs: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'present' | |||||
| - (avss | default([], true) | length) > 0 | |||||
| with_items: "{{ avss }}" | |||||
| - name: Delete availability set | |||||
| include: absent.yml | |||||
| vars: | |||||
| avs: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'absent' | |||||
| - (avss | default([], true) | length) > 0 | |||||
| with_items: "{{ avss }}" | |||||
| ... | |||||
| @@ -1,40 +1,40 @@ | |||||
| - set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | | |||||
| union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', avs.tags | default({}, true)) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get availability set | |||||
| azure_rm_availabilityset_facts: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| resource_group: "{{ avs.resource_group }}" | |||||
| tags: "{{ tags_list | default(omit, true) }}" | |||||
| name: "{{ avs.name | default(omit, true) }}" | |||||
| register: azure_avs_facts | |||||
| - name: Create availability set | |||||
| azure_rm_availabilityset: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| name: "{{ avs.name }}" | |||||
| platform_fault_domain_count: "{{ avs.platform_fault_domain_count | default(2, true) }}" | |||||
| platform_update_domain_count: "{{ avs.platform_update_domain_count | default(2, true) }}" | |||||
| sku: "{{ avs.sku | default(omit, true) }}" | |||||
| append_tags: false | |||||
| location: "{{ avs.location | default(omit, true) }}" | |||||
| resource_group: "{{ avs.resource_group }}" | |||||
| state: "present" | |||||
| tags: "{{ avs.tags | default(omit, true) }}" | |||||
| register: createavs | |||||
| ... | |||||
| --- | |||||
| - name: Build tags list | |||||
| set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', avs.tags | default({}, true)) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get availability set | |||||
| azure_rm_availabilityset_info: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| resource_group: "{{ avs.resource_group }}" | |||||
| tags: "{{ tags_list | default(omit, true) }}" | |||||
| name: "{{ avs.name | default(omit, true) }}" | |||||
| register: azure_avs_facts | |||||
| - name: Create availability set | |||||
| azure_rm_availabilityset: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| name: "{{ avs.name }}" | |||||
| platform_fault_domain_count: "{{ avs.platform_fault_domain_count | default(2, true) }}" | |||||
| platform_update_domain_count: "{{ avs.platform_update_domain_count | default(2, true) }}" | |||||
| sku: "{{ avs.sku | default(omit, true) }}" | |||||
| append_tags: false | |||||
| location: "{{ avs.location | default(omit, true) }}" | |||||
| resource_group: "{{ avs.resource_group }}" | |||||
| state: "present" | |||||
| tags: "{{ avs.tags | default(omit, true) }}" | |||||
| register: createavs | |||||
| ... | |||||
| @@ -0,0 +1,674 @@ | |||||
| GNU GENERAL PUBLIC LICENSE | |||||
| Version 3, 29 June 2007 | |||||
| Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> | |||||
| Everyone is permitted to copy and distribute verbatim copies | |||||
| of this license document, but changing it is not allowed. | |||||
| Preamble | |||||
| The GNU General Public License is a free, copyleft license for | |||||
| software and other kinds of works. | |||||
| The licenses for most software and other practical works are designed | |||||
| to take away your freedom to share and change the works. By contrast, | |||||
| the GNU General Public License is intended to guarantee your freedom to | |||||
| share and change all versions of a program--to make sure it remains free | |||||
| software for all its users. We, the Free Software Foundation, use the | |||||
| GNU General Public License for most of our software; it applies also to | |||||
| any other work released this way by its authors. You can apply it to | |||||
| your programs, too. | |||||
| When we speak of free software, we are referring to freedom, not | |||||
| price. Our General Public Licenses are designed to make sure that you | |||||
| have the freedom to distribute copies of free software (and charge for | |||||
| them if you wish), that you receive source code or can get it if you | |||||
| want it, that you can change the software or use pieces of it in new | |||||
| free programs, and that you know you can do these things. | |||||
| To protect your rights, we need to prevent others from denying you | |||||
| these rights or asking you to surrender the rights. Therefore, you have | |||||
| certain responsibilities if you distribute copies of the software, or if | |||||
| you modify it: responsibilities to respect the freedom of others. | |||||
| For example, if you distribute copies of such a program, whether | |||||
| gratis or for a fee, you must pass on to the recipients the same | |||||
| freedoms that you received. You must make sure that they, too, receive | |||||
| or can get the source code. And you must show them these terms so they | |||||
| know their rights. | |||||
| Developers that use the GNU GPL protect your rights with two steps: | |||||
| (1) assert copyright on the software, and (2) offer you this License | |||||
| giving you legal permission to copy, distribute and/or modify it. | |||||
| For the developers' and authors' protection, the GPL clearly explains | |||||
| that there is no warranty for this free software. For both users' and | |||||
| authors' sake, the GPL requires that modified versions be marked as | |||||
| changed, so that their problems will not be attributed erroneously to | |||||
| authors of previous versions. | |||||
| Some devices are designed to deny users access to install or run | |||||
| modified versions of the software inside them, although the manufacturer | |||||
| can do so. This is fundamentally incompatible with the aim of | |||||
| protecting users' freedom to change the software. The systematic | |||||
| pattern of such abuse occurs in the area of products for individuals to | |||||
| use, which is precisely where it is most unacceptable. Therefore, we | |||||
| have designed this version of the GPL to prohibit the practice for those | |||||
| products. If such problems arise substantially in other domains, we | |||||
| stand ready to extend this provision to those domains in future versions | |||||
| of the GPL, as needed to protect the freedom of users. | |||||
| Finally, every program is threatened constantly by software patents. | |||||
| States should not allow patents to restrict development and use of | |||||
| software on general-purpose computers, but in those that do, we wish to | |||||
| avoid the special danger that patents applied to a free program could | |||||
| make it effectively proprietary. To prevent this, the GPL assures that | |||||
| patents cannot be used to render the program non-free. | |||||
| The precise terms and conditions for copying, distribution and | |||||
| modification follow. | |||||
| TERMS AND CONDITIONS | |||||
| 0. Definitions. | |||||
| "This License" refers to version 3 of the GNU General Public License. | |||||
| "Copyright" also means copyright-like laws that apply to other kinds of | |||||
| works, such as semiconductor masks. | |||||
| "The Program" refers to any copyrightable work licensed under this | |||||
| License. Each licensee is addressed as "you". "Licensees" and | |||||
| "recipients" may be individuals or organizations. | |||||
| To "modify" a work means to copy from or adapt all or part of the work | |||||
| in a fashion requiring copyright permission, other than the making of an | |||||
| exact copy. The resulting work is called a "modified version" of the | |||||
| earlier work or a work "based on" the earlier work. | |||||
| A "covered work" means either the unmodified Program or a work based | |||||
| on the Program. | |||||
| To "propagate" a work means to do anything with it that, without | |||||
| permission, would make you directly or secondarily liable for | |||||
| infringement under applicable copyright law, except executing it on a | |||||
| computer or modifying a private copy. Propagation includes copying, | |||||
| distribution (with or without modification), making available to the | |||||
| public, and in some countries other activities as well. | |||||
| To "convey" a work means any kind of propagation that enables other | |||||
| parties to make or receive copies. Mere interaction with a user through | |||||
| a computer network, with no transfer of a copy, is not conveying. | |||||
| An interactive user interface displays "Appropriate Legal Notices" | |||||
| to the extent that it includes a convenient and prominently visible | |||||
| feature that (1) displays an appropriate copyright notice, and (2) | |||||
| tells the user that there is no warranty for the work (except to the | |||||
| extent that warranties are provided), that licensees may convey the | |||||
| work under this License, and how to view a copy of this License. If | |||||
| the interface presents a list of user commands or options, such as a | |||||
| menu, a prominent item in the list meets this criterion. | |||||
| 1. Source Code. | |||||
| The "source code" for a work means the preferred form of the work | |||||
| for making modifications to it. "Object code" means any non-source | |||||
| form of a work. | |||||
| A "Standard Interface" means an interface that either is an official | |||||
| standard defined by a recognized standards body, or, in the case of | |||||
| interfaces specified for a particular programming language, one that | |||||
| is widely used among developers working in that language. | |||||
| The "System Libraries" of an executable work include anything, other | |||||
| than the work as a whole, that (a) is included in the normal form of | |||||
| packaging a Major Component, but which is not part of that Major | |||||
| Component, and (b) serves only to enable use of the work with that | |||||
| Major Component, or to implement a Standard Interface for which an | |||||
| implementation is available to the public in source code form. A | |||||
| "Major Component", in this context, means a major essential component | |||||
| (kernel, window system, and so on) of the specific operating system | |||||
| (if any) on which the executable work runs, or a compiler used to | |||||
| produce the work, or an object code interpreter used to run it. | |||||
| The "Corresponding Source" for a work in object code form means all | |||||
| the source code needed to generate, install, and (for an executable | |||||
| work) run the object code and to modify the work, including scripts to | |||||
| control those activities. However, it does not include the work's | |||||
| System Libraries, or general-purpose tools or generally available free | |||||
| programs which are used unmodified in performing those activities but | |||||
| which are not part of the work. For example, Corresponding Source | |||||
| includes interface definition files associated with source files for | |||||
| the work, and the source code for shared libraries and dynamically | |||||
| linked subprograms that the work is specifically designed to require, | |||||
| such as by intimate data communication or control flow between those | |||||
| subprograms and other parts of the work. | |||||
| The Corresponding Source need not include anything that users | |||||
| can regenerate automatically from other parts of the Corresponding | |||||
| Source. | |||||
| The Corresponding Source for a work in source code form is that | |||||
| same work. | |||||
| 2. Basic Permissions. | |||||
| All rights granted under this License are granted for the term of | |||||
| copyright on the Program, and are irrevocable provided the stated | |||||
| conditions are met. This License explicitly affirms your unlimited | |||||
| permission to run the unmodified Program. The output from running a | |||||
| covered work is covered by this License only if the output, given its | |||||
| content, constitutes a covered work. This License acknowledges your | |||||
| rights of fair use or other equivalent, as provided by copyright law. | |||||
| You may make, run and propagate covered works that you do not | |||||
| convey, without conditions so long as your license otherwise remains | |||||
| in force. You may convey covered works to others for the sole purpose | |||||
| of having them make modifications exclusively for you, or provide you | |||||
| with facilities for running those works, provided that you comply with | |||||
| the terms of this License in conveying all material for which you do | |||||
| not control copyright. Those thus making or running the covered works | |||||
| for you must do so exclusively on your behalf, under your direction | |||||
| and control, on terms that prohibit them from making any copies of | |||||
| your copyrighted material outside their relationship with you. | |||||
| Conveying under any other circumstances is permitted solely under | |||||
| the conditions stated below. Sublicensing is not allowed; section 10 | |||||
| makes it unnecessary. | |||||
| 3. Protecting Users' Legal Rights From Anti-Circumvention Law. | |||||
| No covered work shall be deemed part of an effective technological | |||||
| measure under any applicable law fulfilling obligations under article | |||||
| 11 of the WIPO copyright treaty adopted on 20 December 1996, or | |||||
| similar laws prohibiting or restricting circumvention of such | |||||
| measures. | |||||
| When you convey a covered work, you waive any legal power to forbid | |||||
| circumvention of technological measures to the extent such circumvention | |||||
| is effected by exercising rights under this License with respect to | |||||
| the covered work, and you disclaim any intention to limit operation or | |||||
| modification of the work as a means of enforcing, against the work's | |||||
| users, your or third parties' legal rights to forbid circumvention of | |||||
| technological measures. | |||||
| 4. Conveying Verbatim Copies. | |||||
| You may convey verbatim copies of the Program's source code as you | |||||
| receive it, in any medium, provided that you conspicuously and | |||||
| appropriately publish on each copy an appropriate copyright notice; | |||||
| keep intact all notices stating that this License and any | |||||
| non-permissive terms added in accord with section 7 apply to the code; | |||||
| keep intact all notices of the absence of any warranty; and give all | |||||
| recipients a copy of this License along with the Program. | |||||
| You may charge any price or no price for each copy that you convey, | |||||
| and you may offer support or warranty protection for a fee. | |||||
| 5. Conveying Modified Source Versions. | |||||
| You may convey a work based on the Program, or the modifications to | |||||
| produce it from the Program, in the form of source code under the | |||||
| terms of section 4, provided that you also meet all of these conditions: | |||||
| a) The work must carry prominent notices stating that you modified | |||||
| it, and giving a relevant date. | |||||
| b) The work must carry prominent notices stating that it is | |||||
| released under this License and any conditions added under section | |||||
| 7. This requirement modifies the requirement in section 4 to | |||||
| "keep intact all notices". | |||||
| c) You must license the entire work, as a whole, under this | |||||
| License to anyone who comes into possession of a copy. This | |||||
| License will therefore apply, along with any applicable section 7 | |||||
| additional terms, to the whole of the work, and all its parts, | |||||
| regardless of how they are packaged. This License gives no | |||||
| permission to license the work in any other way, but it does not | |||||
| invalidate such permission if you have separately received it. | |||||
| d) If the work has interactive user interfaces, each must display | |||||
| Appropriate Legal Notices; however, if the Program has interactive | |||||
| interfaces that do not display Appropriate Legal Notices, your | |||||
| work need not make them do so. | |||||
| A compilation of a covered work with other separate and independent | |||||
| works, which are not by their nature extensions of the covered work, | |||||
| and which are not combined with it such as to form a larger program, | |||||
| in or on a volume of a storage or distribution medium, is called an | |||||
| "aggregate" if the compilation and its resulting copyright are not | |||||
| used to limit the access or legal rights of the compilation's users | |||||
| beyond what the individual works permit. Inclusion of a covered work | |||||
| in an aggregate does not cause this License to apply to the other | |||||
| parts of the aggregate. | |||||
| 6. Conveying Non-Source Forms. | |||||
| You may convey a covered work in object code form under the terms | |||||
| of sections 4 and 5, provided that you also convey the | |||||
| machine-readable Corresponding Source under the terms of this License, | |||||
| in one of these ways: | |||||
| a) Convey the object code in, or embodied in, a physical product | |||||
| (including a physical distribution medium), accompanied by the | |||||
| Corresponding Source fixed on a durable physical medium | |||||
| customarily used for software interchange. | |||||
| b) Convey the object code in, or embodied in, a physical product | |||||
| (including a physical distribution medium), accompanied by a | |||||
| written offer, valid for at least three years and valid for as | |||||
| long as you offer spare parts or customer support for that product | |||||
| model, to give anyone who possesses the object code either (1) a | |||||
| copy of the Corresponding Source for all the software in the | |||||
| product that is covered by this License, on a durable physical | |||||
| medium customarily used for software interchange, for a price no | |||||
| more than your reasonable cost of physically performing this | |||||
| conveying of source, or (2) access to copy the | |||||
| Corresponding Source from a network server at no charge. | |||||
| c) Convey individual copies of the object code with a copy of the | |||||
| written offer to provide the Corresponding Source. This | |||||
| alternative is allowed only occasionally and noncommercially, and | |||||
| only if you received the object code with such an offer, in accord | |||||
| with subsection 6b. | |||||
| d) Convey the object code by offering access from a designated | |||||
| place (gratis or for a charge), and offer equivalent access to the | |||||
| Corresponding Source in the same way through the same place at no | |||||
| further charge. You need not require recipients to copy the | |||||
| Corresponding Source along with the object code. If the place to | |||||
| copy the object code is a network server, the Corresponding Source | |||||
| may be on a different server (operated by you or a third party) | |||||
| that supports equivalent copying facilities, provided you maintain | |||||
| clear directions next to the object code saying where to find the | |||||
| Corresponding Source. Regardless of what server hosts the | |||||
| Corresponding Source, you remain obligated to ensure that it is | |||||
| available for as long as needed to satisfy these requirements. | |||||
| e) Convey the object code using peer-to-peer transmission, provided | |||||
| you inform other peers where the object code and Corresponding | |||||
| Source of the work are being offered to the general public at no | |||||
| charge under subsection 6d. | |||||
| A separable portion of the object code, whose source code is excluded | |||||
| from the Corresponding Source as a System Library, need not be | |||||
| included in conveying the object code work. | |||||
| A "User Product" is either (1) a "consumer product", which means any | |||||
| tangible personal property which is normally used for personal, family, | |||||
| or household purposes, or (2) anything designed or sold for incorporation | |||||
| into a dwelling. In determining whether a product is a consumer product, | |||||
| doubtful cases shall be resolved in favor of coverage. For a particular | |||||
| product received by a particular user, "normally used" refers to a | |||||
| typical or common use of that class of product, regardless of the status | |||||
| of the particular user or of the way in which the particular user | |||||
| actually uses, or expects or is expected to use, the product. A product | |||||
| is a consumer product regardless of whether the product has substantial | |||||
| commercial, industrial or non-consumer uses, unless such uses represent | |||||
| the only significant mode of use of the product. | |||||
| "Installation Information" for a User Product means any methods, | |||||
| procedures, authorization keys, or other information required to install | |||||
| and execute modified versions of a covered work in that User Product from | |||||
| a modified version of its Corresponding Source. The information must | |||||
| suffice to ensure that the continued functioning of the modified object | |||||
| code is in no case prevented or interfered with solely because | |||||
| modification has been made. | |||||
| If you convey an object code work under this section in, or with, or | |||||
| specifically for use in, a User Product, and the conveying occurs as | |||||
| part of a transaction in which the right of possession and use of the | |||||
| User Product is transferred to the recipient in perpetuity or for a | |||||
| fixed term (regardless of how the transaction is characterized), the | |||||
| Corresponding Source conveyed under this section must be accompanied | |||||
| by the Installation Information. But this requirement does not apply | |||||
| if neither you nor any third party retains the ability to install | |||||
| modified object code on the User Product (for example, the work has | |||||
| been installed in ROM). | |||||
| The requirement to provide Installation Information does not include a | |||||
| requirement to continue to provide support service, warranty, or updates | |||||
| for a work that has been modified or installed by the recipient, or for | |||||
| the User Product in which it has been modified or installed. Access to a | |||||
| network may be denied when the modification itself materially and | |||||
| adversely affects the operation of the network or violates the rules and | |||||
| protocols for communication across the network. | |||||
| Corresponding Source conveyed, and Installation Information provided, | |||||
| in accord with this section must be in a format that is publicly | |||||
| documented (and with an implementation available to the public in | |||||
| source code form), and must require no special password or key for | |||||
| unpacking, reading or copying. | |||||
| 7. Additional Terms. | |||||
| "Additional permissions" are terms that supplement the terms of this | |||||
| License by making exceptions from one or more of its conditions. | |||||
| Additional permissions that are applicable to the entire Program shall | |||||
| be treated as though they were included in this License, to the extent | |||||
| that they are valid under applicable law. If additional permissions | |||||
| apply only to part of the Program, that part may be used separately | |||||
| under those permissions, but the entire Program remains governed by | |||||
| this License without regard to the additional permissions. | |||||
| When you convey a copy of a covered work, you may at your option | |||||
| remove any additional permissions from that copy, or from any part of | |||||
| it. (Additional permissions may be written to require their own | |||||
| removal in certain cases when you modify the work.) You may place | |||||
| additional permissions on material, added by you to a covered work, | |||||
| for which you have or can give appropriate copyright permission. | |||||
| Notwithstanding any other provision of this License, for material you | |||||
| add to a covered work, you may (if authorized by the copyright holders of | |||||
| that material) supplement the terms of this License with terms: | |||||
| a) Disclaiming warranty or limiting liability differently from the | |||||
| terms of sections 15 and 16 of this License; or | |||||
| b) Requiring preservation of specified reasonable legal notices or | |||||
| author attributions in that material or in the Appropriate Legal | |||||
| Notices displayed by works containing it; or | |||||
| c) Prohibiting misrepresentation of the origin of that material, or | |||||
| requiring that modified versions of such material be marked in | |||||
| reasonable ways as different from the original version; or | |||||
| d) Limiting the use for publicity purposes of names of licensors or | |||||
| authors of the material; or | |||||
| e) Declining to grant rights under trademark law for use of some | |||||
| trade names, trademarks, or service marks; or | |||||
| f) Requiring indemnification of licensors and authors of that | |||||
| material by anyone who conveys the material (or modified versions of | |||||
| it) with contractual assumptions of liability to the recipient, for | |||||
| any liability that these contractual assumptions directly impose on | |||||
| those licensors and authors. | |||||
| All other non-permissive additional terms are considered "further | |||||
| restrictions" within the meaning of section 10. If the Program as you | |||||
| received it, or any part of it, contains a notice stating that it is | |||||
| governed by this License along with a term that is a further | |||||
| restriction, you may remove that term. If a license document contains | |||||
| a further restriction but permits relicensing or conveying under this | |||||
| License, you may add to a covered work material governed by the terms | |||||
| of that license document, provided that the further restriction does | |||||
| not survive such relicensing or conveying. | |||||
| If you add terms to a covered work in accord with this section, you | |||||
| must place, in the relevant source files, a statement of the | |||||
| additional terms that apply to those files, or a notice indicating | |||||
| where to find the applicable terms. | |||||
| Additional terms, permissive or non-permissive, may be stated in the | |||||
| form of a separately written license, or stated as exceptions; | |||||
| the above requirements apply either way. | |||||
| 8. Termination. | |||||
| You may not propagate or modify a covered work except as expressly | |||||
| provided under this License. Any attempt otherwise to propagate or | |||||
| modify it is void, and will automatically terminate your rights under | |||||
| this License (including any patent licenses granted under the third | |||||
| paragraph of section 11). | |||||
| However, if you cease all violation of this License, then your | |||||
| license from a particular copyright holder is reinstated (a) | |||||
| provisionally, unless and until the copyright holder explicitly and | |||||
| finally terminates your license, and (b) permanently, if the copyright | |||||
| holder fails to notify you of the violation by some reasonable means | |||||
| prior to 60 days after the cessation. | |||||
| Moreover, your license from a particular copyright holder is | |||||
| reinstated permanently if the copyright holder notifies you of the | |||||
| violation by some reasonable means, this is the first time you have | |||||
| received notice of violation of this License (for any work) from that | |||||
| copyright holder, and you cure the violation prior to 30 days after | |||||
| your receipt of the notice. | |||||
| Termination of your rights under this section does not terminate the | |||||
| licenses of parties who have received copies or rights from you under | |||||
| this License. If your rights have been terminated and not permanently | |||||
| reinstated, you do not qualify to receive new licenses for the same | |||||
| material under section 10. | |||||
| 9. Acceptance Not Required for Having Copies. | |||||
| You are not required to accept this License in order to receive or | |||||
| run a copy of the Program. Ancillary propagation of a covered work | |||||
| occurring solely as a consequence of using peer-to-peer transmission | |||||
| to receive a copy likewise does not require acceptance. However, | |||||
| nothing other than this License grants you permission to propagate or | |||||
| modify any covered work. These actions infringe copyright if you do | |||||
| not accept this License. Therefore, by modifying or propagating a | |||||
| covered work, you indicate your acceptance of this License to do so. | |||||
| 10. Automatic Licensing of Downstream Recipients. | |||||
| Each time you convey a covered work, the recipient automatically | |||||
| receives a license from the original licensors, to run, modify and | |||||
| propagate that work, subject to this License. You are not responsible | |||||
| for enforcing compliance by third parties with this License. | |||||
| An "entity transaction" is a transaction transferring control of an | |||||
| organization, or substantially all assets of one, or subdividing an | |||||
| organization, or merging organizations. If propagation of a covered | |||||
| work results from an entity transaction, each party to that | |||||
| transaction who receives a copy of the work also receives whatever | |||||
| licenses to the work the party's predecessor in interest had or could | |||||
| give under the previous paragraph, plus a right to possession of the | |||||
| Corresponding Source of the work from the predecessor in interest, if | |||||
| the predecessor has it or can get it with reasonable efforts. | |||||
| You may not impose any further restrictions on the exercise of the | |||||
| rights granted or affirmed under this License. For example, you may | |||||
| not impose a license fee, royalty, or other charge for exercise of | |||||
| rights granted under this License, and you may not initiate litigation | |||||
| (including a cross-claim or counterclaim in a lawsuit) alleging that | |||||
| any patent claim is infringed by making, using, selling, offering for | |||||
| sale, or importing the Program or any portion of it. | |||||
| 11. Patents. | |||||
| A "contributor" is a copyright holder who authorizes use under this | |||||
| License of the Program or a work on which the Program is based. The | |||||
| work thus licensed is called the contributor's "contributor version". | |||||
| A contributor's "essential patent claims" are all patent claims | |||||
| owned or controlled by the contributor, whether already acquired or | |||||
| hereafter acquired, that would be infringed by some manner, permitted | |||||
| by this License, of making, using, or selling its contributor version, | |||||
| but do not include claims that would be infringed only as a | |||||
| consequence of further modification of the contributor version. For | |||||
| purposes of this definition, "control" includes the right to grant | |||||
| patent sublicenses in a manner consistent with the requirements of | |||||
| this License. | |||||
| Each contributor grants you a non-exclusive, worldwide, royalty-free | |||||
| patent license under the contributor's essential patent claims, to | |||||
| make, use, sell, offer for sale, import and otherwise run, modify and | |||||
| propagate the contents of its contributor version. | |||||
| In the following three paragraphs, a "patent license" is any express | |||||
| agreement or commitment, however denominated, not to enforce a patent | |||||
| (such as an express permission to practice a patent or covenant not to | |||||
| sue for patent infringement). To "grant" such a patent license to a | |||||
| party means to make such an agreement or commitment not to enforce a | |||||
| patent against the party. | |||||
| If you convey a covered work, knowingly relying on a patent license, | |||||
| and the Corresponding Source of the work is not available for anyone | |||||
| to copy, free of charge and under the terms of this License, through a | |||||
| publicly available network server or other readily accessible means, | |||||
| then you must either (1) cause the Corresponding Source to be so | |||||
| available, or (2) arrange to deprive yourself of the benefit of the | |||||
| patent license for this particular work, or (3) arrange, in a manner | |||||
| consistent with the requirements of this License, to extend the patent | |||||
| license to downstream recipients. "Knowingly relying" means you have | |||||
| actual knowledge that, but for the patent license, your conveying the | |||||
| covered work in a country, or your recipient's use of the covered work | |||||
| in a country, would infringe one or more identifiable patents in that | |||||
| country that you have reason to believe are valid. | |||||
| If, pursuant to or in connection with a single transaction or | |||||
| arrangement, you convey, or propagate by procuring conveyance of, a | |||||
| covered work, and grant a patent license to some of the parties | |||||
| receiving the covered work authorizing them to use, propagate, modify | |||||
| or convey a specific copy of the covered work, then the patent license | |||||
| you grant is automatically extended to all recipients of the covered | |||||
| work and works based on it. | |||||
| A patent license is "discriminatory" if it does not include within | |||||
| the scope of its coverage, prohibits the exercise of, or is | |||||
| conditioned on the non-exercise of one or more of the rights that are | |||||
| specifically granted under this License. You may not convey a covered | |||||
| work if you are a party to an arrangement with a third party that is | |||||
| in the business of distributing software, under which you make payment | |||||
| to the third party based on the extent of your activity of conveying | |||||
| the work, and under which the third party grants, to any of the | |||||
| parties who would receive the covered work from you, a discriminatory | |||||
| patent license (a) in connection with copies of the covered work | |||||
| conveyed by you (or copies made from those copies), or (b) primarily | |||||
| for and in connection with specific products or compilations that | |||||
| contain the covered work, unless you entered into that arrangement, | |||||
| or that patent license was granted, prior to 28 March 2007. | |||||
| Nothing in this License shall be construed as excluding or limiting | |||||
| any implied license or other defenses to infringement that may | |||||
| otherwise be available to you under applicable patent law. | |||||
| 12. No Surrender of Others' Freedom. | |||||
| If conditions are imposed on you (whether by court order, agreement or | |||||
| otherwise) that contradict the conditions of this License, they do not | |||||
| excuse you from the conditions of this License. If you cannot convey a | |||||
| covered work so as to satisfy simultaneously your obligations under this | |||||
| License and any other pertinent obligations, then as a consequence you may | |||||
| not convey it at all. For example, if you agree to terms that obligate you | |||||
| to collect a royalty for further conveying from those to whom you convey | |||||
| the Program, the only way you could satisfy both those terms and this | |||||
| License would be to refrain entirely from conveying the Program. | |||||
| 13. Use with the GNU Affero General Public License. | |||||
| Notwithstanding any other provision of this License, you have | |||||
| permission to link or combine any covered work with a work licensed | |||||
| under version 3 of the GNU Affero General Public License into a single | |||||
| combined work, and to convey the resulting work. The terms of this | |||||
| License will continue to apply to the part which is the covered work, | |||||
| but the special requirements of the GNU Affero General Public License, | |||||
| section 13, concerning interaction through a network will apply to the | |||||
| combination as such. | |||||
| 14. Revised Versions of this License. | |||||
| The Free Software Foundation may publish revised and/or new versions of | |||||
| the GNU General Public License from time to time. Such new versions will | |||||
| be similar in spirit to the present version, but may differ in detail to | |||||
| address new problems or concerns. | |||||
| Each version is given a distinguishing version number. If the | |||||
| Program specifies that a certain numbered version of the GNU General | |||||
| Public License "or any later version" applies to it, you have the | |||||
| option of following the terms and conditions either of that numbered | |||||
| version or of any later version published by the Free Software | |||||
| Foundation. If the Program does not specify a version number of the | |||||
| GNU General Public License, you may choose any version ever published | |||||
| by the Free Software Foundation. | |||||
| If the Program specifies that a proxy can decide which future | |||||
| versions of the GNU General Public License can be used, that proxy's | |||||
| public statement of acceptance of a version permanently authorizes you | |||||
| to choose that version for the Program. | |||||
| Later license versions may give you additional or different | |||||
| permissions. However, no additional obligations are imposed on any | |||||
| author or copyright holder as a result of your choosing to follow a | |||||
| later version. | |||||
| 15. Disclaimer of Warranty. | |||||
| THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY | |||||
| APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT | |||||
| HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY | |||||
| OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, | |||||
| THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |||||
| PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM | |||||
| IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF | |||||
| ALL NECESSARY SERVICING, REPAIR OR CORRECTION. | |||||
| 16. Limitation of Liability. | |||||
| IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING | |||||
| WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS | |||||
| THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY | |||||
| GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE | |||||
| USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF | |||||
| DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD | |||||
| PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), | |||||
| EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF | |||||
| SUCH DAMAGES. | |||||
| 17. Interpretation of Sections 15 and 16. | |||||
| If the disclaimer of warranty and limitation of liability provided | |||||
| above cannot be given local legal effect according to their terms, | |||||
| reviewing courts shall apply local law that most closely approximates | |||||
| an absolute waiver of all civil liability in connection with the | |||||
| Program, unless a warranty or assumption of liability accompanies a | |||||
| copy of the Program in return for a fee. | |||||
| END OF TERMS AND CONDITIONS | |||||
| How to Apply These Terms to Your New Programs | |||||
| If you develop a new program, and you want it to be of the greatest | |||||
| possible use to the public, the best way to achieve this is to make it | |||||
| free software which everyone can redistribute and change under these terms. | |||||
| To do so, attach the following notices to the program. It is safest | |||||
| to attach them to the start of each source file to most effectively | |||||
| state the exclusion of warranty; and each file should have at least | |||||
| the "copyright" line and a pointer to where the full notice is found. | |||||
| <one line to give the program's name and a brief idea of what it does.> | |||||
| Copyright (C) <year> <name of author> | |||||
| This program is free software: you can redistribute it and/or modify | |||||
| it under the terms of the GNU General Public License as published by | |||||
| the Free Software Foundation, either version 3 of the License, or | |||||
| (at your option) any later version. | |||||
| This program is distributed in the hope that it will be useful, | |||||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
| GNU General Public License for more details. | |||||
| You should have received a copy of the GNU General Public License | |||||
| along with this program. If not, see <https://www.gnu.org/licenses/>. | |||||
| Also add information on how to contact you by electronic and paper mail. | |||||
| If the program does terminal interaction, make it output a short | |||||
| notice like this when it starts in an interactive mode: | |||||
| <program> Copyright (C) <year> <name of author> | |||||
| This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. | |||||
| This is free software, and you are welcome to redistribute it | |||||
| under certain conditions; type `show c' for details. | |||||
| The hypothetical commands `show w' and `show c' should show the appropriate | |||||
| parts of the General Public License. Of course, your program's commands | |||||
| might be different; for a GUI interface, you would use an "about box". | |||||
| You should also get your employer (if you work as a programmer) or school, | |||||
| if any, to sign a "copyright disclaimer" for the program, if necessary. | |||||
| For more information on this, and how to apply and follow the GNU GPL, see | |||||
| <https://www.gnu.org/licenses/>. | |||||
| The GNU General Public License does not permit incorporating your program | |||||
| into proprietary programs. If your program is a subroutine library, you | |||||
| may consider it more useful to permit linking proprietary applications with | |||||
| the library. If this is what you want to do, use the GNU Lesser General | |||||
| Public License instead of this License. But first, please read | |||||
| <https://www.gnu.org/licenses/why-not-lgpl.html>. | |||||
| @@ -0,0 +1,2 @@ | |||||
| # azure_bp | |||||
| Manage Azure backendpool | |||||
| @@ -0,0 +1,11 @@ | |||||
| --- | |||||
| #bps: | |||||
| # - name: | |||||
| # resource_group: | |||||
| # virtual_network: | |||||
| # state: | |||||
| # body: | |||||
| # method: | |||||
| # subresource: | |||||
| # status_code: | |||||
| ... | |||||
| @@ -0,0 +1,13 @@ | |||||
| --- | |||||
| - name: Delete backendpool | |||||
| azure_rm_resource: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| url: "https://management.azure.com/subscriptions/{{ subscription_id }}/resourceGroups/{{ resourcegroup }}/providers/Microsoft.Network/loadBalancers/{{ bp.lbname }}/backendAddressPools/{{ bp.name }}?api-version=2021-02-01" | |||||
| state: "absent" | |||||
| register: deletebp | |||||
| ... | |||||
| @@ -0,0 +1,30 @@ | |||||
| --- | |||||
| - name: In backendpool state | |||||
| include: "{{ item.state | default('present', true) }}.yml" | |||||
| vars: | |||||
| bp: "{{ item }}" | |||||
| when: | |||||
| - action is undefined | |||||
| - (bps | default([], true) | length) > 0 | |||||
| with_items: "{{ bps }}" | |||||
| - name: Update/create backendpool | |||||
| include: present.yml | |||||
| vars: | |||||
| bp: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'present' | |||||
| - (bps | default([], true) | length) > 0 | |||||
| with_items: "{{ bps }}" | |||||
| - name: Delete backendpool | |||||
| include: absent.yml | |||||
| vars: | |||||
| bp: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'absent' | |||||
| - (bps | default([], true) | length) > 0 | |||||
| with_items: "{{ bps }}" | |||||
| ... | |||||
| @@ -0,0 +1,24 @@ | |||||
| --- | |||||
| - name: load template | |||||
| template: | |||||
| src: azure_backendpool.j2 | |||||
| dest: /tmp/azure_backendpool_body.json | |||||
| changed_when: false | |||||
| - name: Create backendpool | |||||
| azure_rm_resource: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| url: "https://management.azure.com/subscriptions/{{ subscription_id }}/resourceGroups/{{ resourcegroup }}/providers/Microsoft.Network/loadBalancers/{{ bp.lbname }}/backendAddressPools/{{ bp.name }}?api-version=2021-02-01" | |||||
| idempotency: true | |||||
| body: "{{ lookup('file', '/tmp/azure_backendpool_body.json') }}" | |||||
| method: "{{ bp.method | default(omit, true) }}" | |||||
| subresource: "{{ bp.subresource | default(omit, true) }}" | |||||
| status_code: "{{ bp.status_code | default(omit, true) }}" | |||||
| state: "present" | |||||
| register: createbp | |||||
| ... | |||||
| @@ -0,0 +1,674 @@ | |||||
| GNU GENERAL PUBLIC LICENSE | |||||
| Version 3, 29 June 2007 | |||||
| Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> | |||||
| Everyone is permitted to copy and distribute verbatim copies | |||||
| of this license document, but changing it is not allowed. | |||||
| Preamble | |||||
| The GNU General Public License is a free, copyleft license for | |||||
| software and other kinds of works. | |||||
| The licenses for most software and other practical works are designed | |||||
| to take away your freedom to share and change the works. By contrast, | |||||
| the GNU General Public License is intended to guarantee your freedom to | |||||
| share and change all versions of a program--to make sure it remains free | |||||
| software for all its users. We, the Free Software Foundation, use the | |||||
| GNU General Public License for most of our software; it applies also to | |||||
| any other work released this way by its authors. You can apply it to | |||||
| your programs, too. | |||||
| When we speak of free software, we are referring to freedom, not | |||||
| price. Our General Public Licenses are designed to make sure that you | |||||
| have the freedom to distribute copies of free software (and charge for | |||||
| them if you wish), that you receive source code or can get it if you | |||||
| want it, that you can change the software or use pieces of it in new | |||||
| free programs, and that you know you can do these things. | |||||
| To protect your rights, we need to prevent others from denying you | |||||
| these rights or asking you to surrender the rights. Therefore, you have | |||||
| certain responsibilities if you distribute copies of the software, or if | |||||
| you modify it: responsibilities to respect the freedom of others. | |||||
| For example, if you distribute copies of such a program, whether | |||||
| gratis or for a fee, you must pass on to the recipients the same | |||||
| freedoms that you received. You must make sure that they, too, receive | |||||
| or can get the source code. And you must show them these terms so they | |||||
| know their rights. | |||||
| Developers that use the GNU GPL protect your rights with two steps: | |||||
| (1) assert copyright on the software, and (2) offer you this License | |||||
| giving you legal permission to copy, distribute and/or modify it. | |||||
| For the developers' and authors' protection, the GPL clearly explains | |||||
| that there is no warranty for this free software. For both users' and | |||||
| authors' sake, the GPL requires that modified versions be marked as | |||||
| changed, so that their problems will not be attributed erroneously to | |||||
| authors of previous versions. | |||||
| Some devices are designed to deny users access to install or run | |||||
| modified versions of the software inside them, although the manufacturer | |||||
| can do so. This is fundamentally incompatible with the aim of | |||||
| protecting users' freedom to change the software. The systematic | |||||
| pattern of such abuse occurs in the area of products for individuals to | |||||
| use, which is precisely where it is most unacceptable. Therefore, we | |||||
| have designed this version of the GPL to prohibit the practice for those | |||||
| products. If such problems arise substantially in other domains, we | |||||
| stand ready to extend this provision to those domains in future versions | |||||
| of the GPL, as needed to protect the freedom of users. | |||||
| Finally, every program is threatened constantly by software patents. | |||||
| States should not allow patents to restrict development and use of | |||||
| software on general-purpose computers, but in those that do, we wish to | |||||
| avoid the special danger that patents applied to a free program could | |||||
| make it effectively proprietary. To prevent this, the GPL assures that | |||||
| patents cannot be used to render the program non-free. | |||||
| The precise terms and conditions for copying, distribution and | |||||
| modification follow. | |||||
| TERMS AND CONDITIONS | |||||
| 0. Definitions. | |||||
| "This License" refers to version 3 of the GNU General Public License. | |||||
| "Copyright" also means copyright-like laws that apply to other kinds of | |||||
| works, such as semiconductor masks. | |||||
| "The Program" refers to any copyrightable work licensed under this | |||||
| License. Each licensee is addressed as "you". "Licensees" and | |||||
| "recipients" may be individuals or organizations. | |||||
| To "modify" a work means to copy from or adapt all or part of the work | |||||
| in a fashion requiring copyright permission, other than the making of an | |||||
| exact copy. The resulting work is called a "modified version" of the | |||||
| earlier work or a work "based on" the earlier work. | |||||
| A "covered work" means either the unmodified Program or a work based | |||||
| on the Program. | |||||
| To "propagate" a work means to do anything with it that, without | |||||
| permission, would make you directly or secondarily liable for | |||||
| infringement under applicable copyright law, except executing it on a | |||||
| computer or modifying a private copy. Propagation includes copying, | |||||
| distribution (with or without modification), making available to the | |||||
| public, and in some countries other activities as well. | |||||
| To "convey" a work means any kind of propagation that enables other | |||||
| parties to make or receive copies. Mere interaction with a user through | |||||
| a computer network, with no transfer of a copy, is not conveying. | |||||
| An interactive user interface displays "Appropriate Legal Notices" | |||||
| to the extent that it includes a convenient and prominently visible | |||||
| feature that (1) displays an appropriate copyright notice, and (2) | |||||
| tells the user that there is no warranty for the work (except to the | |||||
| extent that warranties are provided), that licensees may convey the | |||||
| work under this License, and how to view a copy of this License. If | |||||
| the interface presents a list of user commands or options, such as a | |||||
| menu, a prominent item in the list meets this criterion. | |||||
| 1. Source Code. | |||||
| The "source code" for a work means the preferred form of the work | |||||
| for making modifications to it. "Object code" means any non-source | |||||
| form of a work. | |||||
| A "Standard Interface" means an interface that either is an official | |||||
| standard defined by a recognized standards body, or, in the case of | |||||
| interfaces specified for a particular programming language, one that | |||||
| is widely used among developers working in that language. | |||||
| The "System Libraries" of an executable work include anything, other | |||||
| than the work as a whole, that (a) is included in the normal form of | |||||
| packaging a Major Component, but which is not part of that Major | |||||
| Component, and (b) serves only to enable use of the work with that | |||||
| Major Component, or to implement a Standard Interface for which an | |||||
| implementation is available to the public in source code form. A | |||||
| "Major Component", in this context, means a major essential component | |||||
| (kernel, window system, and so on) of the specific operating system | |||||
| (if any) on which the executable work runs, or a compiler used to | |||||
| produce the work, or an object code interpreter used to run it. | |||||
| The "Corresponding Source" for a work in object code form means all | |||||
| the source code needed to generate, install, and (for an executable | |||||
| work) run the object code and to modify the work, including scripts to | |||||
| control those activities. However, it does not include the work's | |||||
| System Libraries, or general-purpose tools or generally available free | |||||
| programs which are used unmodified in performing those activities but | |||||
| which are not part of the work. For example, Corresponding Source | |||||
| includes interface definition files associated with source files for | |||||
| the work, and the source code for shared libraries and dynamically | |||||
| linked subprograms that the work is specifically designed to require, | |||||
| such as by intimate data communication or control flow between those | |||||
| subprograms and other parts of the work. | |||||
| The Corresponding Source need not include anything that users | |||||
| can regenerate automatically from other parts of the Corresponding | |||||
| Source. | |||||
| The Corresponding Source for a work in source code form is that | |||||
| same work. | |||||
| 2. Basic Permissions. | |||||
| All rights granted under this License are granted for the term of | |||||
| copyright on the Program, and are irrevocable provided the stated | |||||
| conditions are met. This License explicitly affirms your unlimited | |||||
| permission to run the unmodified Program. The output from running a | |||||
| covered work is covered by this License only if the output, given its | |||||
| content, constitutes a covered work. This License acknowledges your | |||||
| rights of fair use or other equivalent, as provided by copyright law. | |||||
| You may make, run and propagate covered works that you do not | |||||
| convey, without conditions so long as your license otherwise remains | |||||
| in force. You may convey covered works to others for the sole purpose | |||||
| of having them make modifications exclusively for you, or provide you | |||||
| with facilities for running those works, provided that you comply with | |||||
| the terms of this License in conveying all material for which you do | |||||
| not control copyright. Those thus making or running the covered works | |||||
| for you must do so exclusively on your behalf, under your direction | |||||
| and control, on terms that prohibit them from making any copies of | |||||
| your copyrighted material outside their relationship with you. | |||||
| Conveying under any other circumstances is permitted solely under | |||||
| the conditions stated below. Sublicensing is not allowed; section 10 | |||||
| makes it unnecessary. | |||||
| 3. Protecting Users' Legal Rights From Anti-Circumvention Law. | |||||
| No covered work shall be deemed part of an effective technological | |||||
| measure under any applicable law fulfilling obligations under article | |||||
| 11 of the WIPO copyright treaty adopted on 20 December 1996, or | |||||
| similar laws prohibiting or restricting circumvention of such | |||||
| measures. | |||||
| When you convey a covered work, you waive any legal power to forbid | |||||
| circumvention of technological measures to the extent such circumvention | |||||
| is effected by exercising rights under this License with respect to | |||||
| the covered work, and you disclaim any intention to limit operation or | |||||
| modification of the work as a means of enforcing, against the work's | |||||
| users, your or third parties' legal rights to forbid circumvention of | |||||
| technological measures. | |||||
| 4. Conveying Verbatim Copies. | |||||
| You may convey verbatim copies of the Program's source code as you | |||||
| receive it, in any medium, provided that you conspicuously and | |||||
| appropriately publish on each copy an appropriate copyright notice; | |||||
| keep intact all notices stating that this License and any | |||||
| non-permissive terms added in accord with section 7 apply to the code; | |||||
| keep intact all notices of the absence of any warranty; and give all | |||||
| recipients a copy of this License along with the Program. | |||||
| You may charge any price or no price for each copy that you convey, | |||||
| and you may offer support or warranty protection for a fee. | |||||
| 5. Conveying Modified Source Versions. | |||||
| You may convey a work based on the Program, or the modifications to | |||||
| produce it from the Program, in the form of source code under the | |||||
| terms of section 4, provided that you also meet all of these conditions: | |||||
| a) The work must carry prominent notices stating that you modified | |||||
| it, and giving a relevant date. | |||||
| b) The work must carry prominent notices stating that it is | |||||
| released under this License and any conditions added under section | |||||
| 7. This requirement modifies the requirement in section 4 to | |||||
| "keep intact all notices". | |||||
| c) You must license the entire work, as a whole, under this | |||||
| License to anyone who comes into possession of a copy. This | |||||
| License will therefore apply, along with any applicable section 7 | |||||
| additional terms, to the whole of the work, and all its parts, | |||||
| regardless of how they are packaged. This License gives no | |||||
| permission to license the work in any other way, but it does not | |||||
| invalidate such permission if you have separately received it. | |||||
| d) If the work has interactive user interfaces, each must display | |||||
| Appropriate Legal Notices; however, if the Program has interactive | |||||
| interfaces that do not display Appropriate Legal Notices, your | |||||
| work need not make them do so. | |||||
| A compilation of a covered work with other separate and independent | |||||
| works, which are not by their nature extensions of the covered work, | |||||
| and which are not combined with it such as to form a larger program, | |||||
| in or on a volume of a storage or distribution medium, is called an | |||||
| "aggregate" if the compilation and its resulting copyright are not | |||||
| used to limit the access or legal rights of the compilation's users | |||||
| beyond what the individual works permit. Inclusion of a covered work | |||||
| in an aggregate does not cause this License to apply to the other | |||||
| parts of the aggregate. | |||||
| 6. Conveying Non-Source Forms. | |||||
| You may convey a covered work in object code form under the terms | |||||
| of sections 4 and 5, provided that you also convey the | |||||
| machine-readable Corresponding Source under the terms of this License, | |||||
| in one of these ways: | |||||
| a) Convey the object code in, or embodied in, a physical product | |||||
| (including a physical distribution medium), accompanied by the | |||||
| Corresponding Source fixed on a durable physical medium | |||||
| customarily used for software interchange. | |||||
| b) Convey the object code in, or embodied in, a physical product | |||||
| (including a physical distribution medium), accompanied by a | |||||
| written offer, valid for at least three years and valid for as | |||||
| long as you offer spare parts or customer support for that product | |||||
| model, to give anyone who possesses the object code either (1) a | |||||
| copy of the Corresponding Source for all the software in the | |||||
| product that is covered by this License, on a durable physical | |||||
| medium customarily used for software interchange, for a price no | |||||
| more than your reasonable cost of physically performing this | |||||
| conveying of source, or (2) access to copy the | |||||
| Corresponding Source from a network server at no charge. | |||||
| c) Convey individual copies of the object code with a copy of the | |||||
| written offer to provide the Corresponding Source. This | |||||
| alternative is allowed only occasionally and noncommercially, and | |||||
| only if you received the object code with such an offer, in accord | |||||
| with subsection 6b. | |||||
| d) Convey the object code by offering access from a designated | |||||
| place (gratis or for a charge), and offer equivalent access to the | |||||
| Corresponding Source in the same way through the same place at no | |||||
| further charge. You need not require recipients to copy the | |||||
| Corresponding Source along with the object code. If the place to | |||||
| copy the object code is a network server, the Corresponding Source | |||||
| may be on a different server (operated by you or a third party) | |||||
| that supports equivalent copying facilities, provided you maintain | |||||
| clear directions next to the object code saying where to find the | |||||
| Corresponding Source. Regardless of what server hosts the | |||||
| Corresponding Source, you remain obligated to ensure that it is | |||||
| available for as long as needed to satisfy these requirements. | |||||
| e) Convey the object code using peer-to-peer transmission, provided | |||||
| you inform other peers where the object code and Corresponding | |||||
| Source of the work are being offered to the general public at no | |||||
| charge under subsection 6d. | |||||
| A separable portion of the object code, whose source code is excluded | |||||
| from the Corresponding Source as a System Library, need not be | |||||
| included in conveying the object code work. | |||||
| A "User Product" is either (1) a "consumer product", which means any | |||||
| tangible personal property which is normally used for personal, family, | |||||
| or household purposes, or (2) anything designed or sold for incorporation | |||||
| into a dwelling. In determining whether a product is a consumer product, | |||||
| doubtful cases shall be resolved in favor of coverage. For a particular | |||||
| product received by a particular user, "normally used" refers to a | |||||
| typical or common use of that class of product, regardless of the status | |||||
| of the particular user or of the way in which the particular user | |||||
| actually uses, or expects or is expected to use, the product. A product | |||||
| is a consumer product regardless of whether the product has substantial | |||||
| commercial, industrial or non-consumer uses, unless such uses represent | |||||
| the only significant mode of use of the product. | |||||
| "Installation Information" for a User Product means any methods, | |||||
| procedures, authorization keys, or other information required to install | |||||
| and execute modified versions of a covered work in that User Product from | |||||
| a modified version of its Corresponding Source. The information must | |||||
| suffice to ensure that the continued functioning of the modified object | |||||
| code is in no case prevented or interfered with solely because | |||||
| modification has been made. | |||||
| If you convey an object code work under this section in, or with, or | |||||
| specifically for use in, a User Product, and the conveying occurs as | |||||
| part of a transaction in which the right of possession and use of the | |||||
| User Product is transferred to the recipient in perpetuity or for a | |||||
| fixed term (regardless of how the transaction is characterized), the | |||||
| Corresponding Source conveyed under this section must be accompanied | |||||
| by the Installation Information. But this requirement does not apply | |||||
| if neither you nor any third party retains the ability to install | |||||
| modified object code on the User Product (for example, the work has | |||||
| been installed in ROM). | |||||
| The requirement to provide Installation Information does not include a | |||||
| requirement to continue to provide support service, warranty, or updates | |||||
| for a work that has been modified or installed by the recipient, or for | |||||
| the User Product in which it has been modified or installed. Access to a | |||||
| network may be denied when the modification itself materially and | |||||
| adversely affects the operation of the network or violates the rules and | |||||
| protocols for communication across the network. | |||||
| Corresponding Source conveyed, and Installation Information provided, | |||||
| in accord with this section must be in a format that is publicly | |||||
| documented (and with an implementation available to the public in | |||||
| source code form), and must require no special password or key for | |||||
| unpacking, reading or copying. | |||||
| 7. Additional Terms. | |||||
| "Additional permissions" are terms that supplement the terms of this | |||||
| License by making exceptions from one or more of its conditions. | |||||
| Additional permissions that are applicable to the entire Program shall | |||||
| be treated as though they were included in this License, to the extent | |||||
| that they are valid under applicable law. If additional permissions | |||||
| apply only to part of the Program, that part may be used separately | |||||
| under those permissions, but the entire Program remains governed by | |||||
| this License without regard to the additional permissions. | |||||
| When you convey a copy of a covered work, you may at your option | |||||
| remove any additional permissions from that copy, or from any part of | |||||
| it. (Additional permissions may be written to require their own | |||||
| removal in certain cases when you modify the work.) You may place | |||||
| additional permissions on material, added by you to a covered work, | |||||
| for which you have or can give appropriate copyright permission. | |||||
| Notwithstanding any other provision of this License, for material you | |||||
| add to a covered work, you may (if authorized by the copyright holders of | |||||
| that material) supplement the terms of this License with terms: | |||||
| a) Disclaiming warranty or limiting liability differently from the | |||||
| terms of sections 15 and 16 of this License; or | |||||
| b) Requiring preservation of specified reasonable legal notices or | |||||
| author attributions in that material or in the Appropriate Legal | |||||
| Notices displayed by works containing it; or | |||||
| c) Prohibiting misrepresentation of the origin of that material, or | |||||
| requiring that modified versions of such material be marked in | |||||
| reasonable ways as different from the original version; or | |||||
| d) Limiting the use for publicity purposes of names of licensors or | |||||
| authors of the material; or | |||||
| e) Declining to grant rights under trademark law for use of some | |||||
| trade names, trademarks, or service marks; or | |||||
| f) Requiring indemnification of licensors and authors of that | |||||
| material by anyone who conveys the material (or modified versions of | |||||
| it) with contractual assumptions of liability to the recipient, for | |||||
| any liability that these contractual assumptions directly impose on | |||||
| those licensors and authors. | |||||
| All other non-permissive additional terms are considered "further | |||||
| restrictions" within the meaning of section 10. If the Program as you | |||||
| received it, or any part of it, contains a notice stating that it is | |||||
| governed by this License along with a term that is a further | |||||
| restriction, you may remove that term. If a license document contains | |||||
| a further restriction but permits relicensing or conveying under this | |||||
| License, you may add to a covered work material governed by the terms | |||||
| of that license document, provided that the further restriction does | |||||
| not survive such relicensing or conveying. | |||||
| If you add terms to a covered work in accord with this section, you | |||||
| must place, in the relevant source files, a statement of the | |||||
| additional terms that apply to those files, or a notice indicating | |||||
| where to find the applicable terms. | |||||
| Additional terms, permissive or non-permissive, may be stated in the | |||||
| form of a separately written license, or stated as exceptions; | |||||
| the above requirements apply either way. | |||||
| 8. Termination. | |||||
| You may not propagate or modify a covered work except as expressly | |||||
| provided under this License. Any attempt otherwise to propagate or | |||||
| modify it is void, and will automatically terminate your rights under | |||||
| this License (including any patent licenses granted under the third | |||||
| paragraph of section 11). | |||||
| However, if you cease all violation of this License, then your | |||||
| license from a particular copyright holder is reinstated (a) | |||||
| provisionally, unless and until the copyright holder explicitly and | |||||
| finally terminates your license, and (b) permanently, if the copyright | |||||
| holder fails to notify you of the violation by some reasonable means | |||||
| prior to 60 days after the cessation. | |||||
| Moreover, your license from a particular copyright holder is | |||||
| reinstated permanently if the copyright holder notifies you of the | |||||
| violation by some reasonable means, this is the first time you have | |||||
| received notice of violation of this License (for any work) from that | |||||
| copyright holder, and you cure the violation prior to 30 days after | |||||
| your receipt of the notice. | |||||
| Termination of your rights under this section does not terminate the | |||||
| licenses of parties who have received copies or rights from you under | |||||
| this License. If your rights have been terminated and not permanently | |||||
| reinstated, you do not qualify to receive new licenses for the same | |||||
| material under section 10. | |||||
| 9. Acceptance Not Required for Having Copies. | |||||
| You are not required to accept this License in order to receive or | |||||
| run a copy of the Program. Ancillary propagation of a covered work | |||||
| occurring solely as a consequence of using peer-to-peer transmission | |||||
| to receive a copy likewise does not require acceptance. However, | |||||
| nothing other than this License grants you permission to propagate or | |||||
| modify any covered work. These actions infringe copyright if you do | |||||
| not accept this License. Therefore, by modifying or propagating a | |||||
| covered work, you indicate your acceptance of this License to do so. | |||||
| 10. Automatic Licensing of Downstream Recipients. | |||||
| Each time you convey a covered work, the recipient automatically | |||||
| receives a license from the original licensors, to run, modify and | |||||
| propagate that work, subject to this License. You are not responsible | |||||
| for enforcing compliance by third parties with this License. | |||||
| An "entity transaction" is a transaction transferring control of an | |||||
| organization, or substantially all assets of one, or subdividing an | |||||
| organization, or merging organizations. If propagation of a covered | |||||
| work results from an entity transaction, each party to that | |||||
| transaction who receives a copy of the work also receives whatever | |||||
| licenses to the work the party's predecessor in interest had or could | |||||
| give under the previous paragraph, plus a right to possession of the | |||||
| Corresponding Source of the work from the predecessor in interest, if | |||||
| the predecessor has it or can get it with reasonable efforts. | |||||
| You may not impose any further restrictions on the exercise of the | |||||
| rights granted or affirmed under this License. For example, you may | |||||
| not impose a license fee, royalty, or other charge for exercise of | |||||
| rights granted under this License, and you may not initiate litigation | |||||
| (including a cross-claim or counterclaim in a lawsuit) alleging that | |||||
| any patent claim is infringed by making, using, selling, offering for | |||||
| sale, or importing the Program or any portion of it. | |||||
| 11. Patents. | |||||
| A "contributor" is a copyright holder who authorizes use under this | |||||
| License of the Program or a work on which the Program is based. The | |||||
| work thus licensed is called the contributor's "contributor version". | |||||
| A contributor's "essential patent claims" are all patent claims | |||||
| owned or controlled by the contributor, whether already acquired or | |||||
| hereafter acquired, that would be infringed by some manner, permitted | |||||
| by this License, of making, using, or selling its contributor version, | |||||
| but do not include claims that would be infringed only as a | |||||
| consequence of further modification of the contributor version. For | |||||
| purposes of this definition, "control" includes the right to grant | |||||
| patent sublicenses in a manner consistent with the requirements of | |||||
| this License. | |||||
| Each contributor grants you a non-exclusive, worldwide, royalty-free | |||||
| patent license under the contributor's essential patent claims, to | |||||
| make, use, sell, offer for sale, import and otherwise run, modify and | |||||
| propagate the contents of its contributor version. | |||||
| In the following three paragraphs, a "patent license" is any express | |||||
| agreement or commitment, however denominated, not to enforce a patent | |||||
| (such as an express permission to practice a patent or covenant not to | |||||
| sue for patent infringement). To "grant" such a patent license to a | |||||
| party means to make such an agreement or commitment not to enforce a | |||||
| patent against the party. | |||||
| If you convey a covered work, knowingly relying on a patent license, | |||||
| and the Corresponding Source of the work is not available for anyone | |||||
| to copy, free of charge and under the terms of this License, through a | |||||
| publicly available network server or other readily accessible means, | |||||
| then you must either (1) cause the Corresponding Source to be so | |||||
| available, or (2) arrange to deprive yourself of the benefit of the | |||||
| patent license for this particular work, or (3) arrange, in a manner | |||||
| consistent with the requirements of this License, to extend the patent | |||||
| license to downstream recipients. "Knowingly relying" means you have | |||||
| actual knowledge that, but for the patent license, your conveying the | |||||
| covered work in a country, or your recipient's use of the covered work | |||||
| in a country, would infringe one or more identifiable patents in that | |||||
| country that you have reason to believe are valid. | |||||
| If, pursuant to or in connection with a single transaction or | |||||
| arrangement, you convey, or propagate by procuring conveyance of, a | |||||
| covered work, and grant a patent license to some of the parties | |||||
| receiving the covered work authorizing them to use, propagate, modify | |||||
| or convey a specific copy of the covered work, then the patent license | |||||
| you grant is automatically extended to all recipients of the covered | |||||
| work and works based on it. | |||||
| A patent license is "discriminatory" if it does not include within | |||||
| the scope of its coverage, prohibits the exercise of, or is | |||||
| conditioned on the non-exercise of one or more of the rights that are | |||||
| specifically granted under this License. You may not convey a covered | |||||
| work if you are a party to an arrangement with a third party that is | |||||
| in the business of distributing software, under which you make payment | |||||
| to the third party based on the extent of your activity of conveying | |||||
| the work, and under which the third party grants, to any of the | |||||
| parties who would receive the covered work from you, a discriminatory | |||||
| patent license (a) in connection with copies of the covered work | |||||
| conveyed by you (or copies made from those copies), or (b) primarily | |||||
| for and in connection with specific products or compilations that | |||||
| contain the covered work, unless you entered into that arrangement, | |||||
| or that patent license was granted, prior to 28 March 2007. | |||||
| Nothing in this License shall be construed as excluding or limiting | |||||
| any implied license or other defenses to infringement that may | |||||
| otherwise be available to you under applicable patent law. | |||||
| 12. No Surrender of Others' Freedom. | |||||
| If conditions are imposed on you (whether by court order, agreement or | |||||
| otherwise) that contradict the conditions of this License, they do not | |||||
| excuse you from the conditions of this License. If you cannot convey a | |||||
| covered work so as to satisfy simultaneously your obligations under this | |||||
| License and any other pertinent obligations, then as a consequence you may | |||||
| not convey it at all. For example, if you agree to terms that obligate you | |||||
| to collect a royalty for further conveying from those to whom you convey | |||||
| the Program, the only way you could satisfy both those terms and this | |||||
| License would be to refrain entirely from conveying the Program. | |||||
| 13. Use with the GNU Affero General Public License. | |||||
| Notwithstanding any other provision of this License, you have | |||||
| permission to link or combine any covered work with a work licensed | |||||
| under version 3 of the GNU Affero General Public License into a single | |||||
| combined work, and to convey the resulting work. The terms of this | |||||
| License will continue to apply to the part which is the covered work, | |||||
| but the special requirements of the GNU Affero General Public License, | |||||
| section 13, concerning interaction through a network will apply to the | |||||
| combination as such. | |||||
| 14. Revised Versions of this License. | |||||
| The Free Software Foundation may publish revised and/or new versions of | |||||
| the GNU General Public License from time to time. Such new versions will | |||||
| be similar in spirit to the present version, but may differ in detail to | |||||
| address new problems or concerns. | |||||
| Each version is given a distinguishing version number. If the | |||||
| Program specifies that a certain numbered version of the GNU General | |||||
| Public License "or any later version" applies to it, you have the | |||||
| option of following the terms and conditions either of that numbered | |||||
| version or of any later version published by the Free Software | |||||
| Foundation. If the Program does not specify a version number of the | |||||
| GNU General Public License, you may choose any version ever published | |||||
| by the Free Software Foundation. | |||||
| If the Program specifies that a proxy can decide which future | |||||
| versions of the GNU General Public License can be used, that proxy's | |||||
| public statement of acceptance of a version permanently authorizes you | |||||
| to choose that version for the Program. | |||||
| Later license versions may give you additional or different | |||||
| permissions. However, no additional obligations are imposed on any | |||||
| author or copyright holder as a result of your choosing to follow a | |||||
| later version. | |||||
| 15. Disclaimer of Warranty. | |||||
| THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY | |||||
| APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT | |||||
| HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY | |||||
| OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, | |||||
| THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |||||
| PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM | |||||
| IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF | |||||
| ALL NECESSARY SERVICING, REPAIR OR CORRECTION. | |||||
| 16. Limitation of Liability. | |||||
| IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING | |||||
| WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS | |||||
| THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY | |||||
| GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE | |||||
| USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF | |||||
| DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD | |||||
| PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), | |||||
| EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF | |||||
| SUCH DAMAGES. | |||||
| 17. Interpretation of Sections 15 and 16. | |||||
| If the disclaimer of warranty and limitation of liability provided | |||||
| above cannot be given local legal effect according to their terms, | |||||
| reviewing courts shall apply local law that most closely approximates | |||||
| an absolute waiver of all civil liability in connection with the | |||||
| Program, unless a warranty or assumption of liability accompanies a | |||||
| copy of the Program in return for a fee. | |||||
| END OF TERMS AND CONDITIONS | |||||
| How to Apply These Terms to Your New Programs | |||||
| If you develop a new program, and you want it to be of the greatest | |||||
| possible use to the public, the best way to achieve this is to make it | |||||
| free software which everyone can redistribute and change under these terms. | |||||
| To do so, attach the following notices to the program. It is safest | |||||
| to attach them to the start of each source file to most effectively | |||||
| state the exclusion of warranty; and each file should have at least | |||||
| the "copyright" line and a pointer to where the full notice is found. | |||||
| <one line to give the program's name and a brief idea of what it does.> | |||||
| Copyright (C) <year> <name of author> | |||||
| This program is free software: you can redistribute it and/or modify | |||||
| it under the terms of the GNU General Public License as published by | |||||
| the Free Software Foundation, either version 3 of the License, or | |||||
| (at your option) any later version. | |||||
| This program is distributed in the hope that it will be useful, | |||||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
| GNU General Public License for more details. | |||||
| You should have received a copy of the GNU General Public License | |||||
| along with this program. If not, see <https://www.gnu.org/licenses/>. | |||||
| Also add information on how to contact you by electronic and paper mail. | |||||
| If the program does terminal interaction, make it output a short | |||||
| notice like this when it starts in an interactive mode: | |||||
| <program> Copyright (C) <year> <name of author> | |||||
| This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. | |||||
| This is free software, and you are welcome to redistribute it | |||||
| under certain conditions; type `show c' for details. | |||||
| The hypothetical commands `show w' and `show c' should show the appropriate | |||||
| parts of the General Public License. Of course, your program's commands | |||||
| might be different; for a GUI interface, you would use an "about box". | |||||
| You should also get your employer (if you work as a programmer) or school, | |||||
| if any, to sign a "copyright disclaimer" for the program, if necessary. | |||||
| For more information on this, and how to apply and follow the GNU GPL, see | |||||
| <https://www.gnu.org/licenses/>. | |||||
| The GNU General Public License does not permit incorporating your program | |||||
| into proprietary programs. If your program is a subroutine library, you | |||||
| may consider it more useful to permit linking proprietary applications with | |||||
| the library. If this is what you want to do, use the GNU Lesser General | |||||
| Public License instead of this License. But first, please read | |||||
| <https://www.gnu.org/licenses/why-not-lgpl.html>. | |||||
| @@ -0,0 +1,2 @@ | |||||
| # azure_con | |||||
| Manage Azure connection | |||||
| @@ -0,0 +1,11 @@ | |||||
| --- | |||||
| #cons: | |||||
| # - name: | |||||
| # resource_group: | |||||
| # virtual_network: | |||||
| # state: | |||||
| # body: | |||||
| # method: | |||||
| # subresource: | |||||
| # status_code: | |||||
| ... | |||||
| @@ -0,0 +1,16 @@ | |||||
| --- | |||||
| - name: Delete connection | |||||
| azure_rm_resource: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| provider: "Network" | |||||
| resource_name: "{{ con.name | urlencode }}" | |||||
| resource_group: "{{ con.resource_group }}" | |||||
| resource_type: "connections" | |||||
| state: "absent" | |||||
| register: deletecon | |||||
| ... | |||||
| @@ -0,0 +1,30 @@ | |||||
| --- | |||||
| - name: In connection state | |||||
| include: "{{ item.state | default('present', true) }}.yml" | |||||
| vars: | |||||
| con: "{{ item }}" | |||||
| when: | |||||
| - action is undefined | |||||
| - (cons | default([], true) | length) > 0 | |||||
| with_items: "{{ cons }}" | |||||
| - name: Update/create connection | |||||
| include: present.yml | |||||
| vars: | |||||
| con: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'present' | |||||
| - (cons | default([], true) | length) > 0 | |||||
| with_items: "{{ cons }}" | |||||
| - name: Delete connection | |||||
| include: absent.yml | |||||
| vars: | |||||
| con: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'absent' | |||||
| - (cons | default([], true) | length) > 0 | |||||
| with_items: "{{ cons }}" | |||||
| ... | |||||
| @@ -0,0 +1,27 @@ | |||||
| --- | |||||
| - name: load template | |||||
| template: | |||||
| src: azure_connection.j2 | |||||
| dest: /tmp/azure_connection_body.json | |||||
| changed_when: false | |||||
| - name: Create connection | |||||
| azure_rm_resource: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| resource_name: "{{ con.name | urlencode }}" | |||||
| resource_type: "connections" | |||||
| resource_group: "{{ con.resource_group }}" | |||||
| provider: "Network" | |||||
| idempotency: true | |||||
| body: "{{ lookup('file', '/tmp/azure_connection_body.json') }}" | |||||
| method: "{{ con.method | default(omit, true) }}" | |||||
| subresource: "{{ con.subresource | default(omit, true) }}" | |||||
| status_code: "{{ con.status_code | default(omit, true) }}" | |||||
| state: "present" | |||||
| register: createres | |||||
| ... | |||||
| @@ -1,2 +1,2 @@ | |||||
| # azure_disk | |||||
| Manage Azure managed disk | |||||
| # azure_disk | |||||
| Manage Azure managed disk | |||||
| @@ -1,18 +1,18 @@ | |||||
| #disks: | |||||
| # - name: | |||||
| # attach_caching: | |||||
| # create_option: | |||||
| # disk_size_gb: | |||||
| # managed_by: | |||||
| # os_type: | |||||
| # location: | |||||
| # resource_group: | |||||
| # storage_account_type: | |||||
| # zones: | |||||
| # state: | |||||
| # source_uri: | |||||
| # tags: | |||||
| # "env": "prod" | |||||
| # "provisioner": "ansible" | |||||
| ... | |||||
| --- | |||||
| #disks: | |||||
| # - name: | |||||
| # attach_caching: | |||||
| # create_option: | |||||
| # disk_size_gb: | |||||
| # managed_by: | |||||
| # os_type: | |||||
| # location: | |||||
| # resource_group: | |||||
| # storage_account_type: | |||||
| # zones: | |||||
| # state: | |||||
| # source_uri: | |||||
| # tags: | |||||
| # "env": "prod" | |||||
| # "provisioner": "ansible" | |||||
| ... | |||||
| @@ -1,35 +1,35 @@ | |||||
| - set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | | |||||
| union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', disk.tags | default({})) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get disk | |||||
| azure_rm_manageddisk_facts: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| resource_group: "{{ disk.resource_group }}" | |||||
| tags: "{{ tags_list | default(omit) }}" | |||||
| name: "{{ disk.name | default(omit) }}" | |||||
| register: azure_disk_facts | |||||
| failed_when: false | |||||
| - name: Delete disk | |||||
| azure_rm_manageddisk: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| name: "{{ disk.name }}" | |||||
| resource_group: "{{ disk.resource_group }}" | |||||
| state: "absent" | |||||
| register: deleteddisk | |||||
| ... | |||||
| --- | |||||
| - name: Build tags list | |||||
| set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', disk.tags | default({})) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get disk | |||||
| azure_rm_manageddisk_info: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| resource_group: "{{ disk.resource_group }}" | |||||
| tags: "{{ tags_list | default(omit) }}" | |||||
| name: "{{ disk.name | default(omit) }}" | |||||
| register: azure_disk_facts | |||||
| failed_when: false | |||||
| - name: Delete disk | |||||
| azure_rm_manageddisk: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| name: "{{ disk.name }}" | |||||
| resource_group: "{{ disk.resource_group }}" | |||||
| state: "absent" | |||||
| register: deleteddisk | |||||
| ... | |||||
| @@ -1,26 +1,26 @@ | |||||
| - set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | | |||||
| union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', disk.tags | default({})) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get disk | |||||
| azure_rm_manageddisk_facts: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| resource_group: "{{ disk.resource_group }}" | |||||
| tags: "{{ tags_list | default(omit) }}" | |||||
| name: "{{ disk.name | default(omit) }}" | |||||
| register: azure_disk_facts | |||||
| failed_when: false | |||||
| - name: Print disk | |||||
| debug: | |||||
| var: azure_disk_facts.disks | |||||
| ... | |||||
| --- | |||||
| - name: Build tags list | |||||
| set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', disk.tags | default({})) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get disk | |||||
| azure_rm_manageddisk_info: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| resource_group: "{{ disk.resource_group }}" | |||||
| tags: "{{ tags_list | default(omit) }}" | |||||
| name: "{{ disk.name | default(omit) }}" | |||||
| register: azure_disk_facts | |||||
| failed_when: false | |||||
| - name: Print disk | |||||
| debug: | |||||
| var: azure_disk_facts.disks | |||||
| ... | |||||
| @@ -1,42 +1,40 @@ | |||||
| - name: list disk | |||||
| include: list.yml | |||||
| vars: | |||||
| disk: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'list' | |||||
| - (disks | default([], true) | length) > 0 | |||||
| with_items: "{{ disks }}" | |||||
| - name: In disk state | |||||
| include: "{{ item.state | default('present', true) }}.yml" | |||||
| vars: | |||||
| disk: "{{ item }}" | |||||
| when: | |||||
| - action is undefined | |||||
| - (disks | default([], true) | length) > 0 | |||||
| with_items: "{{ disks }}" | |||||
| - name: Update/create disk | |||||
| include: present.yml | |||||
| vars: | |||||
| disk: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'present' | |||||
| - item.state is undefined | |||||
| - (disks | default([], true) | length) > 0 | |||||
| with_items: "{{ disks }}" | |||||
| - name: Delete disk | |||||
| include: absent.yml | |||||
| vars: | |||||
| disk: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'absent' | |||||
| - item.state is undefined | |||||
| - (disks | default([], true) | length) > 0 | |||||
| with_items: "{{ disks }}" | |||||
| ... | |||||
| --- | |||||
| - name: list disk | |||||
| include: list.yml | |||||
| vars: | |||||
| disk: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'list' | |||||
| - (disks | default([], true) | length) > 0 | |||||
| with_items: "{{ disks }}" | |||||
| - name: In disk state | |||||
| include: "{{ item.state | default('present', true) }}.yml" | |||||
| vars: | |||||
| disk: "{{ item }}" | |||||
| when: | |||||
| - action is undefined | |||||
| - (disks | default([], true) | length) > 0 | |||||
| with_items: "{{ disks }}" | |||||
| - name: Update/create disk | |||||
| include: present.yml | |||||
| vars: | |||||
| disk: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'present' | |||||
| - (disks | default([], true) | length) > 0 | |||||
| with_items: "{{ disks }}" | |||||
| - name: Delete disk | |||||
| include: absent.yml | |||||
| vars: | |||||
| disk: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'absent' | |||||
| - (disks | default([], true) | length) > 0 | |||||
| with_items: "{{ disks }}" | |||||
| ... | |||||
| @@ -1,47 +1,46 @@ | |||||
| - set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | | |||||
| union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', disk.tags | default({}, true)) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get disk | |||||
| azure_rm_manageddisk_facts: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| resource_group: "{{ disk.resource_group }}" | |||||
| tags: "{{ tags_list | default(omit) }}" | |||||
| name: "{{ disk.name | default(omit) }}" | |||||
| register: azure_disk_facts | |||||
| failed_when: false | |||||
| - name: Create disk | |||||
| azure_rm_manageddisk: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| name: "{{ disk.name }}" | |||||
| location: "{{ disk.location | default(omit, true) }}" | |||||
| resource_group: "{{ disk.resource_group }}" | |||||
| zones: "{{ disk.zone | default(omit, true) }}" | |||||
| disk_size_gb: "{{ disk.disk_size_gb | default('30', true) }}" | |||||
| state: "present" | |||||
| attach_caching: "{{ disk.attach_caching | default('read_only', true) }}" | |||||
| create_option: "{{ disk.create_option | default('empty', true) }}" | |||||
| source_uri: "{{ disk.source_uri | default(omit, true) }}" | |||||
| managed_by: "{{ disk.managed_by | default('', true) }}" | |||||
| os_type: "{{ disk.os_type | default(omit, true) }}" | |||||
| storage_account_type: "{{ disk.storage_account_type | default('StandardSSD_LRS', true) }}" | |||||
| tags: "{{ disk.tags | default(omit, true) }}" | |||||
| append_tags: false | |||||
| register: createdisk | |||||
| ... | |||||
| ... | |||||
| --- | |||||
| - name: Build tags list | |||||
| set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', disk.tags | default({}, true)) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get disk | |||||
| azure_rm_manageddisk_info: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| resource_group: "{{ disk.resource_group }}" | |||||
| tags: "{{ tags_list | default(omit) }}" | |||||
| name: "{{ disk.name | default(omit) }}" | |||||
| register: azure_disk_facts | |||||
| failed_when: false | |||||
| - name: Create disk | |||||
| azure_rm_manageddisk: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| name: "{{ disk.name }}" | |||||
| location: "{{ disk.location | default(omit, true) }}" | |||||
| resource_group: "{{ disk.resource_group }}" | |||||
| zones: "{{ disk.zone | default(omit, true) }}" | |||||
| disk_size_gb: "{{ disk.disk_size_gb | default('30', true) }}" | |||||
| state: "present" | |||||
| attach_caching: "{{ disk.attach_caching | default('read_only', true) }}" | |||||
| create_option: "{{ disk.create_option | default('empty', true) }}" | |||||
| source_uri: "{{ disk.source_uri | default(omit, true) }}" | |||||
| managed_by: "{{ disk.managed_by | default(', true) }}" | |||||
| os_type: "{{ disk.os_type | default(omit, true) }}" | |||||
| storage_account_type: "{{ disk.storage_account_type | default('StandardSSD_LRS', true) }}" | |||||
| tags: "{{ disk.tags | default(omit, true) }}" | |||||
| append_tags: false | |||||
| register: createdisk | |||||
| ... | |||||
| @@ -1,2 +1,2 @@ | |||||
| # azure_ip | |||||
| Manage Azure public ip address | |||||
| # azure_ip | |||||
| Manage Azure public ip address | |||||
| @@ -1,15 +1,19 @@ | |||||
| ips: | |||||
| # - name: | |||||
| # allocation_method: "static" | |||||
| # domain_name: | |||||
| # idle_timeout: 4 | |||||
| # ip_tags: | |||||
| # resource_group: | |||||
| # sku: "standard" | |||||
| # state: | |||||
| # version: | |||||
| # tags: | |||||
| # "env": "prod" | |||||
| # "provisioner": "ansible" | |||||
| ... | |||||
| --- | |||||
| ips: | |||||
| # - name: | |||||
| # allocation_method: "Static" | |||||
| # dns: | |||||
| # label: | |||||
| # fqdn: | |||||
| # reverse: | |||||
| # idletimeout: 4 | |||||
| # ip_tags: | |||||
| # resource_group: | |||||
| # sku: "standard" | |||||
| # tier: "Regional" # Global | |||||
| # state: | |||||
| # version: "IPv4" | |||||
| # tags: | |||||
| # "env": "prod" | |||||
| # "provisioner": "ansible" | |||||
| ... | |||||
| @@ -1,34 +1,34 @@ | |||||
| - set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | | |||||
| union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', ip.tags | default({})) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get ip address | |||||
| azure_rm_publicipaddress_facts: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| resource_group: "{{ ip.resource_group }}" | |||||
| tags: "{{ tags_list | default(omit) }}" | |||||
| name: "{{ ip.name | default(omit) }}" | |||||
| register: azure_ip_facts | |||||
| - name: Delete ip address | |||||
| azure_rm_publicipaddress: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| name: "{{ ip.name }}" | |||||
| resource_group: "{{ ip.resource_group }}" | |||||
| state: "absent" | |||||
| register: deletedip | |||||
| ... | |||||
| --- | |||||
| - name: Build tags list | |||||
| set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', ip.tags | default({})) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get ip address | |||||
| azure_rm_publicipaddress_info: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| resource_group: "{{ ip.resource_group }}" | |||||
| tags: "{{ tags_list | default(omit) }}" | |||||
| name: "{{ ip.name | default(omit) }}" | |||||
| register: azure_ip_facts | |||||
| - name: Delete ip address | |||||
| azure_rm_publicipaddress: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| name: "{{ ip.name }}" | |||||
| resource_group: "{{ ip.resource_group }}" | |||||
| state: "absent" | |||||
| register: deletedip | |||||
| ... | |||||
| @@ -1,25 +1,25 @@ | |||||
| - set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | | |||||
| union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', ip.tags | default({})) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get network interface | |||||
| azure_rm_publicipaddress_facts: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| resource_group: "{{ ip.resource_group }}" | |||||
| tags: "{{ tags_list | default(omit) }}" | |||||
| name: "{{ ip.name | default(omit) }}" | |||||
| register: azure_ip_facts | |||||
| - name: Print network interface | |||||
| debug: | |||||
| var: azure_ip_facts.publicipaddresses | |||||
| ... | |||||
| --- | |||||
| - name: Build tags list | |||||
| set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', ip.tags | default({})) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get network interface | |||||
| azure_rm_publicipaddress_info: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| resource_group: "{{ ip.resource_group }}" | |||||
| tags: "{{ tags_list | default(omit) }}" | |||||
| name: "{{ ip.name | default(omit) }}" | |||||
| register: azure_ip_facts | |||||
| - name: Print network interface | |||||
| debug: | |||||
| var: azure_ip_facts.publicipaddresses | |||||
| ... | |||||
| @@ -1,42 +1,40 @@ | |||||
| - name: list ip address | |||||
| include: list.yml | |||||
| vars: | |||||
| ip: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'list' | |||||
| - (ips | default([], true) | length) > 0 | |||||
| with_items: "{{ ips }}" | |||||
| - name: In ip address state | |||||
| include: "{{ item.state | default('present', true) }}.yml" | |||||
| vars: | |||||
| ip: "{{ item }}" | |||||
| when: | |||||
| - action is undefined | |||||
| - (ips | default([], true) | length) > 0 | |||||
| with_items: "{{ ips }}" | |||||
| - name: Update/create ip address | |||||
| include: present.yml | |||||
| vars: | |||||
| ip: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'present' | |||||
| - item.state is undefined | |||||
| - (ips | default([], true) | length) > 0 | |||||
| with_items: "{{ ips }}" | |||||
| - name: Delete ip address | |||||
| include: absent.yml | |||||
| vars: | |||||
| ip: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'absent' | |||||
| - item.state is undefined | |||||
| - (ips | default([], true) | length) > 0 | |||||
| with_items: "{{ ips }}" | |||||
| ... | |||||
| --- | |||||
| - name: list ip address | |||||
| include: list.yml | |||||
| vars: | |||||
| ip: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'list' | |||||
| - (ips | default([], true) | length) > 0 | |||||
| with_items: "{{ ips }}" | |||||
| - name: In ip address state | |||||
| include: "{{ item.state | default('present', true) }}.yml" | |||||
| vars: | |||||
| ip: "{{ item }}" | |||||
| when: | |||||
| - action is undefined | |||||
| - (ips | default([], true) | length) > 0 | |||||
| with_items: "{{ ips }}" | |||||
| - name: Update/create ip address | |||||
| include: present.yml | |||||
| vars: | |||||
| ip: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'present' | |||||
| - (ips | default([], true) | length) > 0 | |||||
| with_items: "{{ ips }}" | |||||
| - name: Delete ip address | |||||
| include: absent.yml | |||||
| vars: | |||||
| ip: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'absent' | |||||
| - (ips | default([], true) | length) > 0 | |||||
| with_items: "{{ ips }}" | |||||
| ... | |||||
| @@ -1,41 +1,50 @@ | |||||
| - set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | | |||||
| union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', ip.tags | default({}, true)) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get ip address | |||||
| azure_rm_publicipaddress_facts: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| resource_group: "{{ ip.resource_group }}" | |||||
| tags: "{{ tags_list | default(omit) }}" | |||||
| name: "{{ ip.name | default(omit) }}" | |||||
| register: azure_ip_facts | |||||
| - name: Create ip address | |||||
| azure_rm_publicipaddress: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| name: "{{ ip.name }}" | |||||
| allocation_method: "{{ ip.allocation_method | default('static', true) }}" | |||||
| domain_name: "{{ ip.domain_name | default(omit, true) }}" | |||||
| idle_timeout: "{{ ip.idle_timeout | default(1, true) }}" | |||||
| ip_tags: "{{ ip.ip_tags | default(omit, true) }}" | |||||
| resource_group: "{{ ip.resource_group }}" | |||||
| sku: "{{ ip.sku | default('standard', true) }}" | |||||
| append_tags: false | |||||
| state: "present" | |||||
| tags: "{{ ip.tags | default(omit, true) }}" | |||||
| register: createip | |||||
| ... | |||||
| --- | |||||
| - name: Build tags list | |||||
| set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', ip.tags | default({}, true)) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get ip address | |||||
| azure_rm_publicipaddress_info: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| resource_group: "{{ ip.resource_group }}" | |||||
| name: "{{ ip.name | default(omit) }}" | |||||
| register: azure_ip_facts | |||||
| - name: load template | |||||
| template: | |||||
| src: azure_public_ip_address.j2 | |||||
| dest: /tmp/azure_public_ip_address_body.json | |||||
| changed_when: false | |||||
| - name: Create ip address | |||||
| azure_rm_resource: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| resource_name: "{{ ip.name | urlencode }}" | |||||
| resource_type: "publicIPAddresses" | |||||
| resource_group: "{{ ip.resource_group }}" | |||||
| provider: "Network" | |||||
| idempotency: true | |||||
| body: "{{ lookup('file', '/tmp/azure_public_ip_address_body.json') }}" | |||||
| method: "{{ ip.method | default(omit, true) }}" | |||||
| subresource: "{{ ip.subresource | default(omit, true) }}" | |||||
| status_code: "{{ ip.status_code | default(omit, true) }}" | |||||
| state: "present" | |||||
| register: createip | |||||
| failed_when: | |||||
| - createip.rc is defined | |||||
| - createip.rc != 0 | |||||
| - '"PublicIPAddressInUseCannotUpdate" not in createip.module_stderr' | |||||
| ... | |||||
| @@ -1,12 +1,12 @@ | |||||
| # azure_law | |||||
| Manage Azure log analytics workspace | |||||
| TODO qui ne sont pas inclus dans l'automatisme ICI (note : Peut-etre que ces cossins sont là par défaut mais ont etes retirés du LAW du CSS) | |||||
| Activer la reception des syslog dans le LAW | |||||
| LogAnalytics-MVT-Azure-prod-sol01 --> Advanced settings | |||||
| Data --> Syslog | |||||
| cocher "apply below configuration to muy machines | |||||
| Entrer "user" et cliquer sur le signe + | |||||
| cocher tout les loglevels | |||||
| # azure_law | |||||
| Manage Azure log analytics workspace | |||||
| TODO qui ne sont pas inclus dans l'automatisme ICI (note : Peut-etre que ces cossins sont là par défaut mais ont etes retirés du LAW du CSS) | |||||
| Activer la reception des syslog dans le LAW | |||||
| LogAnalytics-MVT-Azure-prod-sol01 --> Advanced settings | |||||
| Data --> Syslog | |||||
| cocher "apply below configuration to muy machines | |||||
| Entrer "user" et cliquer sur le signe + | |||||
| cocher tout les loglevels | |||||
| @@ -1,13 +1,13 @@ | |||||
| #laws: | |||||
| # - name: | |||||
| # intelligence_packs: | |||||
| # location: | |||||
| # resource_group: | |||||
| # retention_in_days: -1 | |||||
| # sku: unlimited | |||||
| # state: | |||||
| # tags: | |||||
| # "env": "prod" | |||||
| # "provisioner": "ansible" | |||||
| ... | |||||
| --- | |||||
| #laws: | |||||
| # - name: | |||||
| # intelligence_packs: | |||||
| # location: | |||||
| # resource_group: | |||||
| # retention_in_days: -1 | |||||
| # sku: unlimited | |||||
| # state: | |||||
| # tags: | |||||
| # "env": "prod" | |||||
| # "provisioner": "ansible" | |||||
| ... | |||||
| @@ -1,37 +1,36 @@ | |||||
| - set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | | |||||
| union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', law.tags | default({})) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get log analytics workspace | |||||
| azure_rm_loganalyticsworkspace_facts: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| resource_group: "{{ law.resource_group }}" | |||||
| tags: "{{ tags_list | default(omit) }}" | |||||
| name: "{{ law.name | default(omit) }}" | |||||
| show_intelligence_packs: "{{ law.show_intelligence_packs | | |||||
| default(true, true) }}" | |||||
| show_usages: "{{ law.show_usages | default(true, true) }}" | |||||
| register: azure_law_facts | |||||
| - name: Delete log analytics workspace | |||||
| azure_rm_loganalyticsworkspace: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| name: "{{ law.name }}" | |||||
| resource_group: "{{ law.resource_group }}" | |||||
| state: "absent" | |||||
| register: deletedlaw | |||||
| ... | |||||
| --- | |||||
| - name: Build tags list | |||||
| set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', law.tags | default({})) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get log analytics workspace | |||||
| azure_rm_loganalyticsworkspace_info: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| resource_group: "{{ law.resource_group }}" | |||||
| tags: "{{ tags_list | default(omit) }}" | |||||
| name: "{{ law.name | default(omit) }}" | |||||
| show_intelligence_packs: "{{ law.show_intelligence_packs | default(true, true) }}" | |||||
| show_usages: "{{ law.show_usages | default(true, true) }}" | |||||
| register: azure_law_facts | |||||
| - name: Delete log analytics workspace | |||||
| azure_rm_loganalyticsworkspace: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| name: "{{ law.name }}" | |||||
| resource_group: "{{ law.resource_group }}" | |||||
| state: "absent" | |||||
| register: deletedlaw | |||||
| ... | |||||
| @@ -1,27 +1,27 @@ | |||||
| - set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | | |||||
| union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', law.tags | default({})) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get log analytics workspace | |||||
| azure_rm_loganalyticsworkspace_facts: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| resource_group: "{{ law.resource_group }}" | |||||
| name: "{{ law.name }}" | |||||
| show_intelligence_packs: true | |||||
| show_shared_keys: true | |||||
| show_usages: true | |||||
| register: azure_law_facts | |||||
| - name: Print log analytics workspace | |||||
| debug: | |||||
| var: azure_law_facts | |||||
| ... | |||||
| --- | |||||
| - name: Build tags list | |||||
| set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', law.tags | default({})) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get log analytics workspace | |||||
| azure_rm_loganalyticsworkspace_info: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| resource_group: "{{ law.resource_group }}" | |||||
| name: "{{ law.name }}" | |||||
| show_intelligence_packs: "true" | |||||
| show_shared_keys: "true" | |||||
| show_usages: "true" | |||||
| register: azure_law_facts | |||||
| - name: Print log analytics workspace | |||||
| debug: | |||||
| var: azure_law_facts | |||||
| ... | |||||
| @@ -1,42 +1,40 @@ | |||||
| - name: list log analytics workspace | |||||
| include: list.yml | |||||
| vars: | |||||
| law: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'list' | |||||
| - (laws | default([], true) | length) > 0 | |||||
| with_items: "{{ laws }}" | |||||
| - name: In log analytics workspace state | |||||
| include: "{{ item.state | default('present', true) }}.yml" | |||||
| vars: | |||||
| law: "{{ item }}" | |||||
| when: | |||||
| - action is undefined | |||||
| - (laws | default([], true) | length) > 0 | |||||
| with_items: "{{ laws }}" | |||||
| - name: Update/create log analytics workspace | |||||
| include: present.yml | |||||
| vars: | |||||
| law: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'present' | |||||
| - item.state is undefined | |||||
| - (laws | default([], true) | length) > 0 | |||||
| with_items: "{{ laws }}" | |||||
| - name: Delete log analytics workspace | |||||
| include: absent.yml | |||||
| vars: | |||||
| law: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'absent' | |||||
| - item.state is undefined | |||||
| - (laws | default([], true) | length) > 0 | |||||
| with_items: "{{ laws }}" | |||||
| ... | |||||
| --- | |||||
| - name: list log analytics workspace | |||||
| include: list.yml | |||||
| vars: | |||||
| law: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'list' | |||||
| - (laws | default([], true) | length) > 0 | |||||
| with_items: "{{ laws }}" | |||||
| - name: In log analytics workspace state | |||||
| include: "{{ item.state | default('present', true) }}.yml" | |||||
| vars: | |||||
| law: "{{ item }}" | |||||
| when: | |||||
| - action is undefined | |||||
| - (laws | default([], true) | length) > 0 | |||||
| with_items: "{{ laws }}" | |||||
| - name: Update/create log analytics workspace | |||||
| include: present.yml | |||||
| vars: | |||||
| law: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'present' | |||||
| - (laws | default([], true) | length) > 0 | |||||
| with_items: "{{ laws }}" | |||||
| - name: Delete log analytics workspace | |||||
| include: absent.yml | |||||
| vars: | |||||
| law: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'absent' | |||||
| - (laws | default([], true) | length) > 0 | |||||
| with_items: "{{ laws }}" | |||||
| ... | |||||
| @@ -1,43 +1,42 @@ | |||||
| - set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | | |||||
| union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', law.tags | default({}, true)) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get log analytics workspace | |||||
| azure_rm_loganalyticsworkspace_facts: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| resource_group: "{{ law.resource_group }}" | |||||
| tags: "{{ tags_list | default(omit) }}" | |||||
| name: "{{ law.name | default(omit) }}" | |||||
| show_intelligence_packs: "{{ law.show_intelligence_packs | | |||||
| default(true, true) }}" | |||||
| show_usages: "{{ law.show_usages | default(true, true) }}" | |||||
| register: azure_law_facts | |||||
| - name: Create log analytics workspace | |||||
| azure_rm_loganalyticsworkspace: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| name: "{{ law.name }}" | |||||
| intelligence_packs: "{{ law.intelligence_packs | default(omit, true) }}" | |||||
| retention_in_days: "{{ law.retention_in_days | default(90, true) }}" | |||||
| sku: "{{ law.sku | default(omit, true) }}" | |||||
| location: "{{ law.location | default(omit, true) }}" | |||||
| resource_group: "{{ law.resource_group }}" | |||||
| append_tags: false | |||||
| state: "present" | |||||
| tags: "{{ law.tags | default(omit, true) }}" | |||||
| register: createlaw | |||||
| ... | |||||
| --- | |||||
| - name: Build tags list | |||||
| set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', law.tags | default({}, true)) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get log analytics workspace | |||||
| azure_rm_loganalyticsworkspace_info: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| resource_group: "{{ law.resource_group }}" | |||||
| tags: "{{ tags_list | default(omit) }}" | |||||
| name: "{{ law.name | default(omit) }}" | |||||
| show_intelligence_packs: "{{ law.show_intelligence_packs | default(true, true) }}" | |||||
| show_usages: "{{ law.show_usages | default(true, true) }}" | |||||
| register: azure_law_facts | |||||
| - name: Create log analytics workspace | |||||
| azure_rm_loganalyticsworkspace: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| name: "{{ law.name }}" | |||||
| intelligence_packs: "{{ law.intelligence_packs | default(omit, true) }}" | |||||
| retention_in_days: "{{ law.retention_in_days | default(90, true) }}" | |||||
| sku: "{{ law.sku | default(omit, true) }}" | |||||
| location: "{{ law.location | default(omit, true) }}" | |||||
| resource_group: "{{ law.resource_group }}" | |||||
| append_tags: false | |||||
| state: "present" | |||||
| tags: "{{ law.tags | default(omit, true) }}" | |||||
| register: createlaw | |||||
| ... | |||||
| @@ -1,2 +1,2 @@ | |||||
| # azure_lb | |||||
| Manage Azure load balancer | |||||
| # azure_lb | |||||
| Manage Azure load balancer | |||||
| @@ -1,47 +1,47 @@ | |||||
| #lbs: | |||||
| # - name: | |||||
| # backend_address_pools: | |||||
| # - name: | |||||
| # frontend_ip_configurations: | |||||
| # - name: | |||||
| # private_ip_allocation_method: 'Dynamic' #Static, Dynamic | |||||
| # private_ip_address: | |||||
| # public_ip_address: | |||||
| # subnet: | |||||
| # inbound_nat_pools: | |||||
| # - name: | |||||
| # frontend_ip_configuration_name: | |||||
| # frontend_port_range_start: 80 #1-65535 | |||||
| # frontend_port_range_end: 80 #1-65535 | |||||
| # protocol: 'Àll' #Tcp, Udp, All | |||||
| # backend_port: 80 #1-65535 | |||||
| # inbound_nat_rules: | |||||
| # - name: | |||||
| # protocol: 'Àll' #Tcp, Udp, All | |||||
| # frontend_ip_configuration: | |||||
| # frontend_port: 80 #0-65535, 0 to any | |||||
| # backend_port: 80 #0-65535, 0 to any | |||||
| # load_balancing_rules: | |||||
| # - name: | |||||
| # backend_address_pool: | |||||
| # backend_port: 80 #0-65535, 0 to any | |||||
| # frontend_ip_configuration: | |||||
| # frontend_port: 80 #0-65535, 0 to any | |||||
| # probe: | |||||
| # load_distribution: Default #Default, SourceIP, SourceIPProtocol | |||||
| # protocol: 'Àll' #Tcp, Udp, All | |||||
| # probes: | |||||
| # - name: | |||||
| # port: 80 | |||||
| # interval: 15 | |||||
| # fail_count: 3 | |||||
| # protocol: 'Tcp' #Tcp, Http | |||||
| # request_path: 'Tcp' #When protocol is Http | |||||
| # resource_group: | |||||
| # sku: 'Standard' | |||||
| # state: | |||||
| # tags: | |||||
| # "env": "prod" | |||||
| # "provisioner": "ansible" | |||||
| ... | |||||
| --- | |||||
| #lbs: | |||||
| # - name: | |||||
| # backend_address_pools: | |||||
| # - name: | |||||
| # frontend_ip_configurations: | |||||
| # - name: | |||||
| # private_ip_allocation_method: 'Dynamic' #Static, Dynamic | |||||
| # private_ip_address: | |||||
| # public_ip_address: | |||||
| # subnet: | |||||
| # inbound_nat_pools: | |||||
| # - name: | |||||
| # frontend_ip_configuration_name: | |||||
| # frontend_port_range_start: 80 #1-65535 | |||||
| # frontend_port_range_end: 80 #1-65535 | |||||
| # protocol: 'Àll' #Tcp, Udp, All | |||||
| # backend_port: 80 #1-65535 | |||||
| # inbound_nat_rules: | |||||
| # - name: | |||||
| # protocol: 'Àll' #Tcp, Udp, All | |||||
| # frontend_ip_configuration: | |||||
| # frontend_port: 80 #0-65535, 0 to any | |||||
| # backend_port: 80 #0-65535, 0 to any | |||||
| # load_balancing_rules: | |||||
| # - name: | |||||
| # backend_address_pool: | |||||
| # backend_port: 80 #0-65535, 0 to any | |||||
| # frontend_ip_configuration: | |||||
| # frontend_port: 80 #0-65535, 0 to any | |||||
| # probe: | |||||
| # load_distribution: Default #Default, SourceIP, SourceIPProtocol | |||||
| # protocol: 'Àll' #Tcp, Udp, All | |||||
| # probes: | |||||
| # - name: | |||||
| # port: 80 | |||||
| # interval: 15 | |||||
| # fail_count: 3 | |||||
| # protocol: 'Tcp' #Tcp, Http | |||||
| # request_path: 'Tcp' #When protocol is Http | |||||
| # resource_group: | |||||
| # sku: 'Standard' | |||||
| # state: | |||||
| # tags: | |||||
| # "env": "prod" | |||||
| # "provisioner": "ansible" | |||||
| ... | |||||
| @@ -1,34 +1,34 @@ | |||||
| - set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | | |||||
| union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', lb.tags | default({})) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get load balancer | |||||
| azure_rm_loadbalancer_facts: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| resource_group: "{{ lb.resource_group }}" | |||||
| tags: "{{ tags_list | default(omit) }}" | |||||
| name: "{{ lb.name | default(omit) }}" | |||||
| register: azure_lb_facts | |||||
| - name: Delete load balancer | |||||
| azure_rm_loadbalancer: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| name: "{{ lb.name }}" | |||||
| resource_group: "{{ lb.resource_group }}" | |||||
| state: "absent" | |||||
| register: deletedlb | |||||
| ... | |||||
| --- | |||||
| - name: Build tags list | |||||
| set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', lb.tags | default({})) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get load balancer | |||||
| azure_rm_loadbalancer_info: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| resource_group: "{{ lb.resource_group }}" | |||||
| tags: "{{ tags_list | default(omit) }}" | |||||
| name: "{{ lb.name | default(omit) }}" | |||||
| register: azure_lb_facts | |||||
| - name: Delete load balancer | |||||
| azure_rm_loadbalancer: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| name: "{{ lb.name }}" | |||||
| resource_group: "{{ lb.resource_group }}" | |||||
| state: "absent" | |||||
| register: deletedlb | |||||
| ... | |||||
| @@ -1,25 +1,25 @@ | |||||
| - set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | | |||||
| union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', lb.tags | default({})) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get load balancer | |||||
| azure_rm_loadbalancer_facts: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| resource_group: "{{ lb.resource_group }}" | |||||
| tags: "{{ tags_list | default(omit) }}" | |||||
| name: "{{ lb.name | default(omit) }}" | |||||
| register: azure_lb_facts | |||||
| - name: Print load balancer | |||||
| debug: | |||||
| var: azure_lb_facts.azure_loadbalancers | |||||
| ... | |||||
| --- | |||||
| - name: Build tags list | |||||
| set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', lb.tags | default({})) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get load balancer | |||||
| azure_rm_loadbalancer_info: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| resource_group: "{{ lb.resource_group }}" | |||||
| tags: "{{ tags_list | default(omit) }}" | |||||
| name: "{{ lb.name | default(omit) }}" | |||||
| register: azure_lb_facts | |||||
| - name: Print load balancer | |||||
| debug: | |||||
| var: azure_lb_facts.azure_loadbalancers | |||||
| ... | |||||
| @@ -1,42 +1,40 @@ | |||||
| - name: list load balancer | |||||
| include: list.yml | |||||
| vars: | |||||
| lb: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'list' | |||||
| - (lbs | default([], true) | length) > 0 | |||||
| with_items: "{{ lbs }}" | |||||
| - name: In load balancer state | |||||
| include: "{{ item.state | default('present', true) }}.yml" | |||||
| vars: | |||||
| lb: "{{ item }}" | |||||
| when: | |||||
| - action is undefined | |||||
| - (lbs | default([], true) | length) > 0 | |||||
| with_items: "{{ lbs }}" | |||||
| - name: Update/create load balancer | |||||
| include: present.yml | |||||
| vars: | |||||
| lb: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'present' | |||||
| - item.state is undefined | |||||
| - (lbs | default([], true) | length) > 0 | |||||
| with_items: "{{ lbs }}" | |||||
| - name: Delete load balancer | |||||
| include: absent.yml | |||||
| vars: | |||||
| lb: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'absent' | |||||
| - item.state is undefined | |||||
| - (lbs | default([], true) | length) > 0 | |||||
| with_items: "{{ lbs }}" | |||||
| ... | |||||
| --- | |||||
| - name: list load balancer | |||||
| include: list.yml | |||||
| vars: | |||||
| lb: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'list' | |||||
| - (lbs | default([], true) | length) > 0 | |||||
| with_items: "{{ lbs }}" | |||||
| - name: In load balancer state | |||||
| include: "{{ item.state | default('present', true) }}.yml" | |||||
| vars: | |||||
| lb: "{{ item }}" | |||||
| when: | |||||
| - action is undefined | |||||
| - (lbs | default([], true) | length) > 0 | |||||
| with_items: "{{ lbs }}" | |||||
| - name: Update/create load balancer | |||||
| include: present.yml | |||||
| vars: | |||||
| lb: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'present' | |||||
| - (lbs | default([], true) | length) > 0 | |||||
| with_items: "{{ lbs }}" | |||||
| - name: Delete load balancer | |||||
| include: absent.yml | |||||
| vars: | |||||
| lb: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'absent' | |||||
| - (lbs | default([], true) | length) > 0 | |||||
| with_items: "{{ lbs }}" | |||||
| ... | |||||
| @@ -1,54 +1,57 @@ | |||||
| - set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | | |||||
| union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', lb.tags | default({}, true)) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get load balancer | |||||
| azure_rm_loadbalancer_facts: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| resource_group: "{{ lb.resource_group }}" | |||||
| tags: "{{ tags_list | default(omit) }}" | |||||
| name: "{{ lb.name | default(omit) }}" | |||||
| register: azure_lb_facts | |||||
| - name: Clear ip configuration list | |||||
| set_fact: | |||||
| ip_configurations: [] | |||||
| - name: Set subnet id | |||||
| include: subnetid.yml | |||||
| loop: "{{ lb.frontend_ip_configurations }}" | |||||
| loop_control: | |||||
| loop_var: "fipc" | |||||
| - name: Create load balancer | |||||
| azure_rm_loadbalancer: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| name: "{{ lb.name }}" | |||||
| backend_address_pools: "{{ lb.backend_address_pools }}" | |||||
| frontend_ip_configurations: "{{ ip_configurations }}" | |||||
| inbound_nat_pools: "{{ lb.inbound_nat_pools | default(omit, true) }}" | |||||
| inbound_nat_rules: "{{ lb.inbound_nat_rules | default(omit, true) }}" | |||||
| load_balancing_rules: "{{ lb.load_balancing_rules | default(omit, true) }}" | |||||
| location: "{{ lb.location | default(omit, true) }}" | |||||
| probes: "{{ lb.probes }}" | |||||
| resource_group: "{{ lb.resource_group }}" | |||||
| sku: "{{ lb.sku | default('Standard', true) }}" | |||||
| state: "present" | |||||
| append_tags: false | |||||
| tags: "{{ lb.tags | default(omit, true) }}" | |||||
| register: createlb | |||||
| ... | |||||
| --- | |||||
| - name: Build tags list | |||||
| set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', lb.tags | default({}, true)) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get load balancer | |||||
| azure_rm_loadbalancer_info: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| resource_group: "{{ lb.resource_group }}" | |||||
| tags: "{{ tags_list | default(omit) }}" | |||||
| name: "{{ lb.name | default(omit) }}" | |||||
| register: azure_lb_facts | |||||
| - name: Clear ip configuration list | |||||
| set_fact: | |||||
| ip_configurations: [] | |||||
| - name: Set subnet id | |||||
| include: subnetid.yml | |||||
| loop: "{{ lb.frontend_ip_configurations }}" | |||||
| loop_control: | |||||
| loop_var: "fipc" | |||||
| - name: load template | |||||
| template: | |||||
| src: azure_load_balancer.j2 | |||||
| dest: /tmp/azure_load_balancer_body.json | |||||
| changed_when: false | |||||
| - name: Create load balancer | |||||
| azure_rm_resource: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| resource_name: "{{ lb.name | urlencode }}" | |||||
| resource_type: "loadBalancers" | |||||
| resource_group: "{{ lb.resource_group }}" | |||||
| provider: "Network" | |||||
| idempotency: true | |||||
| body: "{{ lookup('file', '/tmp/azure_load_balancer_body.json') }}" | |||||
| method: "{{ lb.method | default(omit, true) }}" | |||||
| subresource: "{{ lb.subresource | default(omit, true) }}" | |||||
| status_code: "{{ lb.status_code | default(omit, true) }}" | |||||
| state: "present" | |||||
| register: createlb | |||||
| ... | |||||
| @@ -1,39 +1,39 @@ | |||||
| - name: Set subnet id | |||||
| set_fact: | |||||
| cfipc: {} | |||||
| - name: Get subnet | |||||
| azure_rm_subnet_facts: | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| resource_group: "{{ fipc.resource_group | default(lb.resource_group, true) }}" | |||||
| virtual_network_name: "{{ fipc.virtual_network_name }}" | |||||
| name: "{{ fipc.subnet_name }}" | |||||
| register: azure_subnet_facts | |||||
| when: | |||||
| - fipc.subnet_name is defined | |||||
| - name: Clean ip configuration | |||||
| set_fact: | |||||
| cfipc: "{{ cfipc | combine({field.key: field.value}) }}" | |||||
| with_dict: "{{ fipc }}" | |||||
| loop_control: | |||||
| loop_var: "field" | |||||
| when: | |||||
| - field.key not in ['virtual_network_name', 'subnet_name', 'resource_group'] | |||||
| - name: Set subnet id | |||||
| set_fact: | |||||
| cfipc: "{{ cfipc | combine({'subnet': azure_subnet_facts.subnets[0].id}) }}" | |||||
| when: | |||||
| - azure_subnet_facts is defined | |||||
| - azure_subnet_facts.subnets is defined | |||||
| - (azure_subnet_facts.subnets | length) == 1 | |||||
| - name: Build ip configuration list | |||||
| set_fact: | |||||
| ip_configurations: "{{ ip_configurations | default([], true) | union([cfipc]) }}" | |||||
| ... | |||||
| --- | |||||
| - name: Set subnet id | |||||
| set_fact: | |||||
| cfipc: {} | |||||
| - name: Get subnet | |||||
| azure_rm_subnet_facts: | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| resource_group: "{{ fipc.resource_group | default(lb.resource_group, true) }}" | |||||
| virtual_network_name: "{{ fipc.virtual_network_name }}" | |||||
| name: "{{ fipc.subnet_name }}" | |||||
| register: azure_subnet_facts | |||||
| when: | |||||
| - fipc.subnet_name is defined | |||||
| - name: Clean ip configuration | |||||
| set_fact: | |||||
| cfipc: "{{ cfipc | combine({field.key: field.value}) }}" | |||||
| with_dict: "{{ fipc }}" | |||||
| loop_control: | |||||
| loop_var: "field" | |||||
| when: | |||||
| - field.key not in ['virtual_network_name', 'subnet_name', 'resource_group'] | |||||
| - name: Set subnet id | |||||
| set_fact: | |||||
| cfipc: "{{ cfipc | combine({'subnet': azure_subnet_facts.subnets[0].id}) }}" | |||||
| when: | |||||
| - azure_subnet_facts is defined | |||||
| - azure_subnet_facts.subnets is defined | |||||
| - (azure_subnet_facts.subnets | length) == 1 | |||||
| - name: Build ip configuration list | |||||
| set_fact: | |||||
| ip_configurations: "{{ ip_configurations | default([], true) | union([cfipc]) }}" | |||||
| ... | |||||
| @@ -0,0 +1,674 @@ | |||||
| GNU GENERAL PUBLIC LICENSE | |||||
| Version 3, 29 June 2007 | |||||
| Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> | |||||
| Everyone is permitted to copy and distribute verbatim copies | |||||
| of this license document, but changing it is not allowed. | |||||
| Preamble | |||||
| The GNU General Public License is a free, copyleft license for | |||||
| software and other kinds of works. | |||||
| The licenses for most software and other practical works are designed | |||||
| to take away your freedom to share and change the works. By contrast, | |||||
| the GNU General Public License is intended to guarantee your freedom to | |||||
| share and change all versions of a program--to make sure it remains free | |||||
| software for all its users. We, the Free Software Foundation, use the | |||||
| GNU General Public License for most of our software; it applies also to | |||||
| any other work released this way by its authors. You can apply it to | |||||
| your programs, too. | |||||
| When we speak of free software, we are referring to freedom, not | |||||
| price. Our General Public Licenses are designed to make sure that you | |||||
| have the freedom to distribute copies of free software (and charge for | |||||
| them if you wish), that you receive source code or can get it if you | |||||
| want it, that you can change the software or use pieces of it in new | |||||
| free programs, and that you know you can do these things. | |||||
| To protect your rights, we need to prevent others from denying you | |||||
| these rights or asking you to surrender the rights. Therefore, you have | |||||
| certain responsibilities if you distribute copies of the software, or if | |||||
| you modify it: responsibilities to respect the freedom of others. | |||||
| For example, if you distribute copies of such a program, whether | |||||
| gratis or for a fee, you must pass on to the recipients the same | |||||
| freedoms that you received. You must make sure that they, too, receive | |||||
| or can get the source code. And you must show them these terms so they | |||||
| know their rights. | |||||
| Developers that use the GNU GPL protect your rights with two steps: | |||||
| (1) assert copyright on the software, and (2) offer you this License | |||||
| giving you legal permission to copy, distribute and/or modify it. | |||||
| For the developers' and authors' protection, the GPL clearly explains | |||||
| that there is no warranty for this free software. For both users' and | |||||
| authors' sake, the GPL requires that modified versions be marked as | |||||
| changed, so that their problems will not be attributed erroneously to | |||||
| authors of previous versions. | |||||
| Some devices are designed to deny users access to install or run | |||||
| modified versions of the software inside them, although the manufacturer | |||||
| can do so. This is fundamentally incompatible with the aim of | |||||
| protecting users' freedom to change the software. The systematic | |||||
| pattern of such abuse occurs in the area of products for individuals to | |||||
| use, which is precisely where it is most unacceptable. Therefore, we | |||||
| have designed this version of the GPL to prohibit the practice for those | |||||
| products. If such problems arise substantially in other domains, we | |||||
| stand ready to extend this provision to those domains in future versions | |||||
| of the GPL, as needed to protect the freedom of users. | |||||
| Finally, every program is threatened constantly by software patents. | |||||
| States should not allow patents to restrict development and use of | |||||
| software on general-purpose computers, but in those that do, we wish to | |||||
| avoid the special danger that patents applied to a free program could | |||||
| make it effectively proprietary. To prevent this, the GPL assures that | |||||
| patents cannot be used to render the program non-free. | |||||
| The precise terms and conditions for copying, distribution and | |||||
| modification follow. | |||||
| TERMS AND CONDITIONS | |||||
| 0. Definitions. | |||||
| "This License" refers to version 3 of the GNU General Public License. | |||||
| "Copyright" also means copyright-like laws that apply to other kinds of | |||||
| works, such as semiconductor masks. | |||||
| "The Program" refers to any copyrightable work licensed under this | |||||
| License. Each licensee is addressed as "you". "Licensees" and | |||||
| "recipients" may be individuals or organizations. | |||||
| To "modify" a work means to copy from or adapt all or part of the work | |||||
| in a fashion requiring copyright permission, other than the making of an | |||||
| exact copy. The resulting work is called a "modified version" of the | |||||
| earlier work or a work "based on" the earlier work. | |||||
| A "covered work" means either the unmodified Program or a work based | |||||
| on the Program. | |||||
| To "propagate" a work means to do anything with it that, without | |||||
| permission, would make you directly or secondarily liable for | |||||
| infringement under applicable copyright law, except executing it on a | |||||
| computer or modifying a private copy. Propagation includes copying, | |||||
| distribution (with or without modification), making available to the | |||||
| public, and in some countries other activities as well. | |||||
| To "convey" a work means any kind of propagation that enables other | |||||
| parties to make or receive copies. Mere interaction with a user through | |||||
| a computer network, with no transfer of a copy, is not conveying. | |||||
| An interactive user interface displays "Appropriate Legal Notices" | |||||
| to the extent that it includes a convenient and prominently visible | |||||
| feature that (1) displays an appropriate copyright notice, and (2) | |||||
| tells the user that there is no warranty for the work (except to the | |||||
| extent that warranties are provided), that licensees may convey the | |||||
| work under this License, and how to view a copy of this License. If | |||||
| the interface presents a list of user commands or options, such as a | |||||
| menu, a prominent item in the list meets this criterion. | |||||
| 1. Source Code. | |||||
| The "source code" for a work means the preferred form of the work | |||||
| for making modifications to it. "Object code" means any non-source | |||||
| form of a work. | |||||
| A "Standard Interface" means an interface that either is an official | |||||
| standard defined by a recognized standards body, or, in the case of | |||||
| interfaces specified for a particular programming language, one that | |||||
| is widely used among developers working in that language. | |||||
| The "System Libraries" of an executable work include anything, other | |||||
| than the work as a whole, that (a) is included in the normal form of | |||||
| packaging a Major Component, but which is not part of that Major | |||||
| Component, and (b) serves only to enable use of the work with that | |||||
| Major Component, or to implement a Standard Interface for which an | |||||
| implementation is available to the public in source code form. A | |||||
| "Major Component", in this context, means a major essential component | |||||
| (kernel, window system, and so on) of the specific operating system | |||||
| (if any) on which the executable work runs, or a compiler used to | |||||
| produce the work, or an object code interpreter used to run it. | |||||
| The "Corresponding Source" for a work in object code form means all | |||||
| the source code needed to generate, install, and (for an executable | |||||
| work) run the object code and to modify the work, including scripts to | |||||
| control those activities. However, it does not include the work's | |||||
| System Libraries, or general-purpose tools or generally available free | |||||
| programs which are used unmodified in performing those activities but | |||||
| which are not part of the work. For example, Corresponding Source | |||||
| includes interface definition files associated with source files for | |||||
| the work, and the source code for shared libraries and dynamically | |||||
| linked subprograms that the work is specifically designed to require, | |||||
| such as by intimate data communication or control flow between those | |||||
| subprograms and other parts of the work. | |||||
| The Corresponding Source need not include anything that users | |||||
| can regenerate automatically from other parts of the Corresponding | |||||
| Source. | |||||
| The Corresponding Source for a work in source code form is that | |||||
| same work. | |||||
| 2. Basic Permissions. | |||||
| All rights granted under this License are granted for the term of | |||||
| copyright on the Program, and are irrevocable provided the stated | |||||
| conditions are met. This License explicitly affirms your unlimited | |||||
| permission to run the unmodified Program. The output from running a | |||||
| covered work is covered by this License only if the output, given its | |||||
| content, constitutes a covered work. This License acknowledges your | |||||
| rights of fair use or other equivalent, as provided by copyright law. | |||||
| You may make, run and propagate covered works that you do not | |||||
| convey, without conditions so long as your license otherwise remains | |||||
| in force. You may convey covered works to others for the sole purpose | |||||
| of having them make modifications exclusively for you, or provide you | |||||
| with facilities for running those works, provided that you comply with | |||||
| the terms of this License in conveying all material for which you do | |||||
| not control copyright. Those thus making or running the covered works | |||||
| for you must do so exclusively on your behalf, under your direction | |||||
| and control, on terms that prohibit them from making any copies of | |||||
| your copyrighted material outside their relationship with you. | |||||
| Conveying under any other circumstances is permitted solely under | |||||
| the conditions stated below. Sublicensing is not allowed; section 10 | |||||
| makes it unnecessary. | |||||
| 3. Protecting Users' Legal Rights From Anti-Circumvention Law. | |||||
| No covered work shall be deemed part of an effective technological | |||||
| measure under any applicable law fulfilling obligations under article | |||||
| 11 of the WIPO copyright treaty adopted on 20 December 1996, or | |||||
| similar laws prohibiting or restricting circumvention of such | |||||
| measures. | |||||
| When you convey a covered work, you waive any legal power to forbid | |||||
| circumvention of technological measures to the extent such circumvention | |||||
| is effected by exercising rights under this License with respect to | |||||
| the covered work, and you disclaim any intention to limit operation or | |||||
| modification of the work as a means of enforcing, against the work's | |||||
| users, your or third parties' legal rights to forbid circumvention of | |||||
| technological measures. | |||||
| 4. Conveying Verbatim Copies. | |||||
| You may convey verbatim copies of the Program's source code as you | |||||
| receive it, in any medium, provided that you conspicuously and | |||||
| appropriately publish on each copy an appropriate copyright notice; | |||||
| keep intact all notices stating that this License and any | |||||
| non-permissive terms added in accord with section 7 apply to the code; | |||||
| keep intact all notices of the absence of any warranty; and give all | |||||
| recipients a copy of this License along with the Program. | |||||
| You may charge any price or no price for each copy that you convey, | |||||
| and you may offer support or warranty protection for a fee. | |||||
| 5. Conveying Modified Source Versions. | |||||
| You may convey a work based on the Program, or the modifications to | |||||
| produce it from the Program, in the form of source code under the | |||||
| terms of section 4, provided that you also meet all of these conditions: | |||||
| a) The work must carry prominent notices stating that you modified | |||||
| it, and giving a relevant date. | |||||
| b) The work must carry prominent notices stating that it is | |||||
| released under this License and any conditions added under section | |||||
| 7. This requirement modifies the requirement in section 4 to | |||||
| "keep intact all notices". | |||||
| c) You must license the entire work, as a whole, under this | |||||
| License to anyone who comes into possession of a copy. This | |||||
| License will therefore apply, along with any applicable section 7 | |||||
| additional terms, to the whole of the work, and all its parts, | |||||
| regardless of how they are packaged. This License gives no | |||||
| permission to license the work in any other way, but it does not | |||||
| invalidate such permission if you have separately received it. | |||||
| d) If the work has interactive user interfaces, each must display | |||||
| Appropriate Legal Notices; however, if the Program has interactive | |||||
| interfaces that do not display Appropriate Legal Notices, your | |||||
| work need not make them do so. | |||||
| A compilation of a covered work with other separate and independent | |||||
| works, which are not by their nature extensions of the covered work, | |||||
| and which are not combined with it such as to form a larger program, | |||||
| in or on a volume of a storage or distribution medium, is called an | |||||
| "aggregate" if the compilation and its resulting copyright are not | |||||
| used to limit the access or legal rights of the compilation's users | |||||
| beyond what the individual works permit. Inclusion of a covered work | |||||
| in an aggregate does not cause this License to apply to the other | |||||
| parts of the aggregate. | |||||
| 6. Conveying Non-Source Forms. | |||||
| You may convey a covered work in object code form under the terms | |||||
| of sections 4 and 5, provided that you also convey the | |||||
| machine-readable Corresponding Source under the terms of this License, | |||||
| in one of these ways: | |||||
| a) Convey the object code in, or embodied in, a physical product | |||||
| (including a physical distribution medium), accompanied by the | |||||
| Corresponding Source fixed on a durable physical medium | |||||
| customarily used for software interchange. | |||||
| b) Convey the object code in, or embodied in, a physical product | |||||
| (including a physical distribution medium), accompanied by a | |||||
| written offer, valid for at least three years and valid for as | |||||
| long as you offer spare parts or customer support for that product | |||||
| model, to give anyone who possesses the object code either (1) a | |||||
| copy of the Corresponding Source for all the software in the | |||||
| product that is covered by this License, on a durable physical | |||||
| medium customarily used for software interchange, for a price no | |||||
| more than your reasonable cost of physically performing this | |||||
| conveying of source, or (2) access to copy the | |||||
| Corresponding Source from a network server at no charge. | |||||
| c) Convey individual copies of the object code with a copy of the | |||||
| written offer to provide the Corresponding Source. This | |||||
| alternative is allowed only occasionally and noncommercially, and | |||||
| only if you received the object code with such an offer, in accord | |||||
| with subsection 6b. | |||||
| d) Convey the object code by offering access from a designated | |||||
| place (gratis or for a charge), and offer equivalent access to the | |||||
| Corresponding Source in the same way through the same place at no | |||||
| further charge. You need not require recipients to copy the | |||||
| Corresponding Source along with the object code. If the place to | |||||
| copy the object code is a network server, the Corresponding Source | |||||
| may be on a different server (operated by you or a third party) | |||||
| that supports equivalent copying facilities, provided you maintain | |||||
| clear directions next to the object code saying where to find the | |||||
| Corresponding Source. Regardless of what server hosts the | |||||
| Corresponding Source, you remain obligated to ensure that it is | |||||
| available for as long as needed to satisfy these requirements. | |||||
| e) Convey the object code using peer-to-peer transmission, provided | |||||
| you inform other peers where the object code and Corresponding | |||||
| Source of the work are being offered to the general public at no | |||||
| charge under subsection 6d. | |||||
| A separable portion of the object code, whose source code is excluded | |||||
| from the Corresponding Source as a System Library, need not be | |||||
| included in conveying the object code work. | |||||
| A "User Product" is either (1) a "consumer product", which means any | |||||
| tangible personal property which is normally used for personal, family, | |||||
| or household purposes, or (2) anything designed or sold for incorporation | |||||
| into a dwelling. In determining whether a product is a consumer product, | |||||
| doubtful cases shall be resolved in favor of coverage. For a particular | |||||
| product received by a particular user, "normally used" refers to a | |||||
| typical or common use of that class of product, regardless of the status | |||||
| of the particular user or of the way in which the particular user | |||||
| actually uses, or expects or is expected to use, the product. A product | |||||
| is a consumer product regardless of whether the product has substantial | |||||
| commercial, industrial or non-consumer uses, unless such uses represent | |||||
| the only significant mode of use of the product. | |||||
| "Installation Information" for a User Product means any methods, | |||||
| procedures, authorization keys, or other information required to install | |||||
| and execute modified versions of a covered work in that User Product from | |||||
| a modified version of its Corresponding Source. The information must | |||||
| suffice to ensure that the continued functioning of the modified object | |||||
| code is in no case prevented or interfered with solely because | |||||
| modification has been made. | |||||
| If you convey an object code work under this section in, or with, or | |||||
| specifically for use in, a User Product, and the conveying occurs as | |||||
| part of a transaction in which the right of possession and use of the | |||||
| User Product is transferred to the recipient in perpetuity or for a | |||||
| fixed term (regardless of how the transaction is characterized), the | |||||
| Corresponding Source conveyed under this section must be accompanied | |||||
| by the Installation Information. But this requirement does not apply | |||||
| if neither you nor any third party retains the ability to install | |||||
| modified object code on the User Product (for example, the work has | |||||
| been installed in ROM). | |||||
| The requirement to provide Installation Information does not include a | |||||
| requirement to continue to provide support service, warranty, or updates | |||||
| for a work that has been modified or installed by the recipient, or for | |||||
| the User Product in which it has been modified or installed. Access to a | |||||
| network may be denied when the modification itself materially and | |||||
| adversely affects the operation of the network or violates the rules and | |||||
| protocols for communication across the network. | |||||
| Corresponding Source conveyed, and Installation Information provided, | |||||
| in accord with this section must be in a format that is publicly | |||||
| documented (and with an implementation available to the public in | |||||
| source code form), and must require no special password or key for | |||||
| unpacking, reading or copying. | |||||
| 7. Additional Terms. | |||||
| "Additional permissions" are terms that supplement the terms of this | |||||
| License by making exceptions from one or more of its conditions. | |||||
| Additional permissions that are applicable to the entire Program shall | |||||
| be treated as though they were included in this License, to the extent | |||||
| that they are valid under applicable law. If additional permissions | |||||
| apply only to part of the Program, that part may be used separately | |||||
| under those permissions, but the entire Program remains governed by | |||||
| this License without regard to the additional permissions. | |||||
| When you convey a copy of a covered work, you may at your option | |||||
| remove any additional permissions from that copy, or from any part of | |||||
| it. (Additional permissions may be written to require their own | |||||
| removal in certain cases when you modify the work.) You may place | |||||
| additional permissions on material, added by you to a covered work, | |||||
| for which you have or can give appropriate copyright permission. | |||||
| Notwithstanding any other provision of this License, for material you | |||||
| add to a covered work, you may (if authorized by the copyright holders of | |||||
| that material) supplement the terms of this License with terms: | |||||
| a) Disclaiming warranty or limiting liability differently from the | |||||
| terms of sections 15 and 16 of this License; or | |||||
| b) Requiring preservation of specified reasonable legal notices or | |||||
| author attributions in that material or in the Appropriate Legal | |||||
| Notices displayed by works containing it; or | |||||
| c) Prohibiting misrepresentation of the origin of that material, or | |||||
| requiring that modified versions of such material be marked in | |||||
| reasonable ways as different from the original version; or | |||||
| d) Limiting the use for publicity purposes of names of licensors or | |||||
| authors of the material; or | |||||
| e) Declining to grant rights under trademark law for use of some | |||||
| trade names, trademarks, or service marks; or | |||||
| f) Requiring indemnification of licensors and authors of that | |||||
| material by anyone who conveys the material (or modified versions of | |||||
| it) with contractual assumptions of liability to the recipient, for | |||||
| any liability that these contractual assumptions directly impose on | |||||
| those licensors and authors. | |||||
| All other non-permissive additional terms are considered "further | |||||
| restrictions" within the meaning of section 10. If the Program as you | |||||
| received it, or any part of it, contains a notice stating that it is | |||||
| governed by this License along with a term that is a further | |||||
| restriction, you may remove that term. If a license document contains | |||||
| a further restriction but permits relicensing or conveying under this | |||||
| License, you may add to a covered work material governed by the terms | |||||
| of that license document, provided that the further restriction does | |||||
| not survive such relicensing or conveying. | |||||
| If you add terms to a covered work in accord with this section, you | |||||
| must place, in the relevant source files, a statement of the | |||||
| additional terms that apply to those files, or a notice indicating | |||||
| where to find the applicable terms. | |||||
| Additional terms, permissive or non-permissive, may be stated in the | |||||
| form of a separately written license, or stated as exceptions; | |||||
| the above requirements apply either way. | |||||
| 8. Termination. | |||||
| You may not propagate or modify a covered work except as expressly | |||||
| provided under this License. Any attempt otherwise to propagate or | |||||
| modify it is void, and will automatically terminate your rights under | |||||
| this License (including any patent licenses granted under the third | |||||
| paragraph of section 11). | |||||
| However, if you cease all violation of this License, then your | |||||
| license from a particular copyright holder is reinstated (a) | |||||
| provisionally, unless and until the copyright holder explicitly and | |||||
| finally terminates your license, and (b) permanently, if the copyright | |||||
| holder fails to notify you of the violation by some reasonable means | |||||
| prior to 60 days after the cessation. | |||||
| Moreover, your license from a particular copyright holder is | |||||
| reinstated permanently if the copyright holder notifies you of the | |||||
| violation by some reasonable means, this is the first time you have | |||||
| received notice of violation of this License (for any work) from that | |||||
| copyright holder, and you cure the violation prior to 30 days after | |||||
| your receipt of the notice. | |||||
| Termination of your rights under this section does not terminate the | |||||
| licenses of parties who have received copies or rights from you under | |||||
| this License. If your rights have been terminated and not permanently | |||||
| reinstated, you do not qualify to receive new licenses for the same | |||||
| material under section 10. | |||||
| 9. Acceptance Not Required for Having Copies. | |||||
| You are not required to accept this License in order to receive or | |||||
| run a copy of the Program. Ancillary propagation of a covered work | |||||
| occurring solely as a consequence of using peer-to-peer transmission | |||||
| to receive a copy likewise does not require acceptance. However, | |||||
| nothing other than this License grants you permission to propagate or | |||||
| modify any covered work. These actions infringe copyright if you do | |||||
| not accept this License. Therefore, by modifying or propagating a | |||||
| covered work, you indicate your acceptance of this License to do so. | |||||
| 10. Automatic Licensing of Downstream Recipients. | |||||
| Each time you convey a covered work, the recipient automatically | |||||
| receives a license from the original licensors, to run, modify and | |||||
| propagate that work, subject to this License. You are not responsible | |||||
| for enforcing compliance by third parties with this License. | |||||
| An "entity transaction" is a transaction transferring control of an | |||||
| organization, or substantially all assets of one, or subdividing an | |||||
| organization, or merging organizations. If propagation of a covered | |||||
| work results from an entity transaction, each party to that | |||||
| transaction who receives a copy of the work also receives whatever | |||||
| licenses to the work the party's predecessor in interest had or could | |||||
| give under the previous paragraph, plus a right to possession of the | |||||
| Corresponding Source of the work from the predecessor in interest, if | |||||
| the predecessor has it or can get it with reasonable efforts. | |||||
| You may not impose any further restrictions on the exercise of the | |||||
| rights granted or affirmed under this License. For example, you may | |||||
| not impose a license fee, royalty, or other charge for exercise of | |||||
| rights granted under this License, and you may not initiate litigation | |||||
| (including a cross-claim or counterclaim in a lawsuit) alleging that | |||||
| any patent claim is infringed by making, using, selling, offering for | |||||
| sale, or importing the Program or any portion of it. | |||||
| 11. Patents. | |||||
| A "contributor" is a copyright holder who authorizes use under this | |||||
| License of the Program or a work on which the Program is based. The | |||||
| work thus licensed is called the contributor's "contributor version". | |||||
| A contributor's "essential patent claims" are all patent claims | |||||
| owned or controlled by the contributor, whether already acquired or | |||||
| hereafter acquired, that would be infringed by some manner, permitted | |||||
| by this License, of making, using, or selling its contributor version, | |||||
| but do not include claims that would be infringed only as a | |||||
| consequence of further modification of the contributor version. For | |||||
| purposes of this definition, "control" includes the right to grant | |||||
| patent sublicenses in a manner consistent with the requirements of | |||||
| this License. | |||||
| Each contributor grants you a non-exclusive, worldwide, royalty-free | |||||
| patent license under the contributor's essential patent claims, to | |||||
| make, use, sell, offer for sale, import and otherwise run, modify and | |||||
| propagate the contents of its contributor version. | |||||
| In the following three paragraphs, a "patent license" is any express | |||||
| agreement or commitment, however denominated, not to enforce a patent | |||||
| (such as an express permission to practice a patent or covenant not to | |||||
| sue for patent infringement). To "grant" such a patent license to a | |||||
| party means to make such an agreement or commitment not to enforce a | |||||
| patent against the party. | |||||
| If you convey a covered work, knowingly relying on a patent license, | |||||
| and the Corresponding Source of the work is not available for anyone | |||||
| to copy, free of charge and under the terms of this License, through a | |||||
| publicly available network server or other readily accessible means, | |||||
| then you must either (1) cause the Corresponding Source to be so | |||||
| available, or (2) arrange to deprive yourself of the benefit of the | |||||
| patent license for this particular work, or (3) arrange, in a manner | |||||
| consistent with the requirements of this License, to extend the patent | |||||
| license to downstream recipients. "Knowingly relying" means you have | |||||
| actual knowledge that, but for the patent license, your conveying the | |||||
| covered work in a country, or your recipient's use of the covered work | |||||
| in a country, would infringe one or more identifiable patents in that | |||||
| country that you have reason to believe are valid. | |||||
| If, pursuant to or in connection with a single transaction or | |||||
| arrangement, you convey, or propagate by procuring conveyance of, a | |||||
| covered work, and grant a patent license to some of the parties | |||||
| receiving the covered work authorizing them to use, propagate, modify | |||||
| or convey a specific copy of the covered work, then the patent license | |||||
| you grant is automatically extended to all recipients of the covered | |||||
| work and works based on it. | |||||
| A patent license is "discriminatory" if it does not include within | |||||
| the scope of its coverage, prohibits the exercise of, or is | |||||
| conditioned on the non-exercise of one or more of the rights that are | |||||
| specifically granted under this License. You may not convey a covered | |||||
| work if you are a party to an arrangement with a third party that is | |||||
| in the business of distributing software, under which you make payment | |||||
| to the third party based on the extent of your activity of conveying | |||||
| the work, and under which the third party grants, to any of the | |||||
| parties who would receive the covered work from you, a discriminatory | |||||
| patent license (a) in connection with copies of the covered work | |||||
| conveyed by you (or copies made from those copies), or (b) primarily | |||||
| for and in connection with specific products or compilations that | |||||
| contain the covered work, unless you entered into that arrangement, | |||||
| or that patent license was granted, prior to 28 March 2007. | |||||
| Nothing in this License shall be construed as excluding or limiting | |||||
| any implied license or other defenses to infringement that may | |||||
| otherwise be available to you under applicable patent law. | |||||
| 12. No Surrender of Others' Freedom. | |||||
| If conditions are imposed on you (whether by court order, agreement or | |||||
| otherwise) that contradict the conditions of this License, they do not | |||||
| excuse you from the conditions of this License. If you cannot convey a | |||||
| covered work so as to satisfy simultaneously your obligations under this | |||||
| License and any other pertinent obligations, then as a consequence you may | |||||
| not convey it at all. For example, if you agree to terms that obligate you | |||||
| to collect a royalty for further conveying from those to whom you convey | |||||
| the Program, the only way you could satisfy both those terms and this | |||||
| License would be to refrain entirely from conveying the Program. | |||||
| 13. Use with the GNU Affero General Public License. | |||||
| Notwithstanding any other provision of this License, you have | |||||
| permission to link or combine any covered work with a work licensed | |||||
| under version 3 of the GNU Affero General Public License into a single | |||||
| combined work, and to convey the resulting work. The terms of this | |||||
| License will continue to apply to the part which is the covered work, | |||||
| but the special requirements of the GNU Affero General Public License, | |||||
| section 13, concerning interaction through a network will apply to the | |||||
| combination as such. | |||||
| 14. Revised Versions of this License. | |||||
| The Free Software Foundation may publish revised and/or new versions of | |||||
| the GNU General Public License from time to time. Such new versions will | |||||
| be similar in spirit to the present version, but may differ in detail to | |||||
| address new problems or concerns. | |||||
| Each version is given a distinguishing version number. If the | |||||
| Program specifies that a certain numbered version of the GNU General | |||||
| Public License "or any later version" applies to it, you have the | |||||
| option of following the terms and conditions either of that numbered | |||||
| version or of any later version published by the Free Software | |||||
| Foundation. If the Program does not specify a version number of the | |||||
| GNU General Public License, you may choose any version ever published | |||||
| by the Free Software Foundation. | |||||
| If the Program specifies that a proxy can decide which future | |||||
| versions of the GNU General Public License can be used, that proxy's | |||||
| public statement of acceptance of a version permanently authorizes you | |||||
| to choose that version for the Program. | |||||
| Later license versions may give you additional or different | |||||
| permissions. However, no additional obligations are imposed on any | |||||
| author or copyright holder as a result of your choosing to follow a | |||||
| later version. | |||||
| 15. Disclaimer of Warranty. | |||||
| THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY | |||||
| APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT | |||||
| HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY | |||||
| OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, | |||||
| THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |||||
| PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM | |||||
| IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF | |||||
| ALL NECESSARY SERVICING, REPAIR OR CORRECTION. | |||||
| 16. Limitation of Liability. | |||||
| IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING | |||||
| WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS | |||||
| THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY | |||||
| GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE | |||||
| USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF | |||||
| DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD | |||||
| PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), | |||||
| EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF | |||||
| SUCH DAMAGES. | |||||
| 17. Interpretation of Sections 15 and 16. | |||||
| If the disclaimer of warranty and limitation of liability provided | |||||
| above cannot be given local legal effect according to their terms, | |||||
| reviewing courts shall apply local law that most closely approximates | |||||
| an absolute waiver of all civil liability in connection with the | |||||
| Program, unless a warranty or assumption of liability accompanies a | |||||
| copy of the Program in return for a fee. | |||||
| END OF TERMS AND CONDITIONS | |||||
| How to Apply These Terms to Your New Programs | |||||
| If you develop a new program, and you want it to be of the greatest | |||||
| possible use to the public, the best way to achieve this is to make it | |||||
| free software which everyone can redistribute and change under these terms. | |||||
| To do so, attach the following notices to the program. It is safest | |||||
| to attach them to the start of each source file to most effectively | |||||
| state the exclusion of warranty; and each file should have at least | |||||
| the "copyright" line and a pointer to where the full notice is found. | |||||
| <one line to give the program's name and a brief idea of what it does.> | |||||
| Copyright (C) <year> <name of author> | |||||
| This program is free software: you can redistribute it and/or modify | |||||
| it under the terms of the GNU General Public License as published by | |||||
| the Free Software Foundation, either version 3 of the License, or | |||||
| (at your option) any later version. | |||||
| This program is distributed in the hope that it will be useful, | |||||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
| GNU General Public License for more details. | |||||
| You should have received a copy of the GNU General Public License | |||||
| along with this program. If not, see <https://www.gnu.org/licenses/>. | |||||
| Also add information on how to contact you by electronic and paper mail. | |||||
| If the program does terminal interaction, make it output a short | |||||
| notice like this when it starts in an interactive mode: | |||||
| <program> Copyright (C) <year> <name of author> | |||||
| This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. | |||||
| This is free software, and you are welcome to redistribute it | |||||
| under certain conditions; type `show c' for details. | |||||
| The hypothetical commands `show w' and `show c' should show the appropriate | |||||
| parts of the General Public License. Of course, your program's commands | |||||
| might be different; for a GUI interface, you would use an "about box". | |||||
| You should also get your employer (if you work as a programmer) or school, | |||||
| if any, to sign a "copyright disclaimer" for the program, if necessary. | |||||
| For more information on this, and how to apply and follow the GNU GPL, see | |||||
| <https://www.gnu.org/licenses/>. | |||||
| The GNU General Public License does not permit incorporating your program | |||||
| into proprietary programs. If your program is a subroutine library, you | |||||
| may consider it more useful to permit linking proprietary applications with | |||||
| the library. If this is what you want to do, use the GNU Lesser General | |||||
| Public License instead of this License. But first, please read | |||||
| <https://www.gnu.org/licenses/why-not-lgpl.html>. | |||||
| @@ -0,0 +1,2 @@ | |||||
| # azure_lngw | |||||
| Manage Azure local network gateway | |||||
| @@ -0,0 +1,11 @@ | |||||
| --- | |||||
| #lngws: | |||||
| # - name: | |||||
| # resource_group: | |||||
| # virtual_network: | |||||
| # state: | |||||
| # body: | |||||
| # method: | |||||
| # subresource: | |||||
| # status_code: | |||||
| ... | |||||
| @@ -0,0 +1,16 @@ | |||||
| --- | |||||
| - name: Delete local network gateway | |||||
| azure_rm_resource: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| provider: "Network" | |||||
| resource_name: "{{ lngw.name | urlencode }}" | |||||
| resource_group: "{{ lngw.resource_group }}" | |||||
| resource_type: "localNetworkGateways" | |||||
| state: "absent" | |||||
| register: deletelngw | |||||
| ... | |||||
| @@ -0,0 +1,30 @@ | |||||
| --- | |||||
| - name: In local network gateway state | |||||
| include: "{{ item.state | default('present', true) }}.yml" | |||||
| vars: | |||||
| lngw: "{{ item }}" | |||||
| when: | |||||
| - action is undefined | |||||
| - (lngws | default([], true) | length) > 0 | |||||
| with_items: "{{ lngws }}" | |||||
| - name: Update/create local network gateway | |||||
| include: present.yml | |||||
| vars: | |||||
| lngw: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'present' | |||||
| - (lngws | default([], true) | length) > 0 | |||||
| with_items: "{{ lngws }}" | |||||
| - name: Delete local network gateway | |||||
| include: absent.yml | |||||
| vars: | |||||
| lngw: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'absent' | |||||
| - (lngws | default([], true) | length) > 0 | |||||
| with_items: "{{ lngws }}" | |||||
| ... | |||||
| @@ -0,0 +1,27 @@ | |||||
| --- | |||||
| - name: load template | |||||
| template: | |||||
| src: azure_local_network_gateway.j2 | |||||
| dest: /tmp/azure_local_network_gateway_body.json | |||||
| changed_when: false | |||||
| - name: Create local network gateway | |||||
| azure_rm_resource: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| resource_name: "{{ lngw.name | urlencode }}" | |||||
| resource_type: "localNetworkGateways" | |||||
| resource_group: "{{ lngw.resource_group }}" | |||||
| provider: "Network" | |||||
| idempotency: true | |||||
| body: "{{ lookup('file', '/tmp/azure_local_network_gateway_body.json') }}" | |||||
| method: "{{ lngw.method | default(omit, true) }}" | |||||
| subresource: "{{ lngw.subresource | default(omit, true) }}" | |||||
| status_code: "{{ lngw.status_code | default(omit, true) }}" | |||||
| state: "present" | |||||
| register: createres | |||||
| ... | |||||
| @@ -1,2 +1,2 @@ | |||||
| # azure_nic | |||||
| Manage Azure network interface configuration | |||||
| # azure_nic | |||||
| Manage Azure network interface configuration | |||||
| @@ -1,17 +1,17 @@ | |||||
| #nics: | |||||
| # - name: | |||||
| # create_with_security_group: false | |||||
| # dns_servers: [] | |||||
| # enable_accelerated_networking: true | |||||
| # enable_ip_forwarding: true | |||||
| # ip_configurations: {} | |||||
| # resource_group: | |||||
| # security_group: | |||||
| # subnet_name: | |||||
| # virtual_network: | |||||
| # state: | |||||
| # tags: | |||||
| # "env": "prod" | |||||
| # "provisioner": "ansible" | |||||
| ... | |||||
| --- | |||||
| #nics: | |||||
| # - name: | |||||
| # create_with_security_group: false | |||||
| # dns_servers: [] | |||||
| # enable_accelerated_networking: true | |||||
| # enable_ip_forwarding: true | |||||
| # ip_configurations: {} | |||||
| # resource_group: | |||||
| # security_group: | |||||
| # subnet_name: | |||||
| # virtual_network: | |||||
| # state: | |||||
| # tags: | |||||
| # "env": "prod" | |||||
| # "provisioner": "ansible" | |||||
| ... | |||||
| @@ -1,36 +1,36 @@ | |||||
| - set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | | |||||
| union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', nic.tags | default({})) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get network interface | |||||
| azure_rm_networkinterface_facts: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| resource_group: "{{ nic.resource_group }}" | |||||
| tags: "{{ tags_list | default(omit) }}" | |||||
| name: "{{ nic.name | default(omit) }}" | |||||
| register: azure_nic_facts | |||||
| - name: Delete network interface | |||||
| azure_rm_networkinterface: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| name: "{{ nic.name }}" | |||||
| resource_group: "{{ nic.resource_group }}" | |||||
| subnet_name: "{{ nic.subnet_name }}" | |||||
| virtual_network: "{{ nic.virtual_network }}" | |||||
| state: "absent" | |||||
| register: deletednic | |||||
| ... | |||||
| --- | |||||
| - name: Build tags list | |||||
| set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', nic.tags | default({})) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get network interface | |||||
| azure_rm_networkinterface_info: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| resource_group: "{{ nic.resource_group }}" | |||||
| tags: "{{ tags_list | default(omit) }}" | |||||
| name: "{{ nic.name | default(omit) }}" | |||||
| register: azure_nic_facts | |||||
| - name: Delete network interface | |||||
| azure_rm_networkinterface: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| name: "{{ nic.name }}" | |||||
| resource_group: "{{ nic.resource_group }}" | |||||
| subnet_name: "{{ nic.subnet_name }}" | |||||
| virtual_network: "{{ nic.virtual_network }}" | |||||
| state: "absent" | |||||
| register: deletednic | |||||
| ... | |||||
| @@ -1,25 +1,25 @@ | |||||
| - set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | | |||||
| union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', nic.tags | default({})) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get network interface | |||||
| azure_rm_networkinterface_facts: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| resource_group: "{{ nic.resource_group }}" | |||||
| tags: "{{ tags_list | default(omit) }}" | |||||
| name: "{{ nic.name | default(omit) }}" | |||||
| register: azure_nic_facts | |||||
| - name: Print network interface | |||||
| debug: | |||||
| var: azure_nic_facts.networkinterfaces | |||||
| ... | |||||
| --- | |||||
| - name: Build tags list | |||||
| set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', nic.tags | default({})) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get network interface | |||||
| azure_rm_networkinterface_info: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| resource_group: "{{ nic.resource_group }}" | |||||
| tags: "{{ tags_list | default(omit) }}" | |||||
| name: "{{ nic.name | default(omit) }}" | |||||
| register: azure_nic_facts | |||||
| - name: Print network interface | |||||
| debug: | |||||
| var: azure_nic_facts.networkinterfaces | |||||
| ... | |||||
| @@ -1,42 +1,40 @@ | |||||
| - name: list network interface | |||||
| include: list.yml | |||||
| vars: | |||||
| nic: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'list' | |||||
| - (nics | default([], true) | length) > 0 | |||||
| with_items: "{{ nics }}" | |||||
| - name: In network interface state | |||||
| include: "{{ item.state | default('present', true) }}.yml" | |||||
| vars: | |||||
| nic: "{{ item }}" | |||||
| when: | |||||
| - action is undefined | |||||
| - (nics | default([], true) | length) > 0 | |||||
| with_items: "{{ nics }}" | |||||
| - name: Update/create network interface | |||||
| include: present.yml | |||||
| vars: | |||||
| nic: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'present' | |||||
| - item.state is undefined | |||||
| - (nics | default([], true) | length) > 0 | |||||
| with_items: "{{ nics }}" | |||||
| - name: Delete network interface | |||||
| include: absent.yml | |||||
| vars: | |||||
| nic: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'absent' | |||||
| - item.state is undefined | |||||
| - (nics | default([], true) | length) > 0 | |||||
| with_items: "{{ nics }}" | |||||
| ... | |||||
| --- | |||||
| - name: list network interface | |||||
| include: list.yml | |||||
| vars: | |||||
| nic: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'list' | |||||
| - (nics | default([], true) | length) > 0 | |||||
| with_items: "{{ nics }}" | |||||
| - name: In network interface state | |||||
| include: "{{ item.state | default('present', true) }}.yml" | |||||
| vars: | |||||
| nic: "{{ item }}" | |||||
| when: | |||||
| - action is undefined | |||||
| - (nics | default([], true) | length) > 0 | |||||
| with_items: "{{ nics }}" | |||||
| - name: Update/create network interface | |||||
| include: present.yml | |||||
| vars: | |||||
| nic: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'present' | |||||
| - (nics | default([], true) | length) > 0 | |||||
| with_items: "{{ nics }}" | |||||
| - name: Delete network interface | |||||
| include: absent.yml | |||||
| vars: | |||||
| nic: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'absent' | |||||
| - (nics | default([], true) | length) > 0 | |||||
| with_items: "{{ nics }}" | |||||
| ... | |||||
| @@ -1,46 +1,45 @@ | |||||
| - set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | | |||||
| union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', nic.tags | default({}, true)) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get network interface | |||||
| azure_rm_networkinterface_facts: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| resource_group: "{{ nic.resource_group }}" | |||||
| tags: "{{ tags_list | default(omit) }}" | |||||
| name: "{{ nic.name | default(omit) }}" | |||||
| register: azure_nic_facts | |||||
| - name: Create network interface | |||||
| azure_rm_networkinterface: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| name: "{{ nic.name }}" | |||||
| create_with_security_group: "{{ nic.create_with_security_group | default(false, true) }}" | |||||
| dns_servers: "{{ nic.dns_servers | default(omit, true) }}" | |||||
| enable_accelerated_networking: "{{ nic.enable_accelerated_networking | |||||
| | default(omit, true) }}" | |||||
| enable_ip_forwarding: "{{ nic.enable_ip_forwarding | default(true, true) }}" | |||||
| ip_configurations: "{{ nic.ip_configurations | default(omit, true) }}" | |||||
| append_tags: false | |||||
| location: "{{ nic.location | default(omit, true) }}" | |||||
| resource_group: "{{ nic.resource_group }}" | |||||
| security_group: "{{ nic.security_group | default(omit, true) }}" | |||||
| subnet_name: "{{ nic.subnet_name }}" | |||||
| virtual_network: "{{ nic.virtual_network }}" | |||||
| state: "present" | |||||
| tags: "{{ nic.tags | default(omit, true) }}" | |||||
| register: createnic | |||||
| ... | |||||
| --- | |||||
| - name: Build tags list | |||||
| set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', nic.tags | default({}, true)) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get network interface | |||||
| azure_rm_networkinterface_info: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| resource_group: "{{ nic.resource_group }}" | |||||
| tags: "{{ tags_list | default(omit) }}" | |||||
| name: "{{ nic.name | default(omit) }}" | |||||
| register: azure_nic_facts | |||||
| - name: Create network interface | |||||
| azure_rm_networkinterface: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| name: "{{ nic.name }}" | |||||
| create_with_security_group: "{{ nic.create_with_security_group | default(false, true) }}" | |||||
| dns_servers: "{{ nic.dns_servers | default(omit, true) }}" | |||||
| enable_accelerated_networking: "{{ nic.enable_accelerated_networking | default(omit, true) }}" | |||||
| enable_ip_forwarding: "{{ nic.enable_ip_forwarding | default(true, true) }}" | |||||
| ip_configurations: "{{ nic.ip_configurations | default(omit, true) }}" | |||||
| append_tags: false | |||||
| location: "{{ nic.location | default(omit, true) }}" | |||||
| resource_group: "{{ nic.resource_group }}" | |||||
| security_group: "{{ nic.security_group | default(omit, true) }}" | |||||
| subnet_name: "{{ nic.subnet_name }}" | |||||
| virtual_network: "{{ nic.virtual_network }}" | |||||
| state: "present" | |||||
| tags: "{{ nic.tags | default(omit, true) }}" | |||||
| register: createnic | |||||
| ... | |||||
| @@ -1,2 +1,2 @@ | |||||
| # azure_nsg | |||||
| Manage Azure network security group | |||||
| # azure_nsg | |||||
| Manage Azure network security group | |||||
| @@ -1,14 +1,14 @@ | |||||
| #nsgs: | |||||
| # - name: | |||||
| # default_rules: | |||||
| # purge_default_rules: false | |||||
| # rules: | |||||
| # purge_rules: true | |||||
| # location: | |||||
| # resource_group: | |||||
| # state: | |||||
| # tags: | |||||
| # "env": "prod" | |||||
| # "provisioner": "ansible" | |||||
| ... | |||||
| --- | |||||
| #nsgs: | |||||
| # - name: | |||||
| # default_rules: | |||||
| # purge_default_rules: false | |||||
| # rules: | |||||
| # purge_rules: true | |||||
| # location: | |||||
| # resource_group: | |||||
| # state: | |||||
| # tags: | |||||
| # "env": "prod" | |||||
| # "provisioner": "ansible" | |||||
| ... | |||||
| @@ -1,34 +1,34 @@ | |||||
| - set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | | |||||
| union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', nsg.tags | default({})) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get security group | |||||
| azure_rm_securitygroup_facts: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| resource_group: "{{ nsg.resource_group }}" | |||||
| tags: "{{ tags_list | default(omit) }}" | |||||
| name: "{{ nsg.name | default(omit) }}" | |||||
| register: azure_nsg_facts | |||||
| - name: Delete security group | |||||
| azure_rm_securitygroup: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| name: "{{ nsg.name }}" | |||||
| resource_group: "{{ nsg.resource_group }}" | |||||
| state: "absent" | |||||
| register: deletednsg | |||||
| ... | |||||
| --- | |||||
| - name: Build tags list | |||||
| set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', nsg.tags | default({})) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get security group | |||||
| azure_rm_securitygroup_info: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| resource_group: "{{ nsg.resource_group }}" | |||||
| tags: "{{ tags_list | default(omit) }}" | |||||
| name: "{{ nsg.name | default(omit) }}" | |||||
| register: azure_nsg_facts | |||||
| - name: Delete security group | |||||
| azure_rm_securitygroup: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| name: "{{ nsg.name }}" | |||||
| resource_group: "{{ nsg.resource_group }}" | |||||
| state: "absent" | |||||
| register: deletednsg | |||||
| ... | |||||
| @@ -1,25 +1,25 @@ | |||||
| - set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | | |||||
| union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', nsg.tags | default({})) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get security group | |||||
| azure_rm_securitygroup_facts: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| resource_group: "{{ nsg.resource_group }}" | |||||
| tags: "{{ tags_list | default(omit) }}" | |||||
| name: "{{ nsg.name | default(omit) }}" | |||||
| register: azure_nsg_facts | |||||
| - name: Print resource group | |||||
| debug: | |||||
| var: azure_nsg_facts.azure_securitygroups | |||||
| ... | |||||
| --- | |||||
| - name: Build tags list | |||||
| set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', nsg.tags | default({})) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get security group | |||||
| azure_rm_securitygroup_info: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| resource_group: "{{ nsg.resource_group }}" | |||||
| tags: "{{ tags_list | default(omit) }}" | |||||
| name: "{{ nsg.name | default(omit) }}" | |||||
| register: azure_nsg_facts | |||||
| - name: Print resource group | |||||
| debug: | |||||
| var: azure_nsg_facts.azure_securitygroups | |||||
| ... | |||||
| @@ -1,42 +1,40 @@ | |||||
| - name: list security group | |||||
| include: list.yml | |||||
| vars: | |||||
| nsg: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'list' | |||||
| - (nsgs | default([], true) | length) > 0 | |||||
| with_items: "{{ nsgs }}" | |||||
| - name: In security group state | |||||
| include: "{{ item.state | default('present', true) }}.yml" | |||||
| vars: | |||||
| nsg: "{{ item }}" | |||||
| when: | |||||
| - action is undefined | |||||
| - (nsgs | default([], true) | length) > 0 | |||||
| with_items: "{{ nsgs }}" | |||||
| - name: Update/create security group | |||||
| include: present.yml | |||||
| vars: | |||||
| nsg: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'present' | |||||
| - item.state is undefined | |||||
| - (nsgs | default([], true) | length) > 0 | |||||
| with_items: "{{ nsgs }}" | |||||
| - name: Delete security group | |||||
| include: absent.yml | |||||
| vars: | |||||
| nsg: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'absent' | |||||
| - item.state is undefined | |||||
| - (nsgs | default([], true) | length) > 0 | |||||
| with_items: "{{ nsgs }}" | |||||
| ... | |||||
| --- | |||||
| - name: list security group | |||||
| include: list.yml | |||||
| vars: | |||||
| nsg: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'list' | |||||
| - (nsgs | default([], true) | length) > 0 | |||||
| with_items: "{{ nsgs }}" | |||||
| - name: In security group state | |||||
| include: "{{ item.state | default('present', true) }}.yml" | |||||
| vars: | |||||
| nsg: "{{ item }}" | |||||
| when: | |||||
| - action is undefined | |||||
| - (nsgs | default([], true) | length) > 0 | |||||
| with_items: "{{ nsgs }}" | |||||
| - name: Update/create security group | |||||
| include: present.yml | |||||
| vars: | |||||
| nsg: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'present' | |||||
| - (nsgs | default([], true) | length) > 0 | |||||
| with_items: "{{ nsgs }}" | |||||
| - name: Delete security group | |||||
| include: absent.yml | |||||
| vars: | |||||
| nsg: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'absent' | |||||
| - (nsgs | default([], true) | length) > 0 | |||||
| with_items: "{{ nsgs }}" | |||||
| ... | |||||
| @@ -1,41 +1,41 @@ | |||||
| - set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | | |||||
| union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', nsg.tags | default({}, true)) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get security group | |||||
| azure_rm_securitygroup_facts: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| resource_group: "{{ nsg.resource_group }}" | |||||
| tags: "{{ tags_list | default(omit) }}" | |||||
| name: "{{ nsg.name | default(omit) }}" | |||||
| register: azure_nsg_facts | |||||
| - name: Create security group | |||||
| azure_rm_securitygroup: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| name: "{{ nsg.name }}" | |||||
| default_rules: "{{ nsg.default_rules | default(omit, true) }}" | |||||
| purge_default_rules: "{{ nsg.purge_default_rules | default(omit, true) }}" | |||||
| rules: "{{ nsg.rules | default(omit, true) }}" | |||||
| purge_rules: "{{ nsg.purge_rules | default(true, true) }}" | |||||
| append_tags: false | |||||
| location: "{{ nsg.location | default(omit, true) }}" | |||||
| resource_group: "{{ nsg.resource_group }}" | |||||
| state: "present" | |||||
| tags: "{{ nsg.tags | default(omit, true) }}" | |||||
| register: creatensg | |||||
| ... | |||||
| --- | |||||
| - name: Build tags list | |||||
| set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', nsg.tags | default({}, true)) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get security group | |||||
| azure_rm_securitygroup_info: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| resource_group: "{{ nsg.resource_group }}" | |||||
| tags: "{{ tags_list | default(omit) }}" | |||||
| name: "{{ nsg.name | default(omit) }}" | |||||
| register: azure_nsg_facts | |||||
| - name: Create security group | |||||
| azure_rm_securitygroup: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| name: "{{ nsg.name }}" | |||||
| default_rules: "{{ nsg.default_rules | default(omit, true) }}" | |||||
| purge_default_rules: "{{ nsg.purge_default_rules | default(omit, true) }}" | |||||
| rules: "{{ nsg.rules | default(omit, true) }}" | |||||
| purge_rules: "{{ nsg.purge_rules | default(true, true) }}" | |||||
| append_tags: false | |||||
| location: "{{ nsg.location | default(omit, true) }}" | |||||
| resource_group: "{{ nsg.resource_group }}" | |||||
| state: "present" | |||||
| tags: "{{ nsg.tags | default(omit, true) }}" | |||||
| register: creatensg | |||||
| ... | |||||
| @@ -1,2 +1,2 @@ | |||||
| # azure_peering | |||||
| Manage Azure virtual network peering | |||||
| # azure_peering | |||||
| Manage Azure virtual network peering | |||||
| @@ -1,14 +1,14 @@ | |||||
| #peerings: | |||||
| # - name: | |||||
| # virtual_network: | |||||
| # allow_forwarded_traffic: | |||||
| # allow_gateway_transit: | |||||
| # allow_virtual_network_access: | |||||
| # remote_virtual_network: | |||||
| # name: | |||||
| # resource_group: | |||||
| # resource_group: | |||||
| # use_remote_gateways: | |||||
| # state: | |||||
| ... | |||||
| --- | |||||
| #peerings: | |||||
| # - name: | |||||
| # virtual_network: | |||||
| # allow_forwarded_traffic: | |||||
| # allow_gateway_transit: | |||||
| # allow_virtual_network_access: | |||||
| # remote_virtual_network: | |||||
| # name: | |||||
| # resource_group: | |||||
| # resource_group: | |||||
| # use_remote_gateways: | |||||
| # state: | |||||
| ... | |||||
| @@ -1,29 +1,29 @@ | |||||
| - name: Get virtual network peering | |||||
| azure_rm_virtualnetworkpeering_facts: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| resource_group: "{{ peering.resource_group }}" | |||||
| virtual_network: "{{ peering.virtual_network }}" | |||||
| name: "{{ peering.name | default(omit) }}" | |||||
| register: azure_peering_facts | |||||
| failed_when: false | |||||
| - name: Delete virtual network peering | |||||
| azure_rm_virtualnetworkpeering: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| name: "{{ peering.name }}" | |||||
| virtual_network: "{{ peering.virtual_network }}" | |||||
| resource_group: "{{ peering.resource_group }}" | |||||
| state: "absent" | |||||
| register: deletedpeering | |||||
| ... | |||||
| --- | |||||
| - name: Get virtual network peering | |||||
| azure_rm_virtualnetworkpeering_info: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| resource_group: "{{ peering.resource_group }}" | |||||
| virtual_network: "{{ peering.virtual_network }}" | |||||
| name: "{{ peering.name | default(omit) }}" | |||||
| register: azure_peering_facts | |||||
| failed_when: false | |||||
| - name: Delete virtual network peering | |||||
| azure_rm_virtualnetworkpeering: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| name: "{{ peering.name }}" | |||||
| virtual_network: "{{ peering.virtual_network }}" | |||||
| resource_group: "{{ peering.resource_group }}" | |||||
| state: "absent" | |||||
| register: deletedpeering | |||||
| ... | |||||
| @@ -1,18 +1,18 @@ | |||||
| - name: Get virtual network peering | |||||
| azure_rm_virtualnetworkpeering_facts: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| resource_group: "{{ peering.resource_group }}" | |||||
| virtual_network_name: "{{ peering.virtual_network }}" | |||||
| name: "{{ peering.name | default(omit, true) }}" | |||||
| register: azure_peering_facts | |||||
| - name: Print peering | |||||
| debug: | |||||
| var: azure_peering_facts.vnetpeerings | |||||
| ... | |||||
| --- | |||||
| - name: Get virtual network peering | |||||
| azure_rm_virtualnetworkpeering_info: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| resource_group: "{{ peering.resource_group }}" | |||||
| virtual_network: "{{ peering.virtual_network }}" | |||||
| name: "{{ peering.name | default(omit, true) }}" | |||||
| register: azure_peering_facts | |||||
| - name: Print peering | |||||
| debug: | |||||
| var: azure_peering_facts.vnetpeerings | |||||
| ... | |||||
| @@ -1,42 +1,40 @@ | |||||
| - name: list virtual network peering | |||||
| include: list.yml | |||||
| vars: | |||||
| peering: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'list' | |||||
| - (peerings | default([], true) | length) > 0 | |||||
| with_items: "{{ peerings }}" | |||||
| - name: In virtual network peering state | |||||
| include: "{{ item.state | default('present', true) }}.yml" | |||||
| vars: | |||||
| peering: "{{ item }}" | |||||
| when: | |||||
| - action is undefined | |||||
| - (peerings | default([], true) | length) > 0 | |||||
| with_items: "{{ peerings }}" | |||||
| - name: Update/create virtual network peering | |||||
| include: present.yml | |||||
| vars: | |||||
| peering: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'present' | |||||
| - item.state is undefined | |||||
| - (peerings | default([], true) | length) > 0 | |||||
| with_items: "{{ peerings }}" | |||||
| - name: Delete virtual network peering | |||||
| include: absent.yml | |||||
| vars: | |||||
| peering: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'absent' | |||||
| - item.state is undefined | |||||
| - (peerings | default([], true) | length) > 0 | |||||
| with_items: "{{ peerings }}" | |||||
| ... | |||||
| --- | |||||
| - name: list virtual network peering | |||||
| include: list.yml | |||||
| vars: | |||||
| peering: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'list' | |||||
| - (peerings | default([], true) | length) > 0 | |||||
| with_items: "{{ peerings }}" | |||||
| - name: In virtual network peering state | |||||
| include: "{{ item.state | default('present', true) }}.yml" | |||||
| vars: | |||||
| peering: "{{ item }}" | |||||
| when: | |||||
| - action is undefined | |||||
| - (peerings | default([], true) | length) > 0 | |||||
| with_items: "{{ peerings }}" | |||||
| - name: Update/create virtual network peering | |||||
| include: present.yml | |||||
| vars: | |||||
| peering: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'present' | |||||
| - (peerings | default([], true) | length) > 0 | |||||
| with_items: "{{ peerings }}" | |||||
| - name: Delete virtual network peering | |||||
| include: absent.yml | |||||
| vars: | |||||
| peering: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'absent' | |||||
| - (peerings | default([], true) | length) > 0 | |||||
| with_items: "{{ peerings }}" | |||||
| ... | |||||
| @@ -1,34 +1,34 @@ | |||||
| - name: Get virtual network peering | |||||
| azure_rm_virtualnetworkpeering_facts: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| resource_group: "{{ peering.resource_group }}" | |||||
| virtual_network: "{{ peering.virtual_network }}" | |||||
| name: "{{ peering.name | default(omit, true) }}" | |||||
| register: azure_peering_facts | |||||
| failed_when: false | |||||
| - name: Create virtual network peering | |||||
| azure_rm_virtualnetworkpeering: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| allow_forwarded_traffic: "{{ peering.allow_forwarded_traffic | default(false, true) }}" | |||||
| allow_gateway_transit: "{{ peering.allow_gateway_transit | default(false, true) }}" | |||||
| allow_virtual_network_access: "{{ peering.allow_virtual_network_access | default(true, true) }}" | |||||
| use_remote_gateways: "{{ peering.use_remote_gateways | default(false, true) }}" | |||||
| name: "{{ peering.name }}" | |||||
| virtual_network: "{{ peering.virtual_network }}" | |||||
| remote_virtual_network: "{{ peering.remote_virtual_network }}" | |||||
| resource_group: "{{ peering.resource_group }}" | |||||
| state: "present" | |||||
| register: createpeering | |||||
| ... | |||||
| --- | |||||
| - name: Get virtual network peering | |||||
| azure_rm_virtualnetworkpeering_info: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ peering.azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| resource_group: "{{ peering.resource_group }}" | |||||
| virtual_network: "{{ peering.virtual_network }}" | |||||
| name: "{{ peering.name | default(omit, true) }}" | |||||
| register: azure_peering_facts | |||||
| failed_when: false | |||||
| - name: Create virtual network peering | |||||
| azure_rm_virtualnetworkpeering: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ peering.azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| allow_forwarded_traffic: "{{ peering.allow_forwarded_traffic | default(false, true) }}" | |||||
| allow_gateway_transit: "{{ peering.allow_gateway_transit | default(false, true) }}" | |||||
| allow_virtual_network_access: "{{ peering.allow_virtual_network_access | default(true, true) }}" | |||||
| use_remote_gateways: "{{ peering.use_remote_gateways | default(false, true) }}" | |||||
| name: "{{ peering.name }}" | |||||
| virtual_network: "{{ peering.virtual_network }}" | |||||
| remote_virtual_network: "{{ peering.remote_virtual_network }}" | |||||
| resource_group: "{{ peering.resource_group }}" | |||||
| state: "present" | |||||
| register: createpeering | |||||
| ... | |||||
| @@ -1,2 +1,2 @@ | |||||
| # azure_law | |||||
| Manage Azure resource | |||||
| # azure_law | |||||
| Manage Azure resource | |||||
| @@ -1,13 +1,13 @@ | |||||
| #ress: | |||||
| # - name: | |||||
| # idempotency: true | |||||
| # body: | |||||
| # method: | |||||
| # provider: | |||||
| # resource_type: | |||||
| # resource_group: | |||||
| # subresource: | |||||
| # state: | |||||
| # status_code: | |||||
| ... | |||||
| --- | |||||
| #ress: | |||||
| # - name: | |||||
| # idempotency: true | |||||
| # body: | |||||
| # method: | |||||
| # provider: | |||||
| # resource_type: | |||||
| # resource_group: | |||||
| # subresource: | |||||
| # state: | |||||
| # status_code: | |||||
| ... | |||||
| @@ -1,28 +1,28 @@ | |||||
| - name: Get log analytics workspace | |||||
| azure_rm_resource_facts: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| resource_group: "{{ res.resource_group }}" | |||||
| resource_name: "{{ res.name | default(omit) }}" | |||||
| register: azure_res_facts | |||||
| - name: Delete log analytics workspace | |||||
| azure_rm_resource: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| provider: "{{ res.provider }}" | |||||
| resource_name: "{{ res.name }}" | |||||
| resource_group: "{{ res.resource_group }}" | |||||
| resource_type: "{{ res.resource_type }}" | |||||
| state: "absent" | |||||
| register: deletedres | |||||
| ... | |||||
| --- | |||||
| - name: Get log analytics workspace | |||||
| azure_rm_resource_info: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| resource_group: "{{ res.resource_group }}" | |||||
| resource_name: "{{ res.name | default(omit) }}" | |||||
| register: azure_res_facts | |||||
| - name: Delete log analytics workspace | |||||
| azure_rm_resource: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| provider: "{{ res.provider }}" | |||||
| resource_name: "{{ res.name }}" | |||||
| resource_group: "{{ res.resource_group }}" | |||||
| resource_type: "{{ res.resource_type }}" | |||||
| state: "absent" | |||||
| register: deletedres | |||||
| ... | |||||
| @@ -1,17 +1,17 @@ | |||||
| - name: Get resource | |||||
| azure_rm_resource_facts: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| resource_group: "{{ res.resource_group }}" | |||||
| resource_name: "{{ res.name }}" | |||||
| register: azure_res_facts | |||||
| - name: Print resource | |||||
| debug: | |||||
| var: azure_res_facts | |||||
| ... | |||||
| --- | |||||
| - name: Get resource | |||||
| azure_rm_resource_info: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| resource_group: "{{ res.resource_group }}" | |||||
| resource_name: "{{ res.name }}" | |||||
| register: azure_res_facts | |||||
| - name: Print resource | |||||
| debug: | |||||
| var: azure_res_facts | |||||
| ... | |||||
| @@ -1,42 +1,40 @@ | |||||
| - name: list resources | |||||
| include: list.yml | |||||
| vars: | |||||
| res: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'list' | |||||
| - (ress | default([], true) | length) > 0 | |||||
| with_items: "{{ ress }}" | |||||
| - name: In log analytics workspace state | |||||
| include: "{{ item.state | default('present', true) }}.yml" | |||||
| vars: | |||||
| res: "{{ item }}" | |||||
| when: | |||||
| - action is undefined | |||||
| - (ress | default([], true) | length) > 0 | |||||
| with_items: "{{ ress }}" | |||||
| - name: Update/create resources | |||||
| include: present.yml | |||||
| vars: | |||||
| res: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'present' | |||||
| - item.state is undefined | |||||
| - (ress | default([], true) | length) > 0 | |||||
| with_items: "{{ ress }}" | |||||
| - name: Delete resources | |||||
| include: absent.yml | |||||
| vars: | |||||
| res: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'absent' | |||||
| - item.state is undefined | |||||
| - (ress | default([], true) | length) > 0 | |||||
| with_items: "{{ ress }}" | |||||
| ... | |||||
| --- | |||||
| - name: list resources | |||||
| include: list.yml | |||||
| vars: | |||||
| res: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'list' | |||||
| - (ress | default([], true) | length) > 0 | |||||
| with_items: "{{ ress }}" | |||||
| - name: In log analytics workspace state | |||||
| include: "{{ item.state | default('present', true) }}.yml" | |||||
| vars: | |||||
| res: "{{ item }}" | |||||
| when: | |||||
| - action is undefined | |||||
| - (ress | default([], true) | length) > 0 | |||||
| with_items: "{{ ress }}" | |||||
| - name: Update/create resources | |||||
| include: present.yml | |||||
| vars: | |||||
| res: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'present' | |||||
| - (ress | default([], true) | length) > 0 | |||||
| with_items: "{{ ress }}" | |||||
| - name: Delete resources | |||||
| include: absent.yml | |||||
| vars: | |||||
| res: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'absent' | |||||
| - (ress | default([], true) | length) > 0 | |||||
| with_items: "{{ ress }}" | |||||
| ... | |||||
| @@ -1,33 +1,33 @@ | |||||
| - name: Get resource | |||||
| azure_rm_resource_facts: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| resource_group: "{{ res.resource_group }}" | |||||
| resource_name: "{{ res.name | default(omit) }}" | |||||
| register: azure_res_facts | |||||
| - name: Create resource | |||||
| azure_rm_resource: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| resource_name: "{{ res.name | urlencode }}" | |||||
| resource_type: "{{ res.resource_type }}" | |||||
| resource_group: "{{ res.resource_group }}" | |||||
| provider: "{{ res.provider }}" | |||||
| idempotency: true | |||||
| body: "{{ res.body | default(omit, true) }}" | |||||
| method: "{{ res.method | default(omit, true) }}" | |||||
| subresource: "{{ res.subresource | default(omit, true) }}" | |||||
| status_code: "{{ res.status_code | default(omit, true) }}" | |||||
| state: "present" | |||||
| register: createres | |||||
| ... | |||||
| --- | |||||
| - name: Get resource | |||||
| azure_rm_resource_info: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| resource_group: "{{ res.resource_group }}" | |||||
| resource_name: "{{ res.name | default(omit) }}" | |||||
| register: azure_res_facts | |||||
| - name: Create resource | |||||
| azure_rm_resource: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| resource_name: "{{ res.name | urlencode }}" | |||||
| resource_type: "{{ res.resource_type }}" | |||||
| resource_group: "{{ res.resource_group }}" | |||||
| provider: "{{ res.provider }}" | |||||
| idempotency: true | |||||
| body: "{{ res.body | default(omit, true) }}" | |||||
| method: "{{ res.method | default(omit, true) }}" | |||||
| subresource: "{{ res.subresource | default(omit, true) }}" | |||||
| status_code: "{{ res.status_code | default(omit, true) }}" | |||||
| state: "present" | |||||
| register: createres | |||||
| ... | |||||
| @@ -1,2 +1,2 @@ | |||||
| # azure_rg | |||||
| Manage Azure resource group | |||||
| # azure_rg | |||||
| Manage Azure resource group | |||||
| @@ -1,10 +1,10 @@ | |||||
| #rgs: | |||||
| # - name: | |||||
| # location: | |||||
| # force_delete: | |||||
| # state: | |||||
| # tags: | |||||
| # "env": "prod" | |||||
| # "provisioner": "ansible" | |||||
| ... | |||||
| --- | |||||
| #rgs: | |||||
| # - name: | |||||
| # location: | |||||
| # force_delete: | |||||
| # state: | |||||
| # tags: | |||||
| # "env": "prod" | |||||
| # "provisioner": "ansible" | |||||
| ... | |||||
| @@ -1,34 +1,34 @@ | |||||
| - set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | | |||||
| union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', rg.tags | default({})) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get resource group | |||||
| azure_rm_resourcegroup_facts: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| list_resources: false | |||||
| tags: "{{ tags_list | default(omit) }}" | |||||
| name: "{{ rg.name | default(omit) }}" | |||||
| register: azure_rg_facts | |||||
| - name: Delete resource group | |||||
| azure_rm_resourcegroup: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| name: "{{ rg.name }}" | |||||
| force_delete_nonempty: "{{ rg.force_delete | default(false) }}" | |||||
| state: "absent" | |||||
| register: deletedrg | |||||
| ... | |||||
| --- | |||||
| - name: Build tags list | |||||
| set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', rg.tags | default({})) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get resource group | |||||
| azure_rm_resourcegroup_info: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| list_resources: false | |||||
| tags: "{{ tags_list | default(omit) }}" | |||||
| name: "{{ rg.name | default(omit) }}" | |||||
| register: azure_rg_info | |||||
| - name: Delete resource group | |||||
| azure_rm_resourcegroup: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| name: "{{ rg.name }}" | |||||
| force_delete_nonempty: "{{ rg.force_delete | default(false) }}" | |||||
| state: "absent" | |||||
| register: deletedrg | |||||
| ... | |||||
| @@ -1,25 +1,25 @@ | |||||
| - set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | | |||||
| union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', nic.tags | default({})) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get resource group | |||||
| azure_rm_resourcegroup_facts: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| list_resources: true | |||||
| tags: "{{ tags_list | default(omit) }}" | |||||
| name: "{{ rg.name | default(omit) }}" | |||||
| register: azure_rg_facts | |||||
| - name: Print resource group | |||||
| debug: | |||||
| var: azure_rg_facts.resourcegroups | |||||
| ... | |||||
| --- | |||||
| - name: Build tags list | |||||
| set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', nic.tags | default({})) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get resource group | |||||
| azure_rm_resourcegroup_info: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| list_resources: true | |||||
| tags: "{{ tags_list | default(omit) }}" | |||||
| name: "{{ rg.name | default(omit) }}" | |||||
| register: azure_rg_facts | |||||
| - name: Print resource group | |||||
| debug: | |||||
| var: azure_rg_facts.resourcegroups | |||||
| ... | |||||
| @@ -1,42 +1,40 @@ | |||||
| - name: list resource group | |||||
| include: list.yml | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'list' | |||||
| - (rgs | default([], true) | length) > 0 | |||||
| vars: | |||||
| rg: "{{ item }}" | |||||
| with_items: "{{ rgs }}" | |||||
| - name: In resourse group state | |||||
| include: "{{ item.state | default('present', true) }}.yml" | |||||
| vars: | |||||
| rg: "{{ item }}" | |||||
| when: | |||||
| - action is undefined | |||||
| - (rgs | default([], true) | length) > 0 | |||||
| with_items: "{{ rgs }}" | |||||
| - name: Update/create resourse group | |||||
| include: present.yml | |||||
| vars: | |||||
| rg: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'present' | |||||
| - item.state is undefined | |||||
| - (rgs | default([], true) | length) > 0 | |||||
| with_items: "{{ rgs }}" | |||||
| - name: Delete resourse group | |||||
| include: absent.yml | |||||
| vars: | |||||
| rg: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'absent' | |||||
| - item.state is undefined | |||||
| - (rgs | default([], true) | length) > 0 | |||||
| with_items: "{{ rgs }}" | |||||
| ... | |||||
| --- | |||||
| - name: list resource group | |||||
| include: list.yml | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'list' | |||||
| - (rgs | default([], true) | length) > 0 | |||||
| vars: | |||||
| rg: "{{ item }}" | |||||
| with_items: "{{ rgs }}" | |||||
| - name: In resourse group state | |||||
| include: "{{ item.state | default('present', true) }}.yml" | |||||
| vars: | |||||
| rg: "{{ item }}" | |||||
| when: | |||||
| - action is undefined | |||||
| - (rgs | default([], true) | length) > 0 | |||||
| with_items: "{{ rgs }}" | |||||
| - name: Update/create resourse group | |||||
| include: present.yml | |||||
| vars: | |||||
| rg: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'present' | |||||
| - (rgs | default([], true) | length) > 0 | |||||
| with_items: "{{ rgs }}" | |||||
| - name: Delete resourse group | |||||
| include: absent.yml | |||||
| vars: | |||||
| rg: "{{ item }}" | |||||
| when: | |||||
| - action is defined | |||||
| - action == 'absent' | |||||
| - (rgs | default([], true) | length) > 0 | |||||
| with_items: "{{ rgs }}" | |||||
| ... | |||||
| @@ -1,36 +1,36 @@ | |||||
| - set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | | |||||
| union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', rg.tags | default({}, true)) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get resource group | |||||
| azure_rm_resourcegroup_facts: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| list_resources: false | |||||
| tags: "{{ tags_list | default(omit) }}" | |||||
| name: "{{ rg.name | default(omit) }}" | |||||
| register: azure_rg_facts | |||||
| - name: Create resource group | |||||
| azure_rm_resourcegroup: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| name: "{{ rg.name }}" | |||||
| append_tags: false | |||||
| location: "{{ rg.location }}" | |||||
| state: "present" | |||||
| tags: "{{ rg.tags | default(omit) }}" | |||||
| register: createrg | |||||
| ... | |||||
| --- | |||||
| - name: Build tags list | |||||
| set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', rg.tags | default({}, true)) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get resource group | |||||
| azure_rm_resourcegroup_info: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| list_resources: false | |||||
| tags: "{{ tags_list | default(omit) }}" | |||||
| name: "{{ rg.name | default(omit) }}" | |||||
| register: azure_rg_facts | |||||
| - name: Create resource group | |||||
| azure_rm_resourcegroup: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| name: "{{ rg.name }}" | |||||
| append_tags: false | |||||
| location: "{{ rg.location }}" | |||||
| state: "present" | |||||
| tags: "{{ rg.tags | default(omit) }}" | |||||
| register: createrg | |||||
| ... | |||||
| @@ -1,2 +1,2 @@ | |||||
| # azure_rt | |||||
| Manage Azure route table | |||||
| # azure_rt | |||||
| Manage Azure route table | |||||
| @@ -1,11 +1,17 @@ | |||||
| #rts: | |||||
| # - name: | |||||
| # disable_bgp_route_propagation: | |||||
| # location: | |||||
| # resource_group: | |||||
| # state: | |||||
| # tags: | |||||
| # "env": "prod" | |||||
| # "provisioner": "ansible" | |||||
| ... | |||||
| --- | |||||
| #rts: | |||||
| # - name: | |||||
| # disableBgpRoutePropagation: | |||||
| # location: | |||||
| # routes: | |||||
| # - name: | |||||
| # address_prefix: | |||||
| # hasBgpOverride: | |||||
| # next_hop_type: | |||||
| # next_hop_ip_address: | |||||
| # resource_group: | |||||
| # state: | |||||
| # tags: | |||||
| # "env": "prod" | |||||
| # "provisioner": "ansible" | |||||
| ... | |||||
| @@ -1,34 +1,34 @@ | |||||
| - set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | | |||||
| union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', rt.tags | default({})) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get route table | |||||
| azure_rm_routetable_facts: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| resource_group: "{{ rt.resource_group }}" | |||||
| tags: "{{ tags_list | default(omit, true) }}" | |||||
| name: "{{ rt.name | default(omit) }}" | |||||
| register: azure_rt_facts | |||||
| - name: Delete route table | |||||
| azure_rm_routetable: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ azure_subscription_id | default(omit) }}" | |||||
| client_id: "{{ azure_client_id | default(omit) }}" | |||||
| secret: "{{ azure_secret | default(omit) }}" | |||||
| tenant: "{{ azure_tenant | default(omit) }}" | |||||
| name: "{{ rt.name }}" | |||||
| resource_group: "{{ rt.resource_group }}" | |||||
| state: "absent" | |||||
| register: deletedrt | |||||
| ... | |||||
| --- | |||||
| - name: Build tags list | |||||
| set_fact: | |||||
| tags_list: "{{ tags_list | default([]) | union([[tag.key,tag.value]|join(':')]) }}" | |||||
| loop: "{{ lookup('dict', rt.tags | default({})) }}" | |||||
| loop_control: | |||||
| loop_var: "tag" | |||||
| - name: Get route table | |||||
| azure_rm_routetable_info: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ rt.azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| resource_group: "{{ rt.resource_group }}" | |||||
| tags: "{{ tags_list | default(omit) }}" | |||||
| name: "{{ rt.name | default(omit) }}" | |||||
| register: azure_rt_facts | |||||
| - name: Delete route table | |||||
| azure_rm_routetable: | |||||
| ad_user: "{{ azure_ad_user | default(omit) }}" | |||||
| password: "{{ azure_password | default(omit) }}" | |||||
| subscription_id: "{{ rt.azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID')) }}" | |||||
| client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID')) }}" | |||||
| secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET')) }}" | |||||
| tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT')) }}" | |||||
| name: "{{ rt.name }}" | |||||
| resource_group: "{{ rt.resource_group }}" | |||||
| state: "absent" | |||||
| register: deletedrt | |||||
| ... | |||||