Switch from coreos to nixos
This commit is contained in:
24
archive/1-coreos/2-install-coreos/.terraform.lock.hcl
generated
Normal file
24
archive/1-coreos/2-install-coreos/.terraform.lock.hcl
generated
Normal file
@@ -0,0 +1,24 @@
|
||||
# This file is maintained automatically by "terraform init".
|
||||
# Manual edits may be lost in future updates.
|
||||
|
||||
provider "registry.terraform.io/dmacvicar/libvirt" {
|
||||
version = "0.7.6"
|
||||
constraints = "0.7.6"
|
||||
hashes = [
|
||||
"h1:mmbm4vTyC/DCGO4Ed/vbp5AKvy1gmVn/94fzB9VmR08=",
|
||||
"zh:0bde54f6f658b20b620b875daf106b5b25b1bae4d15408d6c5f06d58360e254d",
|
||||
"zh:0c97c6930015918b8a34b6d7a2b0c3d17a649c226fcd1874fcba5bbbc0f35972",
|
||||
"zh:1bdd7aa0011c5f024a09a124836ee9bc8e71b05a6ece810c61824275fd3f695f",
|
||||
"zh:2b0cc7c794e4caf395d84ffff0b380d17e4b3219a4696264271bfe5059450efe",
|
||||
"zh:2f8633f7fe07f76c188836ed6f93321ec5fbf5c004bc7699e1741d9b21ed5f37",
|
||||
"zh:5bf47eed286ce55ed10a5cf657de49a34ab21cc8677c56fef3aab69cdde41a27",
|
||||
"zh:7dca790fc5fd1d42bc4bc7170be003a7093602026d0f95c8aab84ad551fdf2a4",
|
||||
"zh:80476b68bc84e3d661d1390025f83879b88f9cdc836de9751af09bd5716089cb",
|
||||
"zh:82f3e2f3f50176cd6041c8ba36e295cbda1b289ef52ab75b5eceb0f921f64f7b",
|
||||
"zh:a179b165f3b9bb9a67ebbbf9d73157ded33f02d476b2f58906389dca03b653c9",
|
||||
"zh:acae54a5d0616f22b3180ddd8e8aad39af664e604394fdacf1f7b337bca2d5b4",
|
||||
"zh:da4406a2428a9a7e98272c032cb93431c3919253af2fe9934b532d26c0deab09",
|
||||
"zh:f63dbd8e579ab5268d01ffab4503b8a8e736b70d1a04e4f271559ba8dd133dcd",
|
||||
"zh:f85c1d9e51a94ecde137435c9d6b0fb7be590437ea8a725334d1577eebbc550c",
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
## 0.5.1 (December 14, 2018)
|
||||
|
||||
### HIGHLIGHTS:
|
||||
|
||||
- The provider will retry HTTP downloads if they were caused by server errors (https://github.com/dmacvicar/terraform-provider-libvirt/pull/479)
|
||||
- XSLT can be used to transform the libvirt XML definition before creating resources, allowing to enable features the provider does not support (https://github.com/dmacvicar/terraform-provider-libvirt/pull/431)
|
||||
- volumes: when the _HEAD_ method is forbidden, the provider will try a body-less _GET_ instead (https://github.com/dmacvicar/terraform-provider-libvirt/pull/472)
|
||||
- network: add support for updating _dns.hosts_ (https://github.com/dmacvicar/terraform-provider-libvirt/pull/469)
|
||||
- network: add support for setting _SRV_ entries (https://github.com/dmacvicar/terraform-provider-libvirt/pull/460)
|
||||
- qemu-agent: do not contact the qemu agent if the domain is shutdown (https://github.com/dmacvicar/terraform-provider-libvirt/pull/474)
|
||||
- cli: add `-version` flag (https://github.com/dmacvicar/terraform-provider-libvirt/pull/444)
|
||||
|
||||
## 0.5 (October 10, 2018)
|
||||
|
||||
### HIGHLIGHTS:
|
||||
|
||||
#### libvirt Domain
|
||||
|
||||
* _cloud_init_ resource is obsolete and replaced with _cloud_init_disk_ (https://github.com/dmacvicar/terraform-provider-libvirt/pull/410)
|
||||
|
||||
The resource does not allow individual fields anymore, and directly takes the _user_data_, _network_config_ and _meta_data_ fields, which you can provide directly or reading from a file, optionally using a _template_ resource and the rendered function. See the [updated documentation](https://github.com/dmacvicar/terraform-provider-libvirt/blob/master/website/docs/r/cloudinit.html.markdown).
|
||||
|
||||
#### Volumes/Disk/Storage
|
||||
|
||||
* Allow to set the size of a volume larger than its backing volume, which allows to resize the partition then using _cloud-init_, and not be limited by the backing image (#369 and #357).
|
||||
|
||||
## 0.4.4 (September 16, 2018)
|
||||
|
||||
### HIGHLIGHTS:
|
||||
|
||||
#### libvirt Domain
|
||||
|
||||
* `TF_USE_QEMU_AGENT` variable is deprecated and replaced by a domain property `qemu_agent`.
|
||||
Because variables can be interpolated into properties, and variables can be [passed via environment variables](https://www.terraform.io/docs/configuration/environment-variables.html#tf_var_name), the old behavior can be emulated.
|
||||
|
||||
#### Volumes/Disk/Storage
|
||||
|
||||
* Automatic disk driver selection based on volume format and automatic volume format detection(https://github.com/dmacvicar/terraform-provider-libvirt/commit/676b5a3fec75664990e5a91f24859f35becdee6a)
|
||||
|
||||
#### Networking
|
||||
|
||||
* `dhcp` paramater is an optional parameter now, disabled by default. (https://github.com/dmacvicar/terraform-provider-libvirt/pull/385)
|
||||
* DNS forwarders were reworked. `localonly` option was added to libvirt-network (https://github.com/dmacvicar/terraform-provider-libvirt/commit/7651ee5824f77f0c7485736315d5a24762f85e60)
|
||||
* A datasource called `libvirt_network_dns_hosts_template` can be used to populate the `dns_host` attribute in `libvirt_network` resources. (https://github.com/dmacvicar/terraform-provider-libvirt/commit/a4d0ba6a319d8728cb5d6c10aae593bdd27da516)
|
||||
___
|
||||
#### General improvements
|
||||
|
||||
* Acceptance tests are now idempotent (no dependency between resource of various tests), which avoids cascade failures. (several PRs and commits)
|
||||
* Project dependencies were updated ( https://github.com/dmacvicar/terraform-provider-libvirt/commit/1347e7cabbe68d93f7cc065339636854d7c7d340)
|
||||
* The error message when uploading a volume fails was improved (https://github.com/dmacvicar/terraform-provider-libvirt/commit/1aec44e0c990c4edb22578125bae33f92c4a4f39)
|
||||
___
|
||||
#### Bugs
|
||||
|
||||
* `netIface["bridge"]` now uses the correct value (https://github.com/dmacvicar/terraform-provider-libvirt/commit/2e93c78b2aea17b48639b3d613f12bfad851fd52)
|
||||
|
||||
## 0.4.3 (August 14, 2018)
|
||||
|
||||
HIGHLIGHTS:
|
||||
|
||||
* *IMPORTANT* qemu-agent is not used by default to gather network
|
||||
interface information anymore. If you need to use, please set
|
||||
the TF_USE_QEMU_AGENT environment variable.
|
||||
|
||||
* Handle gracefully out-of-band destruction of volume and cloud-init
|
||||
resources. Should provide a better end-user experience in day to day
|
||||
operations.
|
||||
|
||||
## 0.4.2 (August 3, 2018)
|
||||
|
||||
HIGHLIGHTS:
|
||||
|
||||
* Fix crashes when using network devices not associated with a
|
||||
network name (regression introduced in 0.4)
|
||||
|
||||
## 0.4.1 (July 28, 2018)
|
||||
|
||||
HIGHLIGHTS:
|
||||
|
||||
* Fix broken ip address detection bug that was introduced in 0.4
|
||||
* Add support for importing domain, network, volumes (#336)
|
||||
|
||||
## 0.4 (July 25, 2018)
|
||||
|
||||
HIGHLIGHTS:
|
||||
|
||||
* Support for multiple provider instances (ie: hypervisors) with different URIs
|
||||
* Support for keyword-less and nested equal signs in kernel parameters
|
||||
* Adds the `running` attribute when creating a domain
|
||||
* Fix a bug with UEFI/OVMF booting on remote hypervisors
|
||||
* Update the project dependencies to more recent versions
|
||||
* The project now provides builds
|
||||
* The project now has a gitter.im channel
|
||||
* Integration tests are fixed and working again
|
||||
|
||||
|
||||
@@ -0,0 +1,174 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
@@ -0,0 +1,154 @@
|
||||
# Terraform provider for libvirt
|
||||
|
||||
- [](https://gitter.im/terraform-provider-libvirt/Lobby) ([IRC gateway](https://irc.gitter.im/))
|
||||
- Planning board: [Github Projects](https://github.com/dmacvicar/terraform-provider-libvirt/projects/1)
|
||||
|
||||
|
||||
 [](https://github.com/dmacvicar/terraform-provider-libvirt/actions/workflows/test.yml) [](https://registry.terraform.io/providers/dmacvicar/libvirt/latest/docs)
|
||||
|
||||
___
|
||||
This is a terraform provider that lets you provision
|
||||
servers on a [libvirt](https://libvirt.org/) host via [Terraform](https://terraform.io/).
|
||||
|
||||
## Introduction & Goals
|
||||
|
||||
This project exists:
|
||||
|
||||
* To allow teams to get the benefits [Software Defined Infrastructure](https://en.wikipedia.org/wiki/Software-defined_infrastructure) Terraform provides, on top of classical and cheap virtualization infrastructure provided by Linux and [KVM](https://www.linux-kvm.org)
|
||||
This helps in very dynamic [DevOps](https://en.wikipedia.org/wiki/DevOps), Development and Testing activities.
|
||||
* To allow for mixing KVM resources with other infrastructure Terraform is able to manage
|
||||
|
||||
What is *NOT* in scope:
|
||||
|
||||
* To support every advanced feature [libvirt](https://libvirt.org/) supports
|
||||
|
||||
This would make the mapping from terraform complicated and not maintainable. See the [How to contribute](CONTRIBUTING.md) section to understand how to approach new features.
|
||||
|
||||
## Getting started
|
||||
|
||||
The provider is available for auto-installation from the [Terraform Registry](https://registry.terraform.io/providers/dmacvicar/libvirt/latest).
|
||||
|
||||
In your `main.tf` file, specify the version you want to use:
|
||||
|
||||
```hcl
|
||||
terraform {
|
||||
required_providers {
|
||||
libvirt = {
|
||||
source = "dmacvicar/libvirt"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
provider "libvirt" {
|
||||
# Configuration options
|
||||
}
|
||||
```
|
||||
|
||||
And now run terraform init:
|
||||
|
||||
```console
|
||||
$ terraform init
|
||||
```
|
||||
|
||||
### Creating your first virtual machine
|
||||
|
||||
Here is an example that will setup the following:
|
||||
|
||||
+ A virtual server resource
|
||||
|
||||
(create this as main.tf and run terraform commands from this directory):
|
||||
```hcl
|
||||
provider "libvirt" {
|
||||
uri = "qemu:///system"
|
||||
}
|
||||
```
|
||||
|
||||
You can also set the URI in the LIBVIRT_DEFAULT_URI environment variable.
|
||||
|
||||
Now, define a libvirt domain:
|
||||
|
||||
```hcl
|
||||
resource "libvirt_domain" "terraform_test" {
|
||||
name = "terraform_test"
|
||||
}
|
||||
```
|
||||
|
||||
Now you can see the plan, apply it, and then destroy the infrastructure:
|
||||
|
||||
```console
|
||||
$ terraform init
|
||||
$ terraform plan
|
||||
$ terraform apply
|
||||
$ terraform destroy
|
||||
```
|
||||
|
||||
Look at more advanced examples [here](examples/) and check the [documentation](https://registry.terraform.io/providers/dmacvicar/libvirt/latest/docs).
|
||||
|
||||
## Manual installation
|
||||
|
||||
You can also manually download the provider from the [releases section](https://github.com/dmacvicar/terraform-provider-libvirt/releases) on Github. To install it, refer to the [Terraform documentation](https://www.terraform.io/docs/cli/config/config-file.html#provider-installation).
|
||||
|
||||
## Building from source
|
||||
|
||||
- [Go](https://golang.org/doc/install) is required for building.
|
||||
|
||||
```bash
|
||||
git clone https://github.com/dmacvicar/terraform-provider-libvirt.git
|
||||
cd terraform-provider-libvirt
|
||||
make
|
||||
```
|
||||
|
||||
The binary will be called `terraform-provider-libvirt`.
|
||||
|
||||
### Using multiple hypervisors / provider instances
|
||||
|
||||
You can target different libvirt hosts instantiating the [provider multiple times](https://www.terraform.io/docs/configuration/providers.html#multiple-provider-instances). [Example](examples/v0.12/multiple).
|
||||
|
||||
### Using qemu-agent
|
||||
|
||||
From its documentation, [qemu-agent](https://wiki.libvirt.org/page/Qemu_guest_agent):
|
||||
|
||||
>It is a daemon program running inside the domain which is supposed to help management applications with executing functions which need assistance of the guest OS.
|
||||
|
||||
Until terraform-provider-libvirt 0.4.2, qemu-agent was used by default to get network configuration. However, if qemu-agent is not running, this creates a delay until connecting to it times-out.
|
||||
|
||||
In current versions, we default to not to attempt connecting to it, and attempting to retrieve network interface information from the agent needs to be enabled explicitly with `qemu_agent = true`, further details [here](https://github.com/dmacvicar/terraform-provider-libvirt/blob/master/website/docs/r/domain.html.markdown). Note that you still need to make sure the agent is running in the OS, and that is unrelated to this option.
|
||||
|
||||
Note: when using bridge network configurations you need to enable the `qemu_agent = true`. otherwise you will not retrieve the ip addresses of domains.
|
||||
|
||||
Be aware that this variables may be subject to change again in future versions.
|
||||
|
||||
## Upstream projects using terraform-libvirt:
|
||||
|
||||
* [sumaform](https://github.com/moio/sumaform)
|
||||
sumaform is a way to quickly configure, deploy, test [Uyuni](https://www.uyuni-project.org/) and [SUSE Manager](https://www.suse.com/products/suse-manager/) setups with clients and servers.
|
||||
|
||||
* [ha-cluster-sap](https://github.com/SUSE/ha-sap-terraform-deployments)
|
||||
Automated HA and SAP Deployments in Public/Private Clouds (including Libvirt/KVM)
|
||||
|
||||
* [ceph-open-terrarium](https://github.com/MalloZup/ceph-open-terrarium)
|
||||
ceph-open-terrarium is a way to quickly configure, deploy, tests CEPH cluster without or with [Deepsea](https://github.com/SUSE/DeepSea)
|
||||
|
||||
* [kubic](https://github.com/kubic-project)
|
||||
* [kubic-terraform-kvm](https://github.com/kubic-project/kubic-terraform-kvm) Kubic Terraform script using KVM/libvirt
|
||||
|
||||
* [Community Driven Docker Examples](contrib/)
|
||||
Docker examples showing how to use the Libvirt Provider
|
||||
|
||||
* [Openshift 4 Installer](https://github.com/openshift/installer)
|
||||
The Openshift 4 Installer uses Terraform for cluster orchestration and relies on terraform-provider-libvirt for
|
||||
libvirt platform.
|
||||
|
||||
* [Kubitect](https://github.com/MusicDin/kubitect) - a CLI tool for deploying and managing Kubernetes clusters on libvirt platform.
|
||||
|
||||
## Authors
|
||||
|
||||
* Duncan Mac-Vicar P. <duncan@mac-vicar.eu>
|
||||
|
||||
See also the list of [contributors](https://github.com/dmacvicar/terraform-provider-libvirt/graphs/contributors) who participated in this project.
|
||||
|
||||
The structure and boilerplate is inspired from the [Softlayer](https://github.com/finn-no/terraform-provider-softlayer) and [Google](https://github.com/terraform-providers/terraform-provider-google) Terraform provider sources.
|
||||
|
||||
## License
|
||||
|
||||
* Apache 2.0, See LICENSE file
|
||||
Binary file not shown.
2
archive/1-coreos/2-install-coreos/knownhosts
Normal file
2
archive/1-coreos/2-install-coreos/knownhosts
Normal file
@@ -0,0 +1,2 @@
|
||||
unraid.othrayte.one ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAqk9L+GExUj58HEBBz9cTQ4BreTh01Nc0Nt2zqJqx/F
|
||||
betelgeuse-seven-unraid ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAqk9L+GExUj58HEBBz9cTQ4BreTh01Nc0Nt2zqJqx/F
|
||||
BIN
archive/1-coreos/2-install-coreos/plan.tfplan
Normal file
BIN
archive/1-coreos/2-install-coreos/plan.tfplan
Normal file
Binary file not shown.
3
archive/1-coreos/2-install-coreos/readme-new.md
Normal file
3
archive/1-coreos/2-install-coreos/readme-new.md
Normal file
@@ -0,0 +1,3 @@
|
||||
`terraform init`
|
||||
`terraform plan --out plan.tfplan`
|
||||
`terraform apply plan.tfplan`
|
||||
33
archive/1-coreos/2-install-coreos/readme.md
Normal file
33
archive/1-coreos/2-install-coreos/readme.md
Normal file
@@ -0,0 +1,33 @@
|
||||
1. Download CoreOS "Live DVD" iso from https://fedoraproject.org/coreos/download?stream=stable#baremetal
|
||||
For archival and for use in unraid these are stored at smb://betelgeuse-seven-unraid.local/isos
|
||||
2. Boot ISO
|
||||
On unraid
|
||||
1. **VMS > ADD VM > Linux/CoreOS**
|
||||
2. Set **OS Install ISO** to downloaded iso
|
||||
3. Choose **Primary vDisk Size**, say 10GB (they recommend 8GiB min but 8GB is less than that)
|
||||
3. Connect
|
||||
On unraid: **VMS > (VM Icon, left click) > VM Console(VNC)**
|
||||
4. Identify disk to install to
|
||||
`sudo vdisk -l`, on unraid this was /dev/vda
|
||||
5. Host the ignition file for the installer to see
|
||||
Run `python3 -m http.server 8080` (from the folder with the ignition files)
|
||||
6. Install CoreOS
|
||||
1. Get the OS on disk for tshe first time
|
||||
`sudo coreos-installer install /dev/vda --insecure-ignition --ignition-url http://192.168.1.115:8080/jaglan-beta-m42.ign`
|
||||
2. Reboot to injest ignition file and provision
|
||||
`sudo reboot`
|
||||
ssh should now work with the user's ssh keys from ignition file
|
||||
3. Wait, the initial service will install the hashistack and reboot again
|
||||
4. Repeat for m41 and m40.
|
||||
|
||||
7. Boostrapping the consul cluster
|
||||
1. Run `consul agent -bootstrap-expect 1 -bind 192.168.1.115 -ui -config-file ./etc/consul.d/consul.hcl` locally
|
||||
2. Check the ui at http://localhost:8500/ui to ensure that the expected nodes are shown
|
||||
8. Boostrapping the nomad cluster
|
||||
1. Run `nomad agent -bootstrap-expect 1 -config ./etc/nomad.d/nomad.hcl` locally
|
||||
2. Check the ui at http://localhost:4646/ui to ensure that the expected nodes are shown
|
||||
|
||||
# Useful Debugging Commands
|
||||
`sudo systemctl start consul`
|
||||
Read consul startup logs: `sudo journalctl -xeu consul.service`
|
||||
Start the consul UI locally: `consul agent -bind 192.168.1.115 -ui -config-file ./etc/consul.d/consul.hcl`
|
||||
161
archive/1-coreos/2-install-coreos/terraform.tfstate
Normal file
161
archive/1-coreos/2-install-coreos/terraform.tfstate
Normal file
@@ -0,0 +1,161 @@
|
||||
{
|
||||
"version": 4,
|
||||
"terraform_version": "1.6.4",
|
||||
"serial": 79,
|
||||
"lineage": "afff4b50-12a8-b1b7-406b-2f1a49714357",
|
||||
"outputs": {},
|
||||
"resources": [
|
||||
{
|
||||
"mode": "managed",
|
||||
"type": "libvirt_domain",
|
||||
"name": "default",
|
||||
"provider": "provider[\"registry.terraform.io/dmacvicar/libvirt\"]",
|
||||
"instances": [
|
||||
{
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"arch": "x86_64",
|
||||
"autostart": false,
|
||||
"boot_device": [
|
||||
{
|
||||
"dev": [
|
||||
"hd"
|
||||
]
|
||||
}
|
||||
],
|
||||
"cloudinit": null,
|
||||
"cmdline": null,
|
||||
"console": [],
|
||||
"coreos_ignition": null,
|
||||
"cpu": [
|
||||
{
|
||||
"mode": "custom"
|
||||
}
|
||||
],
|
||||
"description": "v0.3",
|
||||
"disk": [
|
||||
{
|
||||
"block_device": "",
|
||||
"file": "",
|
||||
"scsi": false,
|
||||
"url": "",
|
||||
"volume_id": "/mnt/user/domains/terraform/test.qcow2",
|
||||
"wwn": ""
|
||||
}
|
||||
],
|
||||
"emulator": "/usr/bin/qemu-system-x86_64",
|
||||
"filesystem": [],
|
||||
"firmware": null,
|
||||
"fw_cfg_name": "opt/com.coreos/config",
|
||||
"graphics": [],
|
||||
"id": "97fed2be-7162-4fea-8d7e-2d7cc35e8010",
|
||||
"initrd": "",
|
||||
"kernel": "",
|
||||
"machine": "pc",
|
||||
"memory": 1024,
|
||||
"metadata": null,
|
||||
"name": "test",
|
||||
"network_interface": [],
|
||||
"nvram": [],
|
||||
"qemu_agent": false,
|
||||
"running": true,
|
||||
"timeouts": null,
|
||||
"tpm": [],
|
||||
"type": "kvm",
|
||||
"vcpu": 1,
|
||||
"video": [],
|
||||
"xml": []
|
||||
},
|
||||
"sensitive_attributes": [],
|
||||
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjozMDAwMDAwMDAwMDB9fQ==",
|
||||
"dependencies": [
|
||||
"libvirt_pool.terraform",
|
||||
"libvirt_volume.default",
|
||||
"libvirt_volume.fedora-coreos-39"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"mode": "managed",
|
||||
"type": "libvirt_pool",
|
||||
"name": "terraform",
|
||||
"provider": "provider[\"registry.terraform.io/dmacvicar/libvirt\"]",
|
||||
"instances": [
|
||||
{
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"allocation": 122744135680,
|
||||
"available": 1877653749760,
|
||||
"capacity": 2000397885440,
|
||||
"id": "488a381a-3940-43fe-936e-4d0f80c4e9cf",
|
||||
"name": "terraform",
|
||||
"path": "/mnt/user/domains/terraform",
|
||||
"type": "dir",
|
||||
"xml": []
|
||||
},
|
||||
"sensitive_attributes": [],
|
||||
"private": "bnVsbA=="
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"mode": "managed",
|
||||
"type": "libvirt_volume",
|
||||
"name": "default",
|
||||
"provider": "provider[\"registry.terraform.io/dmacvicar/libvirt\"]",
|
||||
"instances": [
|
||||
{
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"base_volume_id": "/mnt/user/domains/terraform/fedora-coreos-39.20231119.3.0-qemu.qcow2",
|
||||
"base_volume_name": null,
|
||||
"base_volume_pool": null,
|
||||
"format": "qcow2",
|
||||
"id": "/mnt/user/domains/terraform/test.qcow2",
|
||||
"name": "test.qcow2",
|
||||
"pool": "terraform",
|
||||
"size": 10737418240,
|
||||
"source": null,
|
||||
"xml": []
|
||||
},
|
||||
"sensitive_attributes": [],
|
||||
"private": "bnVsbA==",
|
||||
"dependencies": [
|
||||
"libvirt_pool.terraform",
|
||||
"libvirt_volume.fedora-coreos-39"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"mode": "managed",
|
||||
"type": "libvirt_volume",
|
||||
"name": "fedora-coreos-39",
|
||||
"provider": "provider[\"registry.terraform.io/dmacvicar/libvirt\"]",
|
||||
"instances": [
|
||||
{
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"base_volume_id": null,
|
||||
"base_volume_name": null,
|
||||
"base_volume_pool": null,
|
||||
"format": "raw",
|
||||
"id": "/mnt/user/domains/terraform/fedora-coreos-39.20231119.3.0-qemu.qcow2",
|
||||
"name": "fedora-coreos-39.20231119.3.0-qemu.qcow2",
|
||||
"pool": "terraform",
|
||||
"size": 689573964,
|
||||
"source": "https://builds.coreos.fedoraproject.org/prod/streams/stable/builds/39.20231119.3.0/x86_64/fedora-coreos-39.20231119.3.0-qemu.x86_64.qcow2.xz",
|
||||
"xml": []
|
||||
},
|
||||
"sensitive_attributes": [],
|
||||
"private": "bnVsbA==",
|
||||
"dependencies": [
|
||||
"libvirt_pool.terraform"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"check_results": null
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"version": 4,
|
||||
"terraform_version": "1.6.4",
|
||||
"serial": 74,
|
||||
"lineage": "afff4b50-12a8-b1b7-406b-2f1a49714357",
|
||||
"outputs": {},
|
||||
"resources": [],
|
||||
"check_results": null
|
||||
}
|
||||
55
archive/1-coreos/2-install-coreos/vm-test-moons.tf
Normal file
55
archive/1-coreos/2-install-coreos/vm-test-moons.tf
Normal file
@@ -0,0 +1,55 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
libvirt = {
|
||||
source = "dmacvicar/libvirt"
|
||||
version = "0.7.6"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
provider "libvirt" {
|
||||
uri = "qemu+ssh://root@betelgeuse-seven-unraid/system?&known_hosts_verify=ignore"
|
||||
}
|
||||
|
||||
resource "libvirt_pool" "terraform" {
|
||||
name = "terraform"
|
||||
type = "dir"
|
||||
path = "/mnt/user/domains/terraform"
|
||||
}
|
||||
|
||||
# resource "libvirt_ignition" "ignition" {
|
||||
# name = "example.ign"
|
||||
# content = "../1-prepare-ignition-files/jaglan-beta-m40.ign"
|
||||
# }
|
||||
|
||||
resource "libvirt_volume" "fedora-coreos-39" {
|
||||
name = "fedora-coreos-39.20231119.3.0-qemu.qcow2"
|
||||
pool = libvirt_pool.terraform.name
|
||||
source = "https://builds.coreos.fedoraproject.org/prod/streams/stable/builds/39.20231119.3.0/x86_64/fedora-coreos-39.20231119.3.0-qemu.x86_64.qcow2.xz"
|
||||
}
|
||||
|
||||
resource "libvirt_volume" "default" {
|
||||
name = "test.qcow2"
|
||||
pool = libvirt_pool.terraform.name
|
||||
size = 10737418240 #10G
|
||||
base_volume_id = libvirt_volume.fedora-coreos-39.id
|
||||
}
|
||||
|
||||
resource "libvirt_domain" "default" {
|
||||
name = "test"
|
||||
description = "v0.3"
|
||||
vcpu = 1
|
||||
memory = 1024
|
||||
#coreos_ignition = libvirt_ignition.ignition.id
|
||||
disk {
|
||||
volume_id = libvirt_volume.default.id
|
||||
}
|
||||
# disk {
|
||||
# file = "/mnt/user/isos/fedora-coreos-39.20231119.3.0-qemu.x86_64.qcow2"
|
||||
# }
|
||||
# boot_device {
|
||||
# dev = [ "hd"
|
||||
# #, "cdrom"
|
||||
# ]
|
||||
# }
|
||||
}
|
||||
Reference in New Issue
Block a user