automated install of fedora vm with cloud-init

This commit is contained in:
Petar Cubela
2025-09-17 23:39:41 +02:00
parent 37c441a107
commit 67c9df85f1
21 changed files with 1610 additions and 144 deletions

34
.terraform.lock.hcl generated
View File

@@ -1,6 +1,40 @@
# This file is maintained automatically by "tofu init".
# Manual edits may be lost in future updates.
provider "registry.opentofu.org/hashicorp/local" {
version = "2.5.3"
hashes = [
"h1:31Clmfoe7hzkcdgwuhUuGuPGfeG2Ksk+YWcJgzBTN7M=",
"zh:32e1d4b0595cea6cda4ca256195c162772ddff25594ab4008731a2ec7be230bf",
"zh:48c390af0c87df994ec9796f04ec2582bcac581fb81ed6bb58e0671da1c17991",
"zh:4be7289c969218a57b40902e2f359914f8d35a7f97b439140cb711aa21e494bd",
"zh:4cf958e631e99ed6c8b522c9b22e1f1b568c0bdadb01dd002ca7dffb1c927764",
"zh:7a0132c0faca4c4c96aa70808effd6817e28712bf5a39881666ac377b4250acf",
"zh:7d60de08fac427fb045e4590d1b921b6778498eee9eb16f78c64d4c577bde096",
"zh:91003bee5981e99ec3925ce2f452a5f743827f9d0e131a86613549c1464796f0",
"zh:9fe2fe75977c8149e2515fb30c6cc6cfd57b225d4ce592c570d81a3831d7ffa3",
"zh:e210e6be54933ce93e03d0994e520ba289aa01b2c1f70e77afb8f2ee796b0fe3",
"zh:e8793e5f9422f2b31a804e51806595f335b827c9a38db18766960464566f21d5",
]
}
provider "registry.opentofu.org/hashicorp/null" {
version = "3.2.4"
hashes = [
"h1:i+WKhUHL2REY5EGmiHjfUljJB8UKZ9QdhdM5uTeUhC4=",
"zh:1769783386610bed8bb1e861a119fe25058be41895e3996d9216dd6bb8a7aee3",
"zh:32c62a9387ad0b861b5262b41c5e9ed6e940eda729c2a0e58100e6629af27ddb",
"zh:339bf8c2f9733fce068eb6d5612701144c752425cebeafab36563a16be460fb2",
"zh:36731f23343aee12a7e078067a98644c0126714c4fe9ac930eecb0f2361788c4",
"zh:3d106c7e32a929e2843f732625a582e562ff09120021e510a51a6f5d01175b8d",
"zh:74bcb3567708171ad83b234b92c9d63ab441ef882b770b0210c2b14fdbe3b1b6",
"zh:90b55bdbffa35df9204282251059e62c178b0ac7035958b93a647839643c0072",
"zh:ae24c0e5adc692b8f94cb23a000f91a316070fdc19418578dcf2134ff57cf447",
"zh:b5c10d4ad860c4c21273203d1de6d2f0286845edf1c64319fa2362df526b5f58",
"zh:e05bbd88e82e1d6234988c85db62fd66f11502645838fff594a2ec25352ecd80",
]
}
provider "registry.opentofu.org/telmate/proxmox" {
version = "3.0.2-rc04"
constraints = "3.0.2-rc04"

View File

@@ -0,0 +1,185 @@
## 2.5.3 (May 08, 2025)
NOTES:
* Update dependencies ([#404](https://github.com/hashicorp/terraform-provider-local/issues/404))
## 2.5.3-alpha1 (April 24, 2025)
NOTES:
* This release is being used to test new build and release actions. ([#405](https://github.com/hashicorp/terraform-provider-local/issues/405))
## 2.5.2 (September 11, 2024)
NOTES:
* all: This release introduces no functional changes. It does however include dependency updates which address upstream CVEs. ([#348](https://github.com/hashicorp/terraform-provider-local/issues/348))
## 2.5.1 (March 11, 2024)
NOTES:
* No functional changes from v2.5.0. Minor documentation fixes. ([#303](https://github.com/hashicorp/terraform-provider-local/issues/303))
## 2.5.0 (March 11, 2024)
FEATURES:
* functions/direxists: Added a new `direxists` function that checks for the existence of a directory, similar to the built-in `fileexists` function. ([#285](https://github.com/hashicorp/terraform-provider-local/issues/285))
## 2.4.1 (December 12, 2023)
NOTES:
* This release introduces no functional changes. It does however include dependency updates which address upstream CVEs. ([#273](https://github.com/hashicorp/terraform-provider-local/issues/273))
## 2.4.0 (March 08, 2023)
NOTES:
* This Go module has been updated to Go 1.19 per the [Go support policy](https://golang.org/doc/devel/release.html#policy). Any consumers building on earlier Go versions may experience errors. ([#184](https://github.com/hashicorp/terraform-provider-local/issues/184))
FEATURES:
* resource/local_file: added support for `MD5`, `SHA1`, `SHA256`, and `SHA512` checksum outputs. ([#142](https://github.com/hashicorp/terraform-provider-local/issues/142))
* resource/local_sensitive_file: added support for `MD5`, `SHA1`, `SHA256`, and `SHA512` checksum outputs. ([#142](https://github.com/hashicorp/terraform-provider-local/issues/142))
* data-source/local_file: added support for `MD5`, `SHA1`, `SHA256`, and `SHA512` checksum outputs. ([#142](https://github.com/hashicorp/terraform-provider-local/issues/142))
* data-source/local_sensitive-file: added support for `MD5`, `SHA1`, `SHA256`, and `SHA512` checksum outputs. ([#142](https://github.com/hashicorp/terraform-provider-local/issues/142))
## 2.3.0 (January 11, 2023)
NOTES:
* provider: Rewritten to use the [`terraform-plugin-framework`](https://www.terraform.io/plugin/framework) ([#155](https://github.com/hashicorp/terraform-provider-local/issues/155))
## 2.2.3 (May 18, 2022)
NOTES:
* resource/local_file: Update docs to prevent confusion that exactly one of the arguments `content`,
`sensitive_content`, `content_base64`, and `source` needs to be specified ([#123](https://github.com/hashicorp/terraform-provider-local/pull/123)).
* resource/local_sensitive_file: Update docs to prevent confusion that exactly one of the arguments `content`,
`content_base64`, and `source` needs to be specified ([#123](https://github.com/hashicorp/terraform-provider-local/pull/123)).
* No functional changes from 2.2.2.
## 2.2.2 (March 11, 2022)
NOTES:
* resource/local_sensitive_file: Fixed typo in documentation (default permission is `"0700"`, not `"0777"`).
* No functional changes from 2.2.1.
## 2.2.1 (March 10, 2022)
NOTES:
* This release is a republishing of the 2.2.0 release to fix release asset checksum errors. It is identical otherwise.
## 2.2.0 (March 10, 2022)
NOTES:
* resource/local_file: Argument `sensitive_content` is `Deprecated`. For creating or accessing files containing sensitive data,
please use the new resource and data source `local_sensitive_file`.
Both are identical to their `local_file` counterparts, but `content` and `content_base64` attributes are marked as _sensitive_.
FEATURES:
* **New Data Source:** `local_sensitive_file` ([#101](https://github.com/hashicorp/terraform-provider-local/pull/101) and [#106](https://github.com/hashicorp/terraform-provider-local/pull/106))
* **New Resource:** `local_sensitive_file` ([#106](https://github.com/hashicorp/terraform-provider-local/pull/106))
## 2.1.0 (February 19, 2021)
NOTES:
* Binary releases of this provider now include the` darwin-arm64` platform.
* This version contains no further changes.
## 2.0.0 (October 14, 2020)
NOTES:
* Binary releases of this provider now include the `linux-arm64` platform.
BREAKING CHANGES:
* Upgrade to version 2 of the Terraform Plugin SDK, which drops support for Terraform 0.11.
This provider will continue to work as expected for users of Terraform 0.11, which will not download the new version.
([#42](https://github.com/terraform-providers/terraform-provider-local/issues/42))
FEATURES:
* resource/local_file: Added `source` attribute as alternative way to provide content
for the `local_file` resource.
([#44](https://github.com/terraform-providers/terraform-provider-local/issues/44))
## 1.4.0 (September 30, 2019)
NOTES:
* The provider has switched to the standalone TF SDK, there should be no noticeable impact on compatibility.
([#32](https://github.com/terraform-providers/terraform-provider-local/issues/32))
FEATURES:
* resource/local_file: Added support for configurable permissions
([#30](https://github.com/terraform-providers/terraform-provider-local/issues/30))
## 1.3.0 (June 26, 2019)
FEATURES:
* resource/local_file: Added support for base64 encoded content
([#29](https://github.com/terraform-providers/terraform-provider-local/issues/29))
* data-source/local_file: Added support for base64 encoded content
([#29](https://github.com/terraform-providers/terraform-provider-local/issues/29))
## 1.2.2 (May 01, 2019)
NOTES:
* This releases includes another Terraform SDK upgrade intended to align with that being used for other providers
as we prepare for the Core `v0.12.0` release. It should have no significant changes in behavior for this provider.
## 1.2.1 (April 11, 2019)
NOTES:
* This releases includes only a Terraform SDK upgrade intended to align with that being used for other providers
as we prepare for the Core `v0.12.0` release. It should have no significant changes in behavior for this provider.
## 1.2.0 (March 20, 2019)
FEATURES:
* The provider is now compatible with Terraform v0.12, while retaining compatibility with prior versions.
* resource/local_file: added optional `sensitive_content` attribute, which can be used instead of `content`
in situations where the content contains sensitive information that should not be displayed in a rendered diff.
([#9](https://github.com/terraform-providers/terraform-provider-local/issues/9))
## 1.1.0 (January 04, 2018)
FEATURES:
* data-source/local_file: Added for reading files in a way that participates in Terraform's dependency graph,
which allows reading of files that are created dynamically during `terraform apply`.
([#6](https://github.com/terraform-providers/terraform-provider-local/issues/6))
## 1.0.0 (September 15, 2017)
NOTES:
* No changes from 0.1.0; just adjusting to
[the new version numbering scheme](https://www.hashicorp.com/blog/hashicorp-terraform-provider-versioning/).
## 0.1.0 (June 21, 2017)
NOTES:
* Same functionality as that of Terraform 0.9.8.
Repacked as part of [Provider Splitout](https://www.hashicorp.com/blog/upcoming-provider-changes-in-terraform-0-10/)

View File

@@ -0,0 +1,375 @@
Copyright (c) 2017 HashiCorp, Inc.
Mozilla Public License Version 2.0
==================================
1. Definitions
--------------
1.1. "Contributor"
means each individual or legal entity that creates, contributes to
the creation of, or owns Covered Software.
1.2. "Contributor Version"
means the combination of the Contributions of others (if any) used
by a Contributor and that particular Contributor's Contribution.
1.3. "Contribution"
means Covered Software of a particular Contributor.
1.4. "Covered Software"
means Source Code Form to which the initial Contributor has attached
the notice in Exhibit A, the Executable Form of such Source Code
Form, and Modifications of such Source Code Form, in each case
including portions thereof.
1.5. "Incompatible With Secondary Licenses"
means
(a) that the initial Contributor has attached the notice described
in Exhibit B to the Covered Software; or
(b) that the Covered Software was made available under the terms of
version 1.1 or earlier of the License, but not also under the
terms of a Secondary License.
1.6. "Executable Form"
means any form of the work other than Source Code Form.
1.7. "Larger Work"
means a work that combines Covered Software with other material, in
a separate file or files, that is not Covered Software.
1.8. "License"
means this document.
1.9. "Licensable"
means having the right to grant, to the maximum extent possible,
whether at the time of the initial grant or subsequently, any and
all of the rights conveyed by this License.
1.10. "Modifications"
means any of the following:
(a) any file in Source Code Form that results from an addition to,
deletion from, or modification of the contents of Covered
Software; or
(b) any new file in Source Code Form that contains any Covered
Software.
1.11. "Patent Claims" of a Contributor
means any patent claim(s), including without limitation, method,
process, and apparatus claims, in any patent Licensable by such
Contributor that would be infringed, but for the grant of the
License, by the making, using, selling, offering for sale, having
made, import, or transfer of either its Contributions or its
Contributor Version.
1.12. "Secondary License"
means either the GNU General Public License, Version 2.0, the GNU
Lesser General Public License, Version 2.1, the GNU Affero General
Public License, Version 3.0, or any later versions of those
licenses.
1.13. "Source Code Form"
means the form of the work preferred for making modifications.
1.14. "You" (or "Your")
means an individual or a legal entity exercising rights under this
License. For legal entities, "You" includes any entity that
controls, is controlled by, or is under common control with You. For
purposes of this definition, "control" means (a) the power, direct
or indirect, to cause the direction or management of such entity,
whether by contract or otherwise, or (b) ownership of more than
fifty percent (50%) of the outstanding shares or beneficial
ownership of such entity.
2. License Grants and Conditions
--------------------------------
2.1. Grants
Each Contributor hereby grants You a world-wide, royalty-free,
non-exclusive license:
(a) under intellectual property rights (other than patent or trademark)
Licensable by such Contributor to use, reproduce, make available,
modify, display, perform, distribute, and otherwise exploit its
Contributions, either on an unmodified basis, with Modifications, or
as part of a Larger Work; and
(b) under Patent Claims of such Contributor to make, use, sell, offer
for sale, have made, import, and otherwise transfer either its
Contributions or its Contributor Version.
2.2. Effective Date
The licenses granted in Section 2.1 with respect to any Contribution
become effective for each Contribution on the date the Contributor first
distributes such Contribution.
2.3. Limitations on Grant Scope
The licenses granted in this Section 2 are the only rights granted under
this License. No additional rights or licenses will be implied from the
distribution or licensing of Covered Software under this License.
Notwithstanding Section 2.1(b) above, no patent license is granted by a
Contributor:
(a) for any code that a Contributor has removed from Covered Software;
or
(b) for infringements caused by: (i) Your and any other third party's
modifications of Covered Software, or (ii) the combination of its
Contributions with other software (except as part of its Contributor
Version); or
(c) under Patent Claims infringed by Covered Software in the absence of
its Contributions.
This License does not grant any rights in the trademarks, service marks,
or logos of any Contributor (except as may be necessary to comply with
the notice requirements in Section 3.4).
2.4. Subsequent Licenses
No Contributor makes additional grants as a result of Your choice to
distribute the Covered Software under a subsequent version of this
License (see Section 10.2) or under the terms of a Secondary License (if
permitted under the terms of Section 3.3).
2.5. Representation
Each Contributor represents that the Contributor believes its
Contributions are its original creation(s) or it has sufficient rights
to grant the rights to its Contributions conveyed by this License.
2.6. Fair Use
This License is not intended to limit any rights You have under
applicable copyright doctrines of fair use, fair dealing, or other
equivalents.
2.7. Conditions
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
in Section 2.1.
3. Responsibilities
-------------------
3.1. Distribution of Source Form
All distribution of Covered Software in Source Code Form, including any
Modifications that You create or to which You contribute, must be under
the terms of this License. You must inform recipients that the Source
Code Form of the Covered Software is governed by the terms of this
License, and how they can obtain a copy of this License. You may not
attempt to alter or restrict the recipients' rights in the Source Code
Form.
3.2. Distribution of Executable Form
If You distribute Covered Software in Executable Form then:
(a) such Covered Software must also be made available in Source Code
Form, as described in Section 3.1, and You must inform recipients of
the Executable Form how they can obtain a copy of such Source Code
Form by reasonable means in a timely manner, at a charge no more
than the cost of distribution to the recipient; and
(b) You may distribute such Executable Form under the terms of this
License, or sublicense it under different terms, provided that the
license for the Executable Form does not attempt to limit or alter
the recipients' rights in the Source Code Form under this License.
3.3. Distribution of a Larger Work
You may create and distribute a Larger Work under terms of Your choice,
provided that You also comply with the requirements of this License for
the Covered Software. If the Larger Work is a combination of Covered
Software with a work governed by one or more Secondary Licenses, and the
Covered Software is not Incompatible With Secondary Licenses, this
License permits You to additionally distribute such Covered Software
under the terms of such Secondary License(s), so that the recipient of
the Larger Work may, at their option, further distribute the Covered
Software under the terms of either this License or such Secondary
License(s).
3.4. Notices
You may not remove or alter the substance of any license notices
(including copyright notices, patent notices, disclaimers of warranty,
or limitations of liability) contained within the Source Code Form of
the Covered Software, except that You may alter any license notices to
the extent required to remedy known factual inaccuracies.
3.5. Application of Additional Terms
You may choose to offer, and to charge a fee for, warranty, support,
indemnity or liability obligations to one or more recipients of Covered
Software. However, You may do so only on Your own behalf, and not on
behalf of any Contributor. You must make it absolutely clear that any
such warranty, support, indemnity, or liability obligation is offered by
You alone, and You hereby agree to indemnify every Contributor for any
liability incurred by such Contributor as a result of warranty, support,
indemnity or liability terms You offer. You may include additional
disclaimers of warranty and limitations of liability specific to any
jurisdiction.
4. Inability to Comply Due to Statute or Regulation
---------------------------------------------------
If it is impossible for You to comply with any of the terms of this
License with respect to some or all of the Covered Software due to
statute, judicial order, or regulation then You must: (a) comply with
the terms of this License to the maximum extent possible; and (b)
describe the limitations and the code they affect. Such description must
be placed in a text file included with all distributions of the Covered
Software under this License. Except to the extent prohibited by statute
or regulation, such description must be sufficiently detailed for a
recipient of ordinary skill to be able to understand it.
5. Termination
--------------
5.1. The rights granted under this License will terminate automatically
if You fail to comply with any of its terms. However, if You become
compliant, then the rights granted under this License from a particular
Contributor are reinstated (a) provisionally, unless and until such
Contributor explicitly and finally terminates Your grants, and (b) on an
ongoing basis, if such Contributor fails to notify You of the
non-compliance by some reasonable means prior to 60 days after You have
come back into compliance. Moreover, Your grants from a particular
Contributor are reinstated on an ongoing basis if such Contributor
notifies You of the non-compliance by some reasonable means, this is the
first time You have received notice of non-compliance with this License
from such Contributor, and You become compliant prior to 30 days after
Your receipt of the notice.
5.2. If You initiate litigation against any entity by asserting a patent
infringement claim (excluding declaratory judgment actions,
counter-claims, and cross-claims) alleging that a Contributor Version
directly or indirectly infringes any patent, then the rights granted to
You by any and all Contributors for the Covered Software under Section
2.1 of this License shall terminate.
5.3. In the event of termination under Sections 5.1 or 5.2 above, all
end user license agreements (excluding distributors and resellers) which
have been validly granted by You or Your distributors under this License
prior to termination shall survive termination.
************************************************************************
* *
* 6. Disclaimer of Warranty *
* ------------------------- *
* *
* Covered Software is provided under this License on an "as is" *
* basis, without warranty of any kind, either expressed, implied, or *
* statutory, including, without limitation, warranties that the *
* Covered Software is free of defects, merchantable, fit for a *
* particular purpose or non-infringing. The entire risk as to the *
* quality and performance of the Covered Software is with You. *
* Should any Covered Software prove defective in any respect, You *
* (not any Contributor) assume the cost of any necessary servicing, *
* repair, or correction. This disclaimer of warranty constitutes an *
* essential part of this License. No use of any Covered Software is *
* authorized under this License except under this disclaimer. *
* *
************************************************************************
************************************************************************
* *
* 7. Limitation of Liability *
* -------------------------- *
* *
* Under no circumstances and under no legal theory, whether tort *
* (including negligence), contract, or otherwise, shall any *
* Contributor, or anyone who distributes Covered Software as *
* permitted above, be liable to You for any direct, indirect, *
* special, incidental, or consequential damages of any character *
* including, without limitation, damages for lost profits, loss of *
* goodwill, work stoppage, computer failure or malfunction, or any *
* and all other commercial damages or losses, even if such party *
* shall have been informed of the possibility of such damages. This *
* limitation of liability shall not apply to liability for death or *
* personal injury resulting from such party's negligence to the *
* extent applicable law prohibits such limitation. Some *
* jurisdictions do not allow the exclusion or limitation of *
* incidental or consequential damages, so this exclusion and *
* limitation may not apply to You. *
* *
************************************************************************
8. Litigation
-------------
Any litigation relating to this License may be brought only in the
courts of a jurisdiction where the defendant maintains its principal
place of business and such litigation shall be governed by laws of that
jurisdiction, without reference to its conflict-of-law provisions.
Nothing in this Section shall prevent a party's ability to bring
cross-claims or counter-claims.
9. Miscellaneous
----------------
This License represents the complete agreement concerning the subject
matter hereof. If any provision of this License is held to be
unenforceable, such provision shall be reformed only to the extent
necessary to make it enforceable. Any law or regulation which provides
that the language of a contract shall be construed against the drafter
shall not be used to construe this License against a Contributor.
10. Versions of the License
---------------------------
10.1. New Versions
Mozilla Foundation is the license steward. Except as provided in Section
10.3, no one other than the license steward has the right to modify or
publish new versions of this License. Each version will be given a
distinguishing version number.
10.2. Effect of New Versions
You may distribute the Covered Software under the terms of the version
of the License under which You originally received the Covered Software,
or under the terms of any subsequent version published by the license
steward.
10.3. Modified Versions
If you create software not governed by this License, and you want to
create a new license for such software, you may create and use a
modified version of this License if you rename the license and remove
any references to the name of the license steward (except to note that
such modified license differs from this License).
10.4. Distributing Source Code Form that is Incompatible With Secondary
Licenses
If You choose to distribute Source Code Form that is Incompatible With
Secondary Licenses under the terms of this version of the License, the
notice described in Exhibit B of this License must be attached.
Exhibit A - Source Code Form License Notice
-------------------------------------------
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
If it is not possible or desirable to put the notice in a particular
file, then You may include the notice in a location (such as a LICENSE
file in a relevant directory) where a recipient would be likely to look
for such a notice.
You may add additional accurate notices of copyright ownership.
Exhibit B - "Incompatible With Secondary Licenses" Notice
---------------------------------------------------------
This Source Code Form is "Incompatible With Secondary Licenses", as
defined by the Mozilla Public License, v. 2.0.

View File

@@ -0,0 +1,125 @@
# Terraform Provider: Local
The Local provider is used to manage local resources, such as files.
**Note** Terraform primarily deals with remote resources which are able
to outlive a single Terraform run, and so local resources can sometimes violate
its assumptions. The resources here are best used with care, since depending
on local state can make it hard to apply the same Terraform configuration on
many different local systems where the local resources may not be universally
available. See specific notes in each resource for more information.
## Documentation, questions and discussions
Official documentation on how to use this provider can be found on the
[Terraform Registry](https://registry.terraform.io/providers/hashicorp/local/latest/docs).
In case of specific questions or discussions, please use the
HashiCorp [Terraform Providers Discuss forums](https://discuss.hashicorp.com/c/terraform-providers/31),
in accordance with HashiCorp [Community Guidelines](https://www.hashicorp.com/community-guidelines).
We also provide:
* [Support](.github/SUPPORT.md) page for help when using the provider
* [Contributing](.github/CONTRIBUTING.md) guidelines in case you want to help this project
The remainder of this document will focus on the development aspects of the provider.
## Compatibility
Compatibility table between this provider, the [Terraform Plugin Protocol](https://www.terraform.io/plugin/how-terraform-works#terraform-plugin-protocol)
version it implements, and Terraform:
| TLS Provider | Terraform Plugin Protocol | Terraform |
|:------------:|:-------------------------:|:---------:|
| `>= 2.x` | `5` | `>= 0.12` |
| `>= 1.1.x` | `4` and `5` | `<= 0.12` |
| `>= 0.x` | `4` | `<= 0.11` |
Details can be found querying the [Registry API](https://www.terraform.io/internals/provider-registry-protocol#list-available-versions)
that return all the details about which version are currently available for a particular provider.
[Here](https://registry.terraform.io/v1/providers/hashicorp/local/versions) are the details for Local (JSON response).
## Requirements
* [Terraform](https://www.terraform.io/downloads)
* [Go](https://go.dev/doc/install) (1.23)
* [GNU Make](https://www.gnu.org/software/make/)
* [golangci-lint](https://golangci-lint.run/usage/install/#local-installation) (optional)
## Development
### Building
1. `git clone` this repository and `cd` into its directory
2. `make` will trigger the Golang build
The provided `GNUmakefile` defines additional commands generally useful during development,
like for running tests, generating documentation, code formatting and linting.
Taking a look at it's content is recommended.
### Testing
In order to test the provider, you can run
* `make test` to run provider tests
* `make testacc` to run provider acceptance tests
It's important to note that acceptance tests (`testacc`) will actually spawn
`terraform` and the provider. Read more about they work on the
[official page](https://www.terraform.io/plugin/sdkv2/testing/acceptance-tests).
### Generating documentation
This provider uses [terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs/)
to generate documentation and store it in the `docs/` directory.
Once a release is cut, the Terraform Registry will download the documentation from `docs/`
and associate it with the release version. Read more about how this works on the
[official page](https://www.terraform.io/registry/providers/docs).
Use `make generate` to ensure the documentation is regenerated with any changes.
### Using a development build
If [running tests and acceptance tests](#testing) isn't enough, it's possible to set up a local terraform configuration
to use a development builds of the provider. This can be achieved by leveraging the Terraform CLI
[configuration file development overrides](https://www.terraform.io/cli/config/config-file#development-overrides-for-provider-developers).
First, use `make install` to place a fresh development build of the provider in your
[`${GOBIN}`](https://pkg.go.dev/cmd/go#hdr-Compile_and_install_packages_and_dependencies)
(defaults to `${GOPATH}/bin` or `${HOME}/go/bin` if `${GOPATH}` is not set). Repeat
this every time you make changes to the provider locally.
Then, setup your environment following [these instructions](https://www.terraform.io/plugin/debugging#terraform-cli-development-overrides)
to make your local terraform use your local build.
### Testing GitHub Actions
This project uses [GitHub Actions](https://docs.github.com/en/actions/automating-builds-and-tests) to realize its CI.
Sometimes it might be helpful to locally reproduce the behaviour of those actions,
and for this we use [act](https://github.com/nektos/act). Once installed, you can _simulate_ the actions executed
when opening a PR with:
```shell
# List of workflows for the 'pull_request' action
$ act -l pull_request
# Execute the workflows associated with the `pull_request' action
$ act pull_request
```
## Releasing
The releasable builds are generated from the [build GH workflow](./.github/workflows/build.yml) and the release/promotion process
is completed via internal HashiCorp deployment tooling. Prior to release, the changelog should be updated in `main` with
the changie tool, example:
```sh
changie batch 2.5.3 && changie merge
```
## License
[Mozilla Public License v2.0](./LICENSE)

View File

@@ -0,0 +1,92 @@
## 3.2.4 (April 21, 2025)
NOTES:
* Dependency updates ([#421](https://github.com/hashicorp/terraform-provider-null/issues/421))
## 3.2.4-alpha1 (February 19, 2025)
NOTES:
* all: This release is being used to test new build and release actions.
## 3.2.4-alpha.2 (March 27, 2025)
NOTES:
* all: This release is being used to test new build and release actions.
## 3.2.3 (September 11, 2024)
NOTES:
* all: This release introduces no functional changes. It does however include dependency updates which address upstream CVEs. ([#366](https://github.com/hashicorp/terraform-provider-null/issues/366))
## 3.2.2 (November 20, 2023)
NOTES:
* This release introduces no functional changes. It does however include dependency updates which address upstream CVEs. ([#242](https://github.com/hashicorp/terraform-provider-null/issues/242))
## 3.2.1 (November 17, 2022)
BUG FIXES:
* provider: Fix random number generation for `id` attributes ([#160](https://github.com/hashicorp/terraform-provider-null/pull/160))
## 3.2.0 (October 25, 2022)
NOTES:
* Provider: Rewritten to use the new [`terraform-plugin-framework`](https://www.terraform.io/plugin/framework) ([#150](https://github.com/hashicorp/terraform-provider-null/pull/150))
## 3.1.1 (March 16, 2022)
NOTES:
* Updated [terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) to `v0.7.0`:
this improves generated documentation, with attributes now correctly formatted as `code`
and provided with anchors.
* Functionally identical to the previous 3.1.0 release.
## 3.1.0 (February 19, 2021)
Binary releases of this provider now include the darwin-arm64 platform. This version contains no further changes.
## 3.0.0 (October 08, 2020)
Binary releases of this provider now include the linux-arm64 platform.
BREAKING CHANGES:
* Upgrade to version 2 of the Terraform Plugin SDK, which drops support for Terraform 0.11. This provider will continue to work as expected for users of Terraform 0.11, which will not download the new version. ([#47](https://github.com/terraform-providers/terraform-provider-null/issues/47))
## 2.1.2 (April 30, 2019)
* This releases includes another Terraform SDK upgrade intended to align with that being used for other providers as we prepare for the Core v0.12.0 release. It should have no significant changes in behavior for this provider.
## 2.1.1 (April 11, 2019)
* This releases includes only a Terraform SDK upgrade intended to align with that being used for other providers as we prepare for the Core v0.12.0 release. It should have no significant changes in behavior for this provider.
## 2.1.0 (February 27, 2019)
IMPROVEMENTS:
* The previous release contains an SDK incompatible with TF 0.12. Fortunately 0.12 was not released yet so upgrading the vendored sdk makes this release compatible with 0.12.
## 2.0.0 (January 18, 2019)
IMPROVEMENTS:
* The provider is now compatible with Terraform v0.12, while retaining compatibility with prior versions.
## 1.0.0 (September 26, 2017)
* No changes from 0.1.0; just adjusting to [the new version numbering scheme](https://www.hashicorp.com/blog/hashicorp-terraform-provider-versioning/).
## 0.1.0 (June 21, 2017)
NOTES:
* Same functionality as that of Terraform 0.9.8. Repacked as part of [Provider Splitout](https://www.hashicorp.com/blog/upcoming-provider-changes-in-terraform-0-10/)

View File

@@ -0,0 +1,375 @@
Copyright (c) 2017 HashiCorp, Inc.
Mozilla Public License Version 2.0
==================================
1. Definitions
--------------
1.1. "Contributor"
means each individual or legal entity that creates, contributes to
the creation of, or owns Covered Software.
1.2. "Contributor Version"
means the combination of the Contributions of others (if any) used
by a Contributor and that particular Contributor's Contribution.
1.3. "Contribution"
means Covered Software of a particular Contributor.
1.4. "Covered Software"
means Source Code Form to which the initial Contributor has attached
the notice in Exhibit A, the Executable Form of such Source Code
Form, and Modifications of such Source Code Form, in each case
including portions thereof.
1.5. "Incompatible With Secondary Licenses"
means
(a) that the initial Contributor has attached the notice described
in Exhibit B to the Covered Software; or
(b) that the Covered Software was made available under the terms of
version 1.1 or earlier of the License, but not also under the
terms of a Secondary License.
1.6. "Executable Form"
means any form of the work other than Source Code Form.
1.7. "Larger Work"
means a work that combines Covered Software with other material, in
a separate file or files, that is not Covered Software.
1.8. "License"
means this document.
1.9. "Licensable"
means having the right to grant, to the maximum extent possible,
whether at the time of the initial grant or subsequently, any and
all of the rights conveyed by this License.
1.10. "Modifications"
means any of the following:
(a) any file in Source Code Form that results from an addition to,
deletion from, or modification of the contents of Covered
Software; or
(b) any new file in Source Code Form that contains any Covered
Software.
1.11. "Patent Claims" of a Contributor
means any patent claim(s), including without limitation, method,
process, and apparatus claims, in any patent Licensable by such
Contributor that would be infringed, but for the grant of the
License, by the making, using, selling, offering for sale, having
made, import, or transfer of either its Contributions or its
Contributor Version.
1.12. "Secondary License"
means either the GNU General Public License, Version 2.0, the GNU
Lesser General Public License, Version 2.1, the GNU Affero General
Public License, Version 3.0, or any later versions of those
licenses.
1.13. "Source Code Form"
means the form of the work preferred for making modifications.
1.14. "You" (or "Your")
means an individual or a legal entity exercising rights under this
License. For legal entities, "You" includes any entity that
controls, is controlled by, or is under common control with You. For
purposes of this definition, "control" means (a) the power, direct
or indirect, to cause the direction or management of such entity,
whether by contract or otherwise, or (b) ownership of more than
fifty percent (50%) of the outstanding shares or beneficial
ownership of such entity.
2. License Grants and Conditions
--------------------------------
2.1. Grants
Each Contributor hereby grants You a world-wide, royalty-free,
non-exclusive license:
(a) under intellectual property rights (other than patent or trademark)
Licensable by such Contributor to use, reproduce, make available,
modify, display, perform, distribute, and otherwise exploit its
Contributions, either on an unmodified basis, with Modifications, or
as part of a Larger Work; and
(b) under Patent Claims of such Contributor to make, use, sell, offer
for sale, have made, import, and otherwise transfer either its
Contributions or its Contributor Version.
2.2. Effective Date
The licenses granted in Section 2.1 with respect to any Contribution
become effective for each Contribution on the date the Contributor first
distributes such Contribution.
2.3. Limitations on Grant Scope
The licenses granted in this Section 2 are the only rights granted under
this License. No additional rights or licenses will be implied from the
distribution or licensing of Covered Software under this License.
Notwithstanding Section 2.1(b) above, no patent license is granted by a
Contributor:
(a) for any code that a Contributor has removed from Covered Software;
or
(b) for infringements caused by: (i) Your and any other third party's
modifications of Covered Software, or (ii) the combination of its
Contributions with other software (except as part of its Contributor
Version); or
(c) under Patent Claims infringed by Covered Software in the absence of
its Contributions.
This License does not grant any rights in the trademarks, service marks,
or logos of any Contributor (except as may be necessary to comply with
the notice requirements in Section 3.4).
2.4. Subsequent Licenses
No Contributor makes additional grants as a result of Your choice to
distribute the Covered Software under a subsequent version of this
License (see Section 10.2) or under the terms of a Secondary License (if
permitted under the terms of Section 3.3).
2.5. Representation
Each Contributor represents that the Contributor believes its
Contributions are its original creation(s) or it has sufficient rights
to grant the rights to its Contributions conveyed by this License.
2.6. Fair Use
This License is not intended to limit any rights You have under
applicable copyright doctrines of fair use, fair dealing, or other
equivalents.
2.7. Conditions
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
in Section 2.1.
3. Responsibilities
-------------------
3.1. Distribution of Source Form
All distribution of Covered Software in Source Code Form, including any
Modifications that You create or to which You contribute, must be under
the terms of this License. You must inform recipients that the Source
Code Form of the Covered Software is governed by the terms of this
License, and how they can obtain a copy of this License. You may not
attempt to alter or restrict the recipients' rights in the Source Code
Form.
3.2. Distribution of Executable Form
If You distribute Covered Software in Executable Form then:
(a) such Covered Software must also be made available in Source Code
Form, as described in Section 3.1, and You must inform recipients of
the Executable Form how they can obtain a copy of such Source Code
Form by reasonable means in a timely manner, at a charge no more
than the cost of distribution to the recipient; and
(b) You may distribute such Executable Form under the terms of this
License, or sublicense it under different terms, provided that the
license for the Executable Form does not attempt to limit or alter
the recipients' rights in the Source Code Form under this License.
3.3. Distribution of a Larger Work
You may create and distribute a Larger Work under terms of Your choice,
provided that You also comply with the requirements of this License for
the Covered Software. If the Larger Work is a combination of Covered
Software with a work governed by one or more Secondary Licenses, and the
Covered Software is not Incompatible With Secondary Licenses, this
License permits You to additionally distribute such Covered Software
under the terms of such Secondary License(s), so that the recipient of
the Larger Work may, at their option, further distribute the Covered
Software under the terms of either this License or such Secondary
License(s).
3.4. Notices
You may not remove or alter the substance of any license notices
(including copyright notices, patent notices, disclaimers of warranty,
or limitations of liability) contained within the Source Code Form of
the Covered Software, except that You may alter any license notices to
the extent required to remedy known factual inaccuracies.
3.5. Application of Additional Terms
You may choose to offer, and to charge a fee for, warranty, support,
indemnity or liability obligations to one or more recipients of Covered
Software. However, You may do so only on Your own behalf, and not on
behalf of any Contributor. You must make it absolutely clear that any
such warranty, support, indemnity, or liability obligation is offered by
You alone, and You hereby agree to indemnify every Contributor for any
liability incurred by such Contributor as a result of warranty, support,
indemnity or liability terms You offer. You may include additional
disclaimers of warranty and limitations of liability specific to any
jurisdiction.
4. Inability to Comply Due to Statute or Regulation
---------------------------------------------------
If it is impossible for You to comply with any of the terms of this
License with respect to some or all of the Covered Software due to
statute, judicial order, or regulation then You must: (a) comply with
the terms of this License to the maximum extent possible; and (b)
describe the limitations and the code they affect. Such description must
be placed in a text file included with all distributions of the Covered
Software under this License. Except to the extent prohibited by statute
or regulation, such description must be sufficiently detailed for a
recipient of ordinary skill to be able to understand it.
5. Termination
--------------
5.1. The rights granted under this License will terminate automatically
if You fail to comply with any of its terms. However, if You become
compliant, then the rights granted under this License from a particular
Contributor are reinstated (a) provisionally, unless and until such
Contributor explicitly and finally terminates Your grants, and (b) on an
ongoing basis, if such Contributor fails to notify You of the
non-compliance by some reasonable means prior to 60 days after You have
come back into compliance. Moreover, Your grants from a particular
Contributor are reinstated on an ongoing basis if such Contributor
notifies You of the non-compliance by some reasonable means, this is the
first time You have received notice of non-compliance with this License
from such Contributor, and You become compliant prior to 30 days after
Your receipt of the notice.
5.2. If You initiate litigation against any entity by asserting a patent
infringement claim (excluding declaratory judgment actions,
counter-claims, and cross-claims) alleging that a Contributor Version
directly or indirectly infringes any patent, then the rights granted to
You by any and all Contributors for the Covered Software under Section
2.1 of this License shall terminate.
5.3. In the event of termination under Sections 5.1 or 5.2 above, all
end user license agreements (excluding distributors and resellers) which
have been validly granted by You or Your distributors under this License
prior to termination shall survive termination.
************************************************************************
* *
* 6. Disclaimer of Warranty *
* ------------------------- *
* *
* Covered Software is provided under this License on an "as is" *
* basis, without warranty of any kind, either expressed, implied, or *
* statutory, including, without limitation, warranties that the *
* Covered Software is free of defects, merchantable, fit for a *
* particular purpose or non-infringing. The entire risk as to the *
* quality and performance of the Covered Software is with You. *
* Should any Covered Software prove defective in any respect, You *
* (not any Contributor) assume the cost of any necessary servicing, *
* repair, or correction. This disclaimer of warranty constitutes an *
* essential part of this License. No use of any Covered Software is *
* authorized under this License except under this disclaimer. *
* *
************************************************************************
************************************************************************
* *
* 7. Limitation of Liability *
* -------------------------- *
* *
* Under no circumstances and under no legal theory, whether tort *
* (including negligence), contract, or otherwise, shall any *
* Contributor, or anyone who distributes Covered Software as *
* permitted above, be liable to You for any direct, indirect, *
* special, incidental, or consequential damages of any character *
* including, without limitation, damages for lost profits, loss of *
* goodwill, work stoppage, computer failure or malfunction, or any *
* and all other commercial damages or losses, even if such party *
* shall have been informed of the possibility of such damages. This *
* limitation of liability shall not apply to liability for death or *
* personal injury resulting from such party's negligence to the *
* extent applicable law prohibits such limitation. Some *
* jurisdictions do not allow the exclusion or limitation of *
* incidental or consequential damages, so this exclusion and *
* limitation may not apply to You. *
* *
************************************************************************
8. Litigation
-------------
Any litigation relating to this License may be brought only in the
courts of a jurisdiction where the defendant maintains its principal
place of business and such litigation shall be governed by laws of that
jurisdiction, without reference to its conflict-of-law provisions.
Nothing in this Section shall prevent a party's ability to bring
cross-claims or counter-claims.
9. Miscellaneous
----------------
This License represents the complete agreement concerning the subject
matter hereof. If any provision of this License is held to be
unenforceable, such provision shall be reformed only to the extent
necessary to make it enforceable. Any law or regulation which provides
that the language of a contract shall be construed against the drafter
shall not be used to construe this License against a Contributor.
10. Versions of the License
---------------------------
10.1. New Versions
Mozilla Foundation is the license steward. Except as provided in Section
10.3, no one other than the license steward has the right to modify or
publish new versions of this License. Each version will be given a
distinguishing version number.
10.2. Effect of New Versions
You may distribute the Covered Software under the terms of the version
of the License under which You originally received the Covered Software,
or under the terms of any subsequent version published by the license
steward.
10.3. Modified Versions
If you create software not governed by this License, and you want to
create a new license for such software, you may create and use a
modified version of this License if you rename the license and remove
any references to the name of the license steward (except to note that
such modified license differs from this License).
10.4. Distributing Source Code Form that is Incompatible With Secondary
Licenses
If You choose to distribute Source Code Form that is Incompatible With
Secondary Licenses under the terms of this version of the License, the
notice described in Exhibit B of this License must be attached.
Exhibit A - Source Code Form License Notice
-------------------------------------------
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
If it is not possible or desirable to put the notice in a particular
file, then You may include the notice in a location (such as a LICENSE
file in a relevant directory) where a recipient would be likely to look
for such a notice.
You may add additional accurate notices of copyright ownership.
Exhibit B - "Incompatible With Secondary Licenses" Notice
---------------------------------------------------------
This Source Code Form is "Incompatible With Secondary Licenses", as
defined by the Mozilla Public License, v. 2.0.

View File

@@ -0,0 +1,113 @@
# Terraform Provider: Null
The Null provider is a rather-unusual provider that has constructs that intentionally do nothing. This may sound strange, and indeed these constructs do not need to be used in most cases, but they can be useful in various situations to help orchestrate tricky behavior or work around limitations.
## Requirements
* [Terraform](https://www.terraform.io/downloads)
* [Go](https://go.dev/doc/install) (1.23)
* [GNU Make](https://www.gnu.org/software/make/)
* [golangci-lint](https://golangci-lint.run/usage/install/#local-installation) (optional)
## Documentation, questions and discussions
Official documentation on how to use this provider can be found on the
[Terraform Registry](https://registry.terraform.io/providers/hashicorp/null/latest/docs).
In case of specific questions or discussions, please use the
HashiCorp [Terraform Providers Discuss forums](https://discuss.hashicorp.com/c/terraform-providers/31),
in accordance with HashiCorp [Community Guidelines](https://www.hashicorp.com/community-guidelines).
We also provide:
* [Support](.github/SUPPORT.md) page for help when using the provider
* [Contributing](.github/CONTRIBUTING.md) guidelines in case you want to help this project
## Compatibility
Compatibility table between this provider, the [Terraform Plugin Protocol](https://www.terraform.io/plugin/how-terraform-works#terraform-plugin-protocol)
version it implements, and Terraform:
| Null Provider | Terraform Plugin Protocol | Terraform |
|:-------------:|:-------------------------:|:---------:|
| `>= 3.0.x` | `5` | `>= 0.12` |
| `>= 2.1.x` | `4` and `5` | `>= 0.12` |
| `>= 2.x.x` | `4` | `<= 0.12` |
| `>= 1.x.x` | `4` | `<= 0.12` |
| `>= 0.1.x` | `4` | `<= 0.12` |
Details can be found querying the [Registry API](https://www.terraform.io/internals/provider-registry-protocol#list-available-versions)
that return all the details about which version are currently available for a particular provider.
[Here](https://registry.terraform.io/v1/providers/hashicorp/null/versions) are the details for Time (JSON response).
## Development
### Building
1. `git clone` this repository and `cd` into its directory
2. `make` will trigger the Golang build
The provided `GNUmakefile` defines additional commands generally useful during development,
like for running tests, generating documentation, code formatting and linting.
Taking a look at it's content is recommended.
### Testing
In order to test the provider, you can run
* `make test` to run provider tests
* `make testacc` to run provider acceptance tests
It's important to note that acceptance tests (`testacc`) will actually spawn
`terraform` and the provider. Read more about they work on the
[official page](https://www.terraform.io/plugin/sdkv2/testing/acceptance-tests).
### Generating documentation
This provider uses [terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs/)
to generate documentation and store it in the `docs/` directory.
Once a release is cut, the Terraform Registry will download the documentation from `docs/`
and associate it with the release version. Read more about how this works on the
[official page](https://www.terraform.io/registry/providers/docs).
Use `make generate` to ensure the documentation is regenerated with any changes.
### Using a development build
If [running tests and acceptance tests](#testing) isn't enough, it's possible to set up a local terraform configuration
to use a development builds of the provider. This can be achieved by leveraging the Terraform CLI
[configuration file development overrides](https://www.terraform.io/cli/config/config-file#development-overrides-for-provider-developers).
First, use `make install` to place a fresh development build of the provider in your
[`${GOBIN}`](https://pkg.go.dev/cmd/go#hdr-Compile_and_install_packages_and_dependencies)
(defaults to `${GOPATH}/bin` or `${HOME}/go/bin` if `${GOPATH}` is not set). Repeat
this every time you make changes to the provider locally.
Then, setup your environment following [these instructions](https://www.terraform.io/plugin/debugging#terraform-cli-development-overrides)
to make your local terraform use your local build.
### Testing GitHub Actions
This project uses [GitHub Actions](https://docs.github.com/en/actions/automating-builds-and-tests) to realize its CI.
Sometimes it might be helpful to locally reproduce the behaviour of those actions,
and for this we use [act](https://github.com/nektos/act). Once installed, you can _simulate_ the actions executed
when opening a PR with:
```shell
# List of workflows for the 'pull_request' action
$ act -l pull_request
# Execute the workflows associated with the `pull_request' action
$ act pull_request
```
## Releasing
The release process is automated via GitHub Actions, and it's defined in the Workflow
[release.yml](./.github/workflows/release.yml).
Each release is cut by pushing a [semantically versioned](https://semver.org/) tag to the default branch.
## License
[Mozilla Public License v2.0](./LICENSE)

View File

@@ -5,5 +5,16 @@ proxmox_api_token_secret = "abb30a27-6d10-4d1e-8f3c-a02c355b3ee9"
#lxc_passwd = "reliyyaeknpt3"
#vm_passwd = "reliyyaeknpt3"
ssh_public_key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBzh23ZkSVNbmDKk9esAT9qNkOoYFLhpX2nSLKPJaDVZ petar.cubela@sbx-mac-lab.local"
#ssh_private_key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBzh23ZkSVNbmDKk9esAT9qNkOoYFLhpX2nSLKPJaDVZ petar.cubela@sbx-mac-lab.local"
ssh_private_key = <<EOF
-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW
QyNTUxOQAAACAc4dt2ZElTW5gypPXrAE/ajZDqGBS4aV9p0iyjyWg1WQAAAKhO7eCcTu3g
nAAAAAtzc2gtZWQyNTUxOQAAACAc4dt2ZElTW5gypPXrAE/ajZDqGBS4aV9p0iyjyWg1WQ
AAAECrVRbLCskZknjawaxthMmiKEapFwHvV8jo4fox0ScNQhzh23ZkSVNbmDKk9esAT9qN
kOoYFLhpX2nSLKPJaDVZAAAAHnBldGFyLmN1YmVsYUBzYngtbWFjLWxhYi5sb2NhbAECAw
QFBgc=
-----END OPENSSH PRIVATE KEY-----
EOF

1
env.auto.tfvars Normal file
View File

@@ -0,0 +1 @@
domain = "lab.softbox.net"

View File

@@ -0,0 +1,28 @@
#cloud-config
package_update: true
package_upgrade: true
packages:
- curl
- qemu-guest-agent
- vim
- htop
- bash-completion
users:
- name: sbxadmin
groups: sudo
shell: /bin/bash
sudo: ['ALL=(ALL) NOPASSWD:ALL']
ssh_authorized_keys:
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBzh23ZkSVNbmDKk9esAT9qNkOoYFLhpX2nSLKPJaDVZ petar.cubela@sbx-mac-lab.local
preserve_hostname: false
manage_etc_hosts: false
fqdn: ipa.lab.softbox.net
runcmd:
- systemctl start qemu-guest-agent
- systemctl enable --now qemu-guest-agent

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

16
variables.tf Normal file
View File

@@ -0,0 +1,16 @@
variable "domain" {
type = string
}
variable "ssh_public_key" {
type = string
sensitive = true
}
variable "ssh_private_key" {
type = string
sensitive = true
}

View File

@@ -1,70 +0,0 @@
resource "proxmox_vm_qemu" "vm-demo-1" {
name = "sbx-lab-sssd"
# Node name has to be the same name as within the cluster
# this might not include the FQDN
target_node = "pve"
# The template name to clone this vm from
clone = "template-24.04-noble"
# Activate QEMU agent for this VM
agent = 1
os_type = "cloud-init"
vmid = 112
vm_state = "stopped"
cpu {
cores = 2
sockets = 1
type = "host"
}
memory = 2048
scsihw = "virtio-scsi-single"
# Setup the disk
disks {
scsi {
scsi0 {
# We have to specify the disk from our template, else Terraform will think it's not supposed to be there
disk {
storage = "local-lvm"
# The size of the disk should be at least as big as the disk in the template. If it's smaller, the disk will be recreated
size = "8G"
}
}
}
ide {
# Some images require a cloud-init disk on the IDE controller, others on the SCSI or SATA controller
ide1 {
cloudinit {
storage = "local-lvm"
}
}
}
}
# Setup the network interface and assign a vlan tag: 256
network {
id = 0
model = "virtio"
bridge = "vmbr0"
macaddr = "bc:24:11:de:ca:28"
}
nameserver = "10.11.12.66"
boot = "order=scsi0"
tags = "ad,ldap,sssd,samba,kerberos"
# Setup the ip address using cloud-init.
# Keep in mind to use the CIDR notation for the ip.
ipconfig0 = "ip=dhcp"
ciuser = "sbxadmin"
cicustom = "vendor=local:snippets/qemu-guest-agent.yml" # /var/lib/vz/snippets/qemu-guest-agent.yml
ciupgrade = true
sshkeys = <<EOF
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBzh23ZkSVNbmDKk9esAT9qNkOoYFLhpX2nSLKPJaDVZ petar.cubela@sbx-mac-lab.local
EOF
}

View File

@@ -54,6 +54,7 @@ resource "proxmox_vm_qemu" "vm-freeipa" {
}
nameserver = "9.9.9.9"
onboot = true
boot = "order=scsi0"
tags = "ldap,samba,kerberos,dns,pki"
@@ -61,7 +62,7 @@ resource "proxmox_vm_qemu" "vm-freeipa" {
# Keep in mind to use the CIDR notation for the ip.
ipconfig0 = "ip=10.11.12.65/24,gw=10.11.12.254"
ciuser = "sbxadmin"
cicustom = "vendor=local:snippets/qemu-guest-agent.yml" # /var/lib/vz/snippets/qemu-guest-agent.yml
cicustom = "vendor=local:snippets/qemu-guest-agent.yml,user=local:snippets/cloud_init_fedora_vm_ipa.yml" # /var/lib/vz/snippets/qemu-guest-agent.yml
ciupgrade = true
sshkeys = <<EOF

View File

@@ -1,70 +1,71 @@
resource "proxmox_vm_qemu" "vm_freeipa_client" {
name = "ipa-client"
# Node name has to be the same name as within the cluster
# this might not include the FQDN
target_node = "pve"
# The template name to clone this vm from
clone = "temp-fedora-38"
# Activate QEMU agent for this VM
agent = 1
os_type = "cloud-init"
vmid = 113
vm_state = "running"
cpu {
cores = 2
sockets = 1
type = "host"
}
memory = 2048
scsihw = "virtio-scsi-pci"
# Setup the disk
disks {
scsi {
scsi0 {
# We have to specify the disk from our template, else Terraform will think it's not supposed to be there
disk {
storage = "local-lvm"
# The size of the disk should be at least as big as the disk in the template. If it's smaller, the disk will be recreated
size = "16G"
}
}
}
ide {
# Some images require a cloud-init disk on the IDE controller, others on the SCSI or SATA controller
ide1 {
cloudinit {
storage = "local-lvm"
}
}
}
}
# Setup the network interface and assign a vlan tag: 256
network {
id = 0
model = "virtio"
bridge = "vmbr0"
macaddr = "bc:24:11:de:cb:31"
}
nameserver = "10.11.12.65,10.11.12.254"
boot = "order=scsi0"
tags = "ldap,samba,kerberos,dns,pki"
# Setup the ip address using cloud-init.
# Keep in mind to use the CIDR notation for the ip.
ipconfig0 = "ip=10.11.12.13/24,gw=10.11.12.254"
ciuser = "sbxadmin"
cicustom = "vendor=local:snippets/qemu-guest-agent.yml" # /var/lib/vz/snippets/qemu-guest-agent.yml
ciupgrade = true
sshkeys = <<EOF
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBzh23ZkSVNbmDKk9esAT9qNkOoYFLhpX2nSLKPJaDVZ petar.cubela@sbx-mac-lab.local
EOF
}
#resource "proxmox_vm_qemu" "vm_freeipa_client" {
# name = "ipa-client"
#
# # Node name has to be the same name as within the cluster
# # this might not include the FQDN
# target_node = "pve"
#
# # The template name to clone this vm from
# clone = "temp-fedora-38"
#
# # Activate QEMU agent for this VM
# agent = 1
#
# os_type = "cloud-init"
# vmid = 113
# vm_state = "stopped"
#
# cpu {
# cores = 2
# sockets = 1
# type = "host"
# }
# memory = 2048
# scsihw = "virtio-scsi-pci"
#
# # Setup the disk
# disks {
# scsi {
# scsi0 {
# # We have to specify the disk from our template, else Terraform will think it's not supposed to be there
# disk {
# storage = "local-lvm"
# # The size of the disk should be at least as big as the disk in the template. If it's smaller, the disk will be recreated
# size = "16G"
# }
# }
# }
# ide {
# # Some images require a cloud-init disk on the IDE controller, others on the SCSI or SATA controller
# ide1 {
# cloudinit {
# storage = "local-lvm"
# }
# }
# }
# }
# # Setup the network interface and assign a vlan tag: 256
#
# network {
# id = 0
# model = "virtio"
# bridge = "vmbr0"
# macaddr = "bc:24:11:de:cb:31"
# }
# nameserver = "10.11.12.65,10.11.12.254"
#
# onboot = true
# boot = "order=scsi0"
# tags = "ldap,samba,kerberos,dns,pki"
#
# # Setup the ip address using cloud-init.
# # Keep in mind to use the CIDR notation for the ip.
# ipconfig0 = "ip=10.11.12.13/24,gw=10.11.12.254"
# ciuser = "sbxadmin"
# cicustom = "vendor=local:snippets/qemu-guest-agent.yml" # /var/lib/vz/snippets/qemu-guest-agent.yml
# ciupgrade = true
#
# sshkeys = <<EOF
# ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBzh23ZkSVNbmDKk9esAT9qNkOoYFLhpX2nSLKPJaDVZ petar.cubela@sbx-mac-lab.local
# EOF
#}

179
vm_freeipa_user_data.tf Normal file
View File

@@ -0,0 +1,179 @@
# # Source the Cloud Init Config file
# data "template_file" "cloud_init_fedora_vm_ipa" {
# template = "${file("${path.module}/files/cloud_init_fedora.cloud_config")}"
#
# vars = {
# ssh_key = file("~/.ssh/id_ed25519.pub")
# hostname = "ipa"
# domain = var.domain
# }
# }
## Create a local copy of the file, to transfer to Proxmox
#resource "local_file" "cloud_init_fedora_vm_ipa" {
# #content = data.template_file.cloud_init_fedora_vm_ipa.rendered
# #content = templatefile("${var.working_directory}/cloud-inits/cloud-init.cloud_config.tftpl", { ssh_key = var.public_ssh_key, hostname = "ipa" })
# content = templatefile("${path.module}/files/user_data_cloud_init_fedora_vm_ipa.cfg", { ssh_key = var.ssh_public_key, hostname = "ipa" , domain = var.domain})
# filename = "${path.module}/files/user_data_cloud_init_fedora_vm_ipa.cfg"
#}
#
## Transfer the file to the Proxmox Host
#resource "null_resource" "cloud_init_fedora_vm_ipa" {
# connection {
# type = "ssh"
# user = "root"
# private_key = file("~/.ssh/id_ed25519")
# host = "pve.lab.softbox.net"
# }
#
# provisioner "file" {
# source = local_file.cloud_init_fedora_vm_ipa.filename
# destination = "/var/lib/vz/snippets/cloud_init_fedora_vm_ipa.yml"
# }
#}
#
#
#/* Configure Cloud-Init User-Data with custom config file */
#resource "proxmox_vm_qemu" "cloudinit-fedora" {
# depends_on = [
# null_resource.cloud_init_fedora_vm_ipa,
# ]
#
# name = "ipa"
# #desc = "FreeIPA Server"
# target_node = "pve"
#
# clone = "temp-fedora-38"
#
# # The destination resource pool for the new VM
# pool = "lab"
#
# #storage = "local"
# cpu {
# cores = 2
# sockets = 1
# type = "host"
# }
#
# memory = 2048
# #disk_gb = 16
# #nic = "virtio"
# #bridge = "vmbr0"
#
# ssh_user = "root"
# ssh_private_key = var.ssh_private_key
# os_type = "cloud-init"
# ipconfig0 = "ip=10.11.12.65/24,gw=10.11.12.254"
#
# /*
# sshkeys and other User-Data parameters are specified with a custom config file.
# In this example each VM has its own config file, previously generated and uploaded to
# the snippets folder in the local storage in the Proxmox VE server.
# */
# cicustom = "user=local:snippets/cloud_init_fedora_vm_ipa.yml"
# /* Create the Cloud-Init drive on the "local-lvm" storage */
# disks {
# ide {
# ide3 {
# cloudinit {
# storage = "local-lvm"
# }
# }
# }
# }
# tags = "fedora"
#
# #provisioner "remote-exec" {
# # inline = [
# # "ip a"
# # ]
# #}
#}
#
#/* Uses custom eth1 user-net SSH portforward */
#resource "proxmox_vm_qemu" "vm_ipa" {
# name = "ipa"
# #desc = "FreeIPA Server"
# target_node = "pve"
#
# clone = "temp-fedora-38"
# vmid = 111
# agent = 1
#
# # The destination resource pool for the new VM
# pool = "lab"
#
# cpu {
# cores = 2
# sockets = 1
# type = "host"
# }
# tags = "ldap,samba,kerberos,dns,pki"
#
# # Same CPU as the Physical host, possible to add cpu flags
# # Ex: "host,flags=+md-clear;+pcid;+spec-ctrl;+ssbd;+pdpe1gb"
# memory = 2048
# #scsihw = "lsi"
# scsihw = "virtio-scsi-pci"
# # Boot from hard disk (c), CD-ROM (d), network (n)
# boot = "cdn"
# # It's possible to add this type of material and use it directly
# # Possible values are: network,disk,cpu,memory,usb
# hotplug = "network,disk,usb"
# # Default boot disk
# bootdisk = "virtio0"
# # HA, you need to use a shared disk for this feature (ex: rbd)
# hastate = ""
#
# #Display
# vga {
# type = "serial0"
# #Between 4 and 512, ignored if type is defined to serial
# memory = 4
# }
#
# network {
# id = 0
# model = "virtio"
# bridge = "vmbr0"
# macaddr = "bc:24:11:de:2b:30"
# }
# disk {
# #id = 0
# type = "disk"
# storage = "local-lvm"
# slot = "virtio0"
# #storage_type = "lvm"
# size = "16"
# backup = true
# }
# # Serial interface of type socket is used by xterm.js
# # You will need to configure your guest system before being able to use it
# serial {
# id = 0
# type = "socket"
# }
# #preprovision = true
# ssh_forward_ip = "10.11.12.1"
# ssh_user = "root"
# ssh_private_key = var.ssh_private_key
# os_type = "ubuntu"
# os_network_config = <<EOF
#auto eth0
#iface eth0 inet dhcp
#EOF
#
# connection {
# type = "ssh"
# user = self.ssh_user
# private_key = self.ssh_private_key
# host = self.ssh_host
# port = self.ssh_port
# }
#
# #provisioner "remote-exec" {
# # inline = [
# # "ip a"
# # ]
# #}
#}