Switch from coreos to nixos

This commit is contained in:
2025-04-25 15:08:56 +10:00
parent 472b198618
commit 793d77dce9
51 changed files with 2874 additions and 5 deletions

35
.gitignore vendored Normal file
View File

@@ -0,0 +1,35 @@
### Terraform ###
# Local .terraform directories
**/.terraform/*
# .tfstate files
*.tfstate
*.tfstate.*
# Crash log files
crash.log
crash.*.log
# Exclude all .tfvars files, which are likely to contain sensitive data, such as
# password, private keys, and other secrets. These should not be part of version
# control as they are data points which are potentially sensitive and subject
# to change depending on the environment.
*.tfvars
*.tfvars.json
# Ignore override files as they are usually used to override resources locally and so
# are not checked in
override.tf
override.tf.json
*_override.tf
*_override.tf.json
# Include override files you do wish to add to version control using negated pattern
# !example_override.tf
# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
# example: *tfplan*
# Ignore CLI configuration files
.terraformrc
terraform.rc

33
0-hardware/servernames.md Normal file
View File

@@ -0,0 +1,33 @@
# Server Names
From https://namingschemes.com/Hitchhikers_Guide_Planets.
Was [google sheet](https://docs.google.com/spreadsheets/d/1aLb14nme9gprYzWOEo5IadG1vKEtf8VQk0tkCBGz9KA/edit#gid=0).
| Name | Hostname | Use |
| ---------------------- | ----------------------- | ------------------------------------------------------------- |
| Antares | antares-win | Win11 PC |
| Barteldan | barteldan-linux | Fedora Linux PC |
| Betelgeuse Seven | betelgeuse-seven-unraid | Unraid Storage Host |
| Bethselamin | | |
| Damogran | | |
| Eadrax | | |
| Earth | | Home Assistant Server? |
| Eroticon 6 | | |
| Frogstar A & B | | |
| Golgafrincham | | |
| Han Wavel | | |
| Jaglan Beta | | Compute Cluster Hosts |
| - Moon 1 | jaglan-beta-m01 | NUC Cluster Host<br>(Intel \| N5105 [4/4], 16GB ram, 1TB SSD) |
| - Moon 42 (Test moon) | jaglan-beta-m42 | Test server (VM) |
| Krikkit | | |
| Lamuella | | |
| Magrathea | | |
| Maximegalon | | |
| Oglarun | | |
| Rupert (Persephone) | | |
| Saqua Pilia Hensha | | |
| Ursa Minor Beta | | |
| Viltvodl VI | | |
| Vogosphere | | |
| Ysolldins | | |
| | | |

40
1-nixos-node/.terraform.lock.hcl generated Normal file
View File

@@ -0,0 +1,40 @@
# This file is maintained automatically by "terraform init".
# Manual edits may be lost in future updates.
provider "registry.terraform.io/hashicorp/null" {
version = "3.2.1"
constraints = "3.2.1"
hashes = [
"h1:FbGfc+muBsC17Ohy5g806iuI1hQc4SIexpYCrQHQd8w=",
"zh:58ed64389620cc7b82f01332e27723856422820cfd302e304b5f6c3436fb9840",
"zh:62a5cc82c3b2ddef7ef3a6f2fedb7b9b3deff4ab7b414938b08e51d6e8be87cb",
"zh:63cff4de03af983175a7e37e52d4bd89d990be256b16b5c7f919aff5ad485aa5",
"zh:74cb22c6700e48486b7cabefa10b33b801dfcab56f1a6ac9b6624531f3d36ea3",
"zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3",
"zh:79e553aff77f1cfa9012a2218b8238dd672ea5e1b2924775ac9ac24d2a75c238",
"zh:a1e06ddda0b5ac48f7e7c7d59e1ab5a4073bbcf876c73c0299e4610ed53859dc",
"zh:c37a97090f1a82222925d45d84483b2aa702ef7ab66532af6cbcfb567818b970",
"zh:e4453fbebf90c53ca3323a92e7ca0f9961427d2f0ce0d2b65523cc04d5d999c2",
"zh:e80a746921946d8b6761e77305b752ad188da60688cfd2059322875d363be5f5",
"zh:fbdb892d9822ed0e4cb60f2fedbdbb556e4da0d88d3b942ae963ed6ff091e48f",
"zh:fca01a623d90d0cad0843102f9b8b9fe0d3ff8244593bd817f126582b52dd694",
]
}
provider "registry.terraform.io/hashicorp/template" {
version = "2.2.0"
constraints = "2.2.0"
hashes = [
"h1:94qn780bi1qjrbC3uQtjJh3Wkfwd5+tTtJHOb7KTg9w=",
"zh:01702196f0a0492ec07917db7aaa595843d8f171dc195f4c988d2ffca2a06386",
"zh:09aae3da826ba3d7df69efeb25d146a1de0d03e951d35019a0f80e4f58c89b53",
"zh:09ba83c0625b6fe0a954da6fbd0c355ac0b7f07f86c91a2a97849140fea49603",
"zh:0e3a6c8e16f17f19010accd0844187d524580d9fdb0731f675ffcf4afba03d16",
"zh:45f2c594b6f2f34ea663704cc72048b212fe7d16fb4cfd959365fa997228a776",
"zh:77ea3e5a0446784d77114b5e851c970a3dde1e08fa6de38210b8385d7605d451",
"zh:8a154388f3708e3df5a69122a23bdfaf760a523788a5081976b3d5616f7d30ae",
"zh:992843002f2db5a11e626b3fc23dc0c87ad3729b3b3cff08e32ffb3df97edbde",
"zh:ad906f4cebd3ec5e43d5cd6dc8f4c5c9cc3b33d2243c89c5fc18f97f7277b51d",
"zh:c979425ddb256511137ecd093e23283234da0154b7fa8b21c2687182d9aea8b2",
]
}

View File

@@ -0,0 +1,8 @@
Follow steps at https://nixos.org/manual/nixos/stable/#sec-installation-manual-summary
Ensure that ssh is enabled and the hostname is set
```
services.openssh.enable = true;
services.openssh.settings.PermitRootLogin = "yes";
networking.hostName = "jaglan-beta-m01";
```

View File

@@ -0,0 +1,72 @@
{ config, lib, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
nixpkgs.config.allowUnfree = true;
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "jaglan-beta-m01"; # Define your hostname.
time.timeZone = "Australia/Melbourne";
# List packages installed in system profile. To search, run:
# $ nix search wget
# environment.systemPackages = with pkgs; [
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
# wget
# ];
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
# List services that you want to enable:
services = {
tailscale.enable = true;
nomad = {
enable = true;
enableDocker = true;
dropPrivileges = false;
settings = {
server = {
enabled = true;
bootstrap_expect = 1;
};
client = {
enabled = true;
};
};
};
openssh = {
enable = true;
settings.PermitRootLogin = "yes";
};
};
# Fix issue where nomad needs alloc_mounts to be writable
systemd.tmpfiles.rules = [
"d /var/lib/alloc_mounts 0755 root root -"
];
# Open ports in the firewall. 464X are the default ports for Nomad.
networking.firewall.allowedTCPPorts = [ 4646 4647 4648 ];
# Copy the NixOS configuration file and link it from the resulting system
# (/run/current-system/configuration.nix). This is useful in case you
# accidentally delete configuration.nix.
system.copySystemConfiguration = true;
# Defines the initial NixOS version for compatibility with older application data.
# Do NOT change this value after installation without careful consideration.
system.stateVersion = "24.11"; # Did you read the comment?
}

44
1-nixos-node/node.tf Normal file
View File

@@ -0,0 +1,44 @@
terraform {
required_providers {
null = {
source = "hashicorp/null"
version = "3.2.1"
}
template = {
source = "hashicorp/template"
version = "2.2.0"
}
}
}
provider "template" {}
variable "ssh_password" {
description = "Password for SSH connection"
type = string
}
resource "null_resource" "deploy_nixos" {
connection {
type = "ssh"
host = "jaglan-beta-m01"
user = "root"
password = var.ssh_password
}
provisioner "file" {
source = "configuration.nix"
destination = "/tmp/configuration.nix"
}
provisioner "remote-exec" {
inline = [
"mv /tmp/configuration.nix /etc/nixos/configuration.nix",
"nixos-rebuild switch --use-remote-sudo"
]
}
triggers = {
configuration_content = file("configuration.nix")
}
}

View File

@@ -0,0 +1,28 @@
{
"version": 4,
"terraform_version": "1.11.4",
"serial": 19,
"lineage": "db7dcf21-a255-0ec4-c8b8-d4a7559b3768",
"outputs": {},
"resources": [
{
"mode": "managed",
"type": "null_resource",
"name": "deploy_nixos",
"provider": "provider[\"registry.terraform.io/hashicorp/null\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"id": "2789544025373353248",
"triggers": {
"configuration_content": "{ config, lib, pkgs, ... }:\n{\n imports =\n [ # Include the results of the hardware scan.\n ./hardware-configuration.nix\n ];\n\n nixpkgs.config.allowUnfree = true;\n\n # Use the systemd-boot EFI boot loader.\n boot.loader.systemd-boot.enable = true;\n boot.loader.efi.canTouchEfiVariables = true;\n\n networking.hostName = \"jaglan-beta-m01\"; # Define your hostname.\n\n time.timeZone = \"Australia/Melbourne\";\n\n # List packages installed in system profile. To search, run:\n # $ nix search wget\n # environment.systemPackages = with pkgs; [\n # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.\n # wget\n # ];\n\n # Some programs need SUID wrappers, can be configured further or are\n # started in user sessions.\n # programs.mtr.enable = true;\n # programs.gnupg.agent = {\n # enable = true;\n # enableSSHSupport = true;\n # };\n\n # List services that you want to enable:\n services = {\n tailscale.enable = true;\n nomad = {\n enable = true;\n enableDocker = true;\n dropPrivileges = false;\n settings = {\n server = {\n enabled = true;\n bootstrap_expect = 1;\n };\n client = {\n enabled = true;\n };\n };\n };\n openssh = {\n enable = true;\n settings.PermitRootLogin = \"yes\";\n };\n };\n\n # Fix issue where nomad needs alloc_mounts to be writable\n systemd.tmpfiles.rules = [\n \"d /var/lib/alloc_mounts 0755 root root -\"\n ];\n\n # Open ports in the firewall. 464X are the default ports for Nomad.\n networking.firewall.allowedTCPPorts = [ 4646 4647 4648 ];\n\n # Copy the NixOS configuration file and link it from the resulting system\n # (/run/current-system/configuration.nix). This is useful in case you\n # accidentally delete configuration.nix.\n system.copySystemConfiguration = true;\n\n # Defines the initial NixOS version for compatibility with older application data.\n # Do NOT change this value after installation without careful consideration.\n system.stateVersion = \"24.11\"; # Did you read the comment?\n}\n"
}
},
"sensitive_attributes": []
}
]
}
],
"check_results": null
}

View File

@@ -0,0 +1,28 @@
{
"version": 4,
"terraform_version": "1.11.4",
"serial": 16,
"lineage": "db7dcf21-a255-0ec4-c8b8-d4a7559b3768",
"outputs": {},
"resources": [
{
"mode": "managed",
"type": "null_resource",
"name": "deploy_nixos",
"provider": "provider[\"registry.terraform.io/hashicorp/null\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"id": "3103386327037898205",
"triggers": {
"configuration_content": "{ config, lib, pkgs, ... }:\n{\n imports =\n [ # Include the results of the hardware scan.\n ./hardware-configuration.nix\n ];\n\n nixpkgs.config.allowUnfree = true;\n\n # Use the systemd-boot EFI boot loader.\n boot.loader.systemd-boot.enable = true;\n boot.loader.efi.canTouchEfiVariables = true;\n\n networking.hostName = \"jaglan-beta-m01\"; # Define your hostname.\n\n time.timeZone = \"Australia/Melbourne\";\n\n # List packages installed in system profile. To search, run:\n # $ nix search wget\n # environment.systemPackages = with pkgs; [\n # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.\n # wget\n # ];\n\n # Some programs need SUID wrappers, can be configured further or are\n # started in user sessions.\n # programs.mtr.enable = true;\n # programs.gnupg.agent = {\n # enable = true;\n # enableSSHSupport = true;\n # };\n\n # List services that you want to enable:\n\n services.tailscale.enable = true;\n services.nomad = {\n enable = true;\n enableDocker = true;\n dropPrivileges = false;\n settings = {\n server = {\n enabled = true;\n bootstrap_expect = 1;\n };\n client = {\n enabled = true;\n };\n };\n };\n # Fix issue where nomad needs alloc_mounts to be writable\n systemd.tmpfiles.rules = [\n \"d /var/lib/alloc_mounts 0755 root root -\"\n ];\n\n # Enable the OpenSSH daemon.\n services.openssh.enable = true;\n services.openssh.settings.PermitRootLogin = \"yes\";\n\n # Open ports in the firewall. 464X are the default ports for Nomad.\n networking.firewall.allowedTCPPorts = [ 4646 4647 4648 ];\n\n # Copy the NixOS configuration file and link it from the resulting system\n # (/run/current-system/configuration.nix). This is useful in case you\n # accidentally delete configuration.nix.\n system.copySystemConfiguration = true;\n\n # Defines the initial NixOS version for compatibility with older application data.\n # Do NOT change this value after installation without careful consideration.\n system.stateVersion = \"24.11\"; # Did you read the comment?\n}\n"
}
},
"sensitive_attributes": []
}
]
}
],
"check_results": null
}

21
2-nomad-config/.terraform.lock.hcl generated Normal file
View File

@@ -0,0 +1,21 @@
# This file is maintained automatically by "terraform init".
# Manual edits may be lost in future updates.
provider "registry.terraform.io/hashicorp/nomad" {
version = "2.5.0"
hashes = [
"h1:zr1KDIeeA9cxolDHGE82niSUN4kxkjWBe8pznxKzkJI=",
"zh:2085ecdcc13f5578acae02ab1ab22dc309c7225434bccfacaf23c97c4e197f17",
"zh:519dcd34b830c89f3542715d8ca02b07c39de12fa3ec3b912961713e6beba740",
"zh:621c3a6e6c26030c50b3f3cbfb6dbac5c6a692dff832b1df9e047692377d4ff4",
"zh:6b2fffc8518796fdcca1b8c18764355fe6e319ead84220d2928c0f1a707b6e9b",
"zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3",
"zh:7bd308a8b8f2d75660fbbbc8e983cb987c6a4f7c08768b06f31e65cc42c02a8f",
"zh:b43e43f4de2d6918aac2fe3a5a404bfce4090326c42fffbe0979bae8b4507f67",
"zh:d83b6b47d4fb824525f3682180bcf8a3b5dfd0d713ee1dfc7eb48b37048d71a9",
"zh:e88150c86a8bab8d4aeb37ea0758d00f34ed5aa4b972a340f8b7685393c528b0",
"zh:e8b056989c1e7dc909b00a48eee6937f6de467ffb26c7377881a68360761333e",
"zh:f0952e0eb355afe5b2c45fecaa2ac450295e83e79da17100dd186edff5609fde",
"zh:fc124930226497fa24b8d16361d619e5a13495918b737807497d65a3249ec4ca",
]
}

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,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,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.

66
2-nomad-config/job.hcl Normal file
View File

@@ -0,0 +1,66 @@
job "hello-world" {
# Specifies the datacenter where this job should be run
# This can be omitted and it will default to ["*"]
datacenters = ["*"]
meta {
# User-defined key/value pairs that can be used in your jobs.
# You can also use this meta block within Group and Task levels.
foo = "bar"
}
# A group defines a series of tasks that should be co-located
# on the same client (host). All tasks within a group will be
# placed on the same host.
group "servers" {
# Specifies the number of instances of this group that should be running.
# Use this to scale or parallelize your job.
# This can be omitted and it will default to 1.
count = 1
network {
port "www" {
to = 8001
}
}
service {
provider = "nomad"
port = "www"
}
# Tasks are individual units of work that are run by Nomad.
task "web" {
# This particular task starts a simple web server within a Docker container
driver = "docker"
config {
image = "busybox:1"
command = "httpd"
args = ["-v", "-f", "-p", "$${NOMAD_PORT_www}", "-h", "/local"]
ports = ["www"]
}
template {
data = <<-EOF
<h1>Hello, Nomad!</h1>
<ul>
<li>Task: {{env "NOMAD_TASK_NAME"}}</li>
<li>Group: {{env "NOMAD_GROUP_NAME"}}</li>
<li>Job: {{env "NOMAD_JOB_NAME"}}</li>
<li>Metadata value for foo: {{env "NOMAD_META_foo"}}</li>
<li>Currently running on port: {{env "NOMAD_PORT_www"}}</li>
</ul>
EOF
destination = "local/index.html"
}
# Specify the maximum resources required to run the task
resources {
cpu = 50
memory = 64
}
}
}
}

View File

@@ -0,0 +1,57 @@
provider "nomad" {
# For some reason nomad is binding to the tailscale IP but not the (local) IP that we get for the same hostname
address = "http://jaglan-beta-m01:4646"
}
# Define a Nomad job for a Hello World service
resource "nomad_job" "app" {
jobspec = <<EOT
job "hello-world" {
group "servers" {
network {
port "www" {
to = 8002
}
}
service {
provider = "nomad"
port = "www"
}
# Tasks are individual units of work that are run by Nomad.
task "web" {
# This particular task starts a simple web server within a Docker container
driver = "docker"
config {
image = "busybox:1"
command = "httpd"
args = ["-v", "-f", "-p", "$${NOMAD_PORT_www}", "-h", "/local"]
ports = ["www"]
}
template {
data = <<-EOF
<h1>Hello, Nomad!</h1>
<ul>
<li>Task: {{env "NOMAD_TASK_NAME"}}</li>
<li>Group: {{env "NOMAD_GROUP_NAME"}}</li>
<li>Job: {{env "NOMAD_JOB_NAME"}}</li>
<li>Metadata value for foo: {{env "NOMAD_META_foo"}}</li>
<li>Currently running on port: {{env "NOMAD_PORT_www"}}</li>
</ul>
EOF
destination = "local/index.html"
}
# Specify the maximum resources required to run the task
resources {
cpu = 50
memory = 64
}
}
}
}
EOT
}

View File

@@ -0,0 +1,63 @@
{
"version": 4,
"terraform_version": "1.11.4",
"serial": 13,
"lineage": "15e0900c-88bc-9754-4600-e3977d018ba0",
"outputs": {},
"resources": [
{
"mode": "managed",
"type": "nomad_job",
"name": "app",
"provider": "provider[\"registry.terraform.io/hashicorp/nomad\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"allocation_ids": [],
"datacenters": [],
"deployment_id": null,
"deployment_status": null,
"deregister_on_destroy": true,
"deregister_on_id_change": true,
"detach": true,
"hcl2": [],
"id": "hello-world",
"jobspec": "job \"hello-world\" {\n group \"servers\" {\n network {\n port \"www\" {\n to = 8002\n }\n }\n\n service {\n provider = \"nomad\"\n port = \"www\"\n }\n\n # Tasks are individual units of work that are run by Nomad.\n task \"web\" {\n # This particular task starts a simple web server within a Docker container\n driver = \"docker\"\n\n config {\n image = \"busybox:1\"\n command = \"httpd\"\n args = [\"-v\", \"-f\", \"-p\", \"${NOMAD_PORT_www}\", \"-h\", \"/local\"]\n ports = [\"www\"]\n }\n\n template {\n data = \u003c\u003c-EOF\n \u003ch1\u003eHello, Nomad!\u003c/h1\u003e\n \u003cul\u003e\n \u003cli\u003eTask: {{env \"NOMAD_TASK_NAME\"}}\u003c/li\u003e\n \u003cli\u003eGroup: {{env \"NOMAD_GROUP_NAME\"}}\u003c/li\u003e\n \u003cli\u003eJob: {{env \"NOMAD_JOB_NAME\"}}\u003c/li\u003e\n \u003cli\u003eMetadata value for foo: {{env \"NOMAD_META_foo\"}}\u003c/li\u003e\n \u003cli\u003eCurrently running on port: {{env \"NOMAD_PORT_www\"}}\u003c/li\u003e\n \u003c/ul\u003e\n EOF\n destination = \"local/index.html\"\n }\n\n # Specify the maximum resources required to run the task\n resources {\n cpu = 50\n memory = 64\n }\n }\n }\n}\n",
"json": null,
"modify_index": "1144",
"name": "hello-world",
"namespace": "default",
"policy_override": null,
"purge_on_destroy": null,
"read_allocation_ids": false,
"region": "global",
"rerun_if_dead": false,
"status": "running",
"task_groups": [
{
"count": 1,
"meta": {},
"name": "servers",
"task": [
{
"driver": "docker",
"meta": {},
"name": "web",
"volume_mounts": []
}
],
"volumes": []
}
],
"timeouts": null,
"type": "service"
},
"sensitive_attributes": [],
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjozMDAwMDAwMDAwMDAsInVwZGF0ZSI6MzAwMDAwMDAwMDAwfX0="
}
]
}
],
"check_results": null
}

View File

@@ -0,0 +1,65 @@
{
"version": 4,
"terraform_version": "1.11.4",
"serial": 11,
"lineage": "15e0900c-88bc-9754-4600-e3977d018ba0",
"outputs": {},
"resources": [
{
"mode": "managed",
"type": "nomad_job",
"name": "app",
"provider": "provider[\"registry.terraform.io/hashicorp/nomad\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"allocation_ids": [],
"datacenters": [
"*"
],
"deployment_id": null,
"deployment_status": null,
"deregister_on_destroy": true,
"deregister_on_id_change": true,
"detach": true,
"hcl2": [],
"id": "hello-world",
"jobspec": "job \"hello-world\" {\n # Specifies the datacenter where this job should be run\n # This can be omitted and it will default to [\"*\"]\n datacenters = [\"*\"]\n\n meta {\n # User-defined key/value pairs that can be used in your jobs.\n # You can also use this meta block within Group and Task levels.\n foo = \"bar\"\n }\n\n # A group defines a series of tasks that should be co-located\n # on the same client (host). All tasks within a group will be\n # placed on the same host.\n group \"servers\" {\n\n # Specifies the number of instances of this group that should be running.\n # Use this to scale or parallelize your job.\n # This can be omitted and it will default to 1.\n count = 1\n\n network {\n port \"www\" {\n to = 8002\n }\n }\n\n service {\n provider = \"nomad\"\n port = \"www\"\n }\n\n # Tasks are individual units of work that are run by Nomad.\n task \"web\" {\n # This particular task starts a simple web server within a Docker container\n driver = \"docker\"\n\n config {\n image = \"busybox:1\"\n command = \"httpd\"\n args = [\"-v\", \"-f\", \"-p\", \"${NOMAD_PORT_www}\", \"-h\", \"/local\"]\n ports = [\"www\"]\n }\n\n template {\n data = \u003c\u003c-EOF\n \u003ch1\u003eHello, Nomad!\u003c/h1\u003e\n \u003cul\u003e\n \u003cli\u003eTask: {{env \"NOMAD_TASK_NAME\"}}\u003c/li\u003e\n \u003cli\u003eGroup: {{env \"NOMAD_GROUP_NAME\"}}\u003c/li\u003e\n \u003cli\u003eJob: {{env \"NOMAD_JOB_NAME\"}}\u003c/li\u003e\n \u003cli\u003eMetadata value for foo: {{env \"NOMAD_META_foo\"}}\u003c/li\u003e\n \u003cli\u003eCurrently running on port: {{env \"NOMAD_PORT_www\"}}\u003c/li\u003e\n \u003c/ul\u003e\n EOF\n destination = \"local/index.html\"\n }\n\n # Specify the maximum resources required to run the task\n resources {\n cpu = 50\n memory = 64\n }\n }\n }\n}\n",
"json": null,
"modify_index": "1133",
"name": "hello-world",
"namespace": "default",
"policy_override": null,
"purge_on_destroy": null,
"read_allocation_ids": false,
"region": "global",
"rerun_if_dead": false,
"status": "pending",
"task_groups": [
{
"count": 1,
"meta": {},
"name": "servers",
"task": [
{
"driver": "docker",
"meta": {},
"name": "web",
"volume_mounts": null
}
],
"volumes": null
}
],
"timeouts": null,
"type": "service"
},
"sensitive_attributes": [],
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjozMDAwMDAwMDAwMDAsInVwZGF0ZSI6MzAwMDAwMDAwMDAwfX0="
}
]
}
],
"check_results": null
}

View File

@@ -0,0 +1,5 @@
#! /bin/sh
rpm -qa | grep -qw butane || dnf install butane
butane --pretty --strict jaglan-beta-m40.bu --files-dir . --output jaglan-beta-m40.ign
butane --pretty --strict jaglan-beta-m41.bu --files-dir . --output jaglan-beta-m41.ign
butane --pretty --strict jaglan-beta-m42.bu --files-dir . --output jaglan-beta-m42.ign

View File

@@ -1,5 +1,5 @@
datacenter = "jaglan-beta" datacenter = "jaglan-beta"
data_dir = "/opt/consul" data_dir = "/opt/consul"
encrypt = "5L5cOnGhQ63EUMqPtn4tYDb1XafmmbQx2n6WqPkqeFs=" # This is a secret that should be generated with `consul keygen` encrypt = "5L5cOnGhQ63EUMqPtn4tYDb1XafmmbQx2n6WqPkqeFs=" # This is a secret that should be generated with `consul keygen`
retry_join = ["jaglan-beta-m01", "jaglan-beta-m42"] retry_join = ["jaglan-beta-m01", "jaglan-beta-m40", "jaglan-beta-m41", "jaglan-beta-m42"]
server = true server = true

View File

@@ -0,0 +1,9 @@
datacenter = "jaglan-beta"
data_dir = "/opt/nomad/data"
client {
enabled = true
}
server {
enabled = true
}

View File

@@ -0,0 +1,56 @@
variant: fcos
version: 1.5.0
passwd:
users:
- name: core
ssh_authorized_keys:
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJwojmm5GUDQTt/ic1w3yf5c0fyiPqhy8D9Y4qMVljEA othrayte@gmail.com
# We need to make users for consul and nomad as we need them before their installed
- name: consul
no_create_home: true
- name: nomad
no_create_home: true
systemd:
units:
- name: rpm-ostree-install-hashistack.service
enabled: true
contents_local: /units/rpm-ostree-install-hashistack.service
storage:
files:
- path: /etc/hostname
mode: 0644
contents:
inline: jaglan-beta-m40
- path: /etc/yum.repos.d/hashicorp.repo
contents:
local: /etc/yum.repos.d/hashicorp.repo
mode: 0644
- path: /etc/consul.d/consul.hcl
contents:
local: /etc/consul.d/consul.hcl
mode: 0600
group:
name: consul
user:
name: consul
- path: /etc/nomad.d/nomad.hcl
contents:
local: /etc/nomad.d/nomad.hcl
mode: 0600
group:
name: nomad
user:
name: nomad
directories:
- path: /opt/consul
mode: 0700
user:
name: consul
group:
name: consul
- path: /opt/nomad/data
mode: 0700
user:
name: nomad
group:
name: nomad

View File

@@ -0,0 +1,102 @@
{
"ignition": {
"version": "3.4.0"
},
"passwd": {
"users": [
{
"name": "core",
"sshAuthorizedKeys": [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJwojmm5GUDQTt/ic1w3yf5c0fyiPqhy8D9Y4qMVljEA othrayte@gmail.com"
]
},
{
"name": "consul",
"noCreateHome": true
},
{
"name": "nomad",
"noCreateHome": true
}
]
},
"storage": {
"directories": [
{
"group": {
"name": "consul"
},
"path": "/opt/consul",
"user": {
"name": "consul"
},
"mode": 448
},
{
"group": {
"name": "nomad"
},
"path": "/opt/nomad/data",
"user": {
"name": "nomad"
},
"mode": 448
}
],
"files": [
{
"path": "/etc/hostname",
"contents": {
"compression": "",
"source": "data:,jaglan-beta-m40"
},
"mode": 420
},
{
"path": "/etc/yum.repos.d/hashicorp.repo",
"contents": {
"compression": "gzip",
"source": "data:;base64,H4sIAAAAAAAC/7SPPcvCQBCE+/sVKdIm+76tkN5eO7HYXMY7ydexuwr+e4kfZ2EjgtXOMvAMzy6yxqOfJe3dxCOa9fMvNsbtgKIqypYVLD66JZxkaKJZ0hWRpLEWDGCF1plU+3mkA7pZmMpHfYZQ5pDe0A7Tcrrm34UUfITv77HH5ZOJkIJzL4HKoPZmsYXaTxyWtWzw97XBNQAA//9Dsu7agQEAAA=="
},
"mode": 420
},
{
"group": {
"name": "consul"
},
"path": "/etc/consul.d/consul.hcl",
"user": {
"name": "consul"
},
"contents": {
"compression": "gzip",
"source": "data:;base64,H4sIAAAAAAAC/1SPPU/DMBRFd/+KK7NSlZa2WzY+FhCtBAKEUPviPGK3yXNjvwD596hhgfWc4d5TkZJjUU4oYPdUNySTkpWsOaltFUYxjUeduii5b6xhcWk46okv75buQW79ZnV5/XTfrVUW+npVzl7oo23LzfdcVs/d+tDxTS4szvDoQ0bIIGR2iRXqSZF97JsKJaNm4UTKFb6Ceux+J3HgoWbZmcSahu0+BkGBt793J+3FzJ7jP1rM7bvJnD7HOk09m58AAAD//+J027nwAAAA"
},
"mode": 384
},
{
"group": {
"name": "nomad"
},
"path": "/etc/nomad.d/nomad.hcl",
"user": {
"name": "nomad"
},
"contents": {
"compression": "gzip",
"source": "data:;base64,H4sIAAAAAAAC/2zJMQ7DIAwF0N2nsNgrTsBZKoO/KipqKtfNEuXuEZmzvqcS0mAB58LpLa8h9qgISbTqqf2KPL+RbX5E8+JE1EaHBe/EDJM6oFw4/A866Aff4Pd3BgAA///Bwum4cQAAAA=="
},
"mode": 384
}
]
},
"systemd": {
"units": [
{
"contents": "[Unit]\nDescription=Layer nomad \u0026 consul with rpm-ostree\nWants=network-online.target\nAfter=network-online.target\n# We run before `zincati.service` to avoid conflicting rpm-ostree\n# transactions.\nBefore=zincati.service\nConditionPathExists=!/var/lib/%N.stamp\n\n[Service]\nType=oneshot\nRemainAfterExit=yes\n# `--allow-inactive` ensures that rpm-ostree does not return an error\n# if the package is already installed. This is useful if the package is\n# added to the root image in a future Fedora CoreOS release as it will\n# prevent the service from failing.\nExecStart=/usr/bin/rpm-ostree install --apply-live --allow-inactive consul nomad\nExecStart=systemctl enable consul nomad\nExecStart=/bin/touch /var/lib/%N.stamp\nExecStart=systemctl reboot\n\n[Install]\nWantedBy=multi-user.target",
"enabled": true,
"name": "rpm-ostree-install-hashistack.service"
}
]
}
}

View File

@@ -0,0 +1,56 @@
variant: fcos
version: 1.5.0
passwd:
users:
- name: core
ssh_authorized_keys:
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJwojmm5GUDQTt/ic1w3yf5c0fyiPqhy8D9Y4qMVljEA othrayte@gmail.com
# We need to make users for consul and nomad as we need them before their installed
- name: consul
no_create_home: true
- name: nomad
no_create_home: true
systemd:
units:
- name: rpm-ostree-install-hashistack.service
enabled: true
contents_local: /units/rpm-ostree-install-hashistack.service
storage:
files:
- path: /etc/hostname
mode: 0644
contents:
inline: jaglan-beta-m41
- path: /etc/yum.repos.d/hashicorp.repo
contents:
local: /etc/yum.repos.d/hashicorp.repo
mode: 0644
- path: /etc/consul.d/consul.hcl
contents:
local: /etc/consul.d/consul.hcl
mode: 0600
group:
name: consul
user:
name: consul
- path: /etc/nomad.d/nomad.hcl
contents:
local: /etc/nomad.d/nomad.hcl
mode: 0600
group:
name: nomad
user:
name: nomad
directories:
- path: /opt/consul
mode: 0700
user:
name: consul
group:
name: consul
- path: /opt/nomad/data
mode: 0700
user:
name: nomad
group:
name: nomad

View File

@@ -0,0 +1,102 @@
{
"ignition": {
"version": "3.4.0"
},
"passwd": {
"users": [
{
"name": "core",
"sshAuthorizedKeys": [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJwojmm5GUDQTt/ic1w3yf5c0fyiPqhy8D9Y4qMVljEA othrayte@gmail.com"
]
},
{
"name": "consul",
"noCreateHome": true
},
{
"name": "nomad",
"noCreateHome": true
}
]
},
"storage": {
"directories": [
{
"group": {
"name": "consul"
},
"path": "/opt/consul",
"user": {
"name": "consul"
},
"mode": 448
},
{
"group": {
"name": "nomad"
},
"path": "/opt/nomad/data",
"user": {
"name": "nomad"
},
"mode": 448
}
],
"files": [
{
"path": "/etc/hostname",
"contents": {
"compression": "",
"source": "data:,jaglan-beta-m41"
},
"mode": 420
},
{
"path": "/etc/yum.repos.d/hashicorp.repo",
"contents": {
"compression": "gzip",
"source": "data:;base64,H4sIAAAAAAAC/7SPPcvCQBCE+/sVKdIm+76tkN5eO7HYXMY7ydexuwr+e4kfZ2EjgtXOMvAMzy6yxqOfJe3dxCOa9fMvNsbtgKIqypYVLD66JZxkaKJZ0hWRpLEWDGCF1plU+3mkA7pZmMpHfYZQ5pDe0A7Tcrrm34UUfITv77HH5ZOJkIJzL4HKoPZmsYXaTxyWtWzw97XBNQAA//9Dsu7agQEAAA=="
},
"mode": 420
},
{
"group": {
"name": "consul"
},
"path": "/etc/consul.d/consul.hcl",
"user": {
"name": "consul"
},
"contents": {
"compression": "gzip",
"source": "data:;base64,H4sIAAAAAAAC/1SPPU/DMBRFd/+KK7NSlZa2WzY+FhCtBAKEUPviPGK3yXNjvwD596hhgfWc4d5TkZJjUU4oYPdUNySTkpWsOaltFUYxjUeduii5b6xhcWk46okv75buQW79ZnV5/XTfrVUW+npVzl7oo23LzfdcVs/d+tDxTS4szvDoQ0bIIGR2iRXqSZF97JsKJaNm4UTKFb6Ceux+J3HgoWbZmcSahu0+BkGBt793J+3FzJ7jP1rM7bvJnD7HOk09m58AAAD//+J027nwAAAA"
},
"mode": 384
},
{
"group": {
"name": "nomad"
},
"path": "/etc/nomad.d/nomad.hcl",
"user": {
"name": "nomad"
},
"contents": {
"compression": "gzip",
"source": "data:;base64,H4sIAAAAAAAC/2zJMQ7DIAwF0N2nsNgrTsBZKoO/KipqKtfNEuXuEZmzvqcS0mAB58LpLa8h9qgISbTqqf2KPL+RbX5E8+JE1EaHBe/EDJM6oFw4/A866Aff4Pd3BgAA///Bwum4cQAAAA=="
},
"mode": 384
}
]
},
"systemd": {
"units": [
{
"contents": "[Unit]\nDescription=Layer nomad \u0026 consul with rpm-ostree\nWants=network-online.target\nAfter=network-online.target\n# We run before `zincati.service` to avoid conflicting rpm-ostree\n# transactions.\nBefore=zincati.service\nConditionPathExists=!/var/lib/%N.stamp\n\n[Service]\nType=oneshot\nRemainAfterExit=yes\n# `--allow-inactive` ensures that rpm-ostree does not return an error\n# if the package is already installed. This is useful if the package is\n# added to the root image in a future Fedora CoreOS release as it will\n# prevent the service from failing.\nExecStart=/usr/bin/rpm-ostree install --apply-live --allow-inactive consul nomad\nExecStart=systemctl enable consul nomad\nExecStart=/bin/touch /var/lib/%N.stamp\nExecStart=systemctl reboot\n\n[Install]\nWantedBy=multi-user.target",
"enabled": true,
"name": "rpm-ostree-install-hashistack.service"
}
]
}
}

View File

@@ -8,6 +8,8 @@ passwd:
# We need to make users for consul and nomad as we need them before their installed # We need to make users for consul and nomad as we need them before their installed
- name: consul - name: consul
no_create_home: true no_create_home: true
- name: nomad
no_create_home: true
systemd: systemd:
units: units:
- name: rpm-ostree-install-hashistack.service - name: rpm-ostree-install-hashistack.service
@@ -31,6 +33,14 @@ storage:
name: consul name: consul
user: user:
name: consul name: consul
- path: /etc/nomad.d/nomad.hcl
contents:
local: /etc/nomad.d/nomad.hcl
mode: 0600
group:
name: nomad
user:
name: nomad
directories: directories:
- path: /opt/consul - path: /opt/consul
mode: 0700 mode: 0700
@@ -38,3 +48,9 @@ storage:
name: consul name: consul
group: group:
name: consul name: consul
- path: /opt/nomad/data
mode: 0700
user:
name: nomad
group:
name: nomad

View File

@@ -13,6 +13,10 @@
{ {
"name": "consul", "name": "consul",
"noCreateHome": true "noCreateHome": true
},
{
"name": "nomad",
"noCreateHome": true
} }
] ]
}, },
@@ -27,6 +31,16 @@
"name": "consul" "name": "consul"
}, },
"mode": 448 "mode": 448
},
{
"group": {
"name": "nomad"
},
"path": "/opt/nomad/data",
"user": {
"name": "nomad"
},
"mode": 448
} }
], ],
"files": [ "files": [
@@ -59,6 +73,20 @@
"source": "data:;base64,H4sIAAAAAAAC/1SPPU/DMBRFd/+KK7NSlZa2WzY+FhCtBAKEUPviPGK3yXNjvwD596hhgfWc4d5TkZJjUU4oYPdUNySTkpWsOaltFUYxjUeduii5b6xhcWk46okv75buQW79ZnV5/XTfrVUW+npVzl7oo23LzfdcVs/d+tDxTS4szvDoQ0bIIGR2iRXqSZF97JsKJaNm4UTKFb6Ceux+J3HgoWbZmcSahu0+BkGBt793J+3FzJ7jP1rM7bvJnD7HOk09m58AAAD//+J027nwAAAA" "source": "data:;base64,H4sIAAAAAAAC/1SPPU/DMBRFd/+KK7NSlZa2WzY+FhCtBAKEUPviPGK3yXNjvwD596hhgfWc4d5TkZJjUU4oYPdUNySTkpWsOaltFUYxjUeduii5b6xhcWk46okv75buQW79ZnV5/XTfrVUW+npVzl7oo23LzfdcVs/d+tDxTS4szvDoQ0bIIGR2iRXqSZF97JsKJaNm4UTKFb6Ceux+J3HgoWbZmcSahu0+BkGBt793J+3FzJ7jP1rM7bvJnD7HOk09m58AAAD//+J027nwAAAA"
}, },
"mode": 384 "mode": 384
},
{
"group": {
"name": "nomad"
},
"path": "/etc/nomad.d/nomad.hcl",
"user": {
"name": "nomad"
},
"contents": {
"compression": "gzip",
"source": "data:;base64,H4sIAAAAAAAC/2zJMQ7DIAwF0N2nsNgrTsBZKoO/KipqKtfNEuXuEZmzvqcS0mAB58LpLa8h9qgISbTqqf2KPL+RbX5E8+JE1EaHBe/EDJM6oFw4/A866Aff4Pd3BgAA///Bwum4cQAAAA=="
},
"mode": 384
} }
] ]
}, },

View File

@@ -14,8 +14,8 @@ RemainAfterExit=yes
# if the package is already installed. This is useful if the package is # if the package is already installed. This is useful if the package is
# added to the root image in a future Fedora CoreOS release as it will # added to the root image in a future Fedora CoreOS release as it will
# prevent the service from failing. # prevent the service from failing.
ExecStart=/usr/bin/rpm-ostree install --apply-live --allow-inactive consul ExecStart=/usr/bin/rpm-ostree install --apply-live --allow-inactive consul nomad
ExecStart=systemctl enable consul ExecStart=systemctl enable consul nomad
ExecStart=/bin/touch /var/lib/%N.stamp ExecStart=/bin/touch /var/lib/%N.stamp
ExecStart=systemctl reboot ExecStart=systemctl reboot

View 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",
]
}

View File

@@ -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

View File

@@ -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.

View File

@@ -0,0 +1,154 @@
# Terraform provider for libvirt
- [![Gitter chat](https://badges.gitter.im/terraform-provider-libvirt/Lobby.png)](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)
![alpha](https://img.shields.io/badge/stability%3F-beta-yellow.svg) [![Tests](https://github.com/dmacvicar/terraform-provider-libvirt/actions/workflows/test.yml/badge.svg)](https://github.com/dmacvicar/terraform-provider-libvirt/actions/workflows/test.yml) [![Registry](https://img.shields.io/badge/libvirt-Terraform%20Registry-blue)](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

View File

@@ -0,0 +1,2 @@
unraid.othrayte.one ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAqk9L+GExUj58HEBBz9cTQ4BreTh01Nc0Nt2zqJqx/F
betelgeuse-seven-unraid ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAqk9L+GExUj58HEBBz9cTQ4BreTh01Nc0Nt2zqJqx/F

Binary file not shown.

View File

@@ -0,0 +1,3 @@
`terraform init`
`terraform plan --out plan.tfplan`
`terraform apply plan.tfplan`

View File

@@ -18,10 +18,14 @@
`sudo reboot` `sudo reboot`
ssh should now work with the user's ssh keys from ignition file 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 3. Wait, the initial service will install the hashistack and reboot again
4. Repeat for m41 and m40.
7. Boostrapping the consul cluster 7. Boostrapping the consul cluster
1. Run `consul agent -boostrap-expect 1 -bind 192.168.1.115 -ui -config-file ./etc/consul.d/consul.hcl` locally 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 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 # Useful Debugging Commands
`sudo systemctl start consul` `sudo systemctl start consul`

View 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
}

View File

@@ -0,0 +1,9 @@
{
"version": 4,
"terraform_version": "1.6.4",
"serial": 74,
"lineage": "afff4b50-12a8-b1b7-406b-2f1a49714357",
"outputs": {},
"resources": [],
"check_results": null
}

View 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"
# ]
# }
}

View File

@@ -0,0 +1,34 @@
# Local .terraform directories
**/.terraform/*
# .tfstate files
*.tfstate
*.tfstate.*
# Crash log files
crash.log
crash.*.log
# Exclude all .tfvars files, which are likely to contain sensitive data, such as
# password, private keys, and other secrets. These should not be part of version
# control as they are data points which are potentially sensitive and subject
# to change depending on the environment.
*.tfvars
*.tfvars.json
# Ignore override files as they are usually used to override resources locally and so
# are not checked in
override.tf
override.tf.json
*_override.tf
*_override.tf.json
# Include override files you do wish to add to version control using negated pattern
# !example_override.tf
# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
# example: *tfplan*
# Ignore CLI configuration files
.terraformrc
terraform.rc

View File

@@ -0,0 +1,25 @@
# This file is maintained automatically by "terraform init".
# Manual edits may be lost in future updates.
provider "registry.terraform.io/neuspaces/system" {
version = "0.4.0"
constraints = "0.4.0"
hashes = [
"h1:Vsp3ZoNGUnijGxcyKPJAnjzaifk2rcOaA6DtS4Wsdyk=",
"zh:04862132feb60ff990e15f4b878e96fbcc296720bd31a39e7b0a8fe5788b5b33",
"zh:1d8b6050274b5b915fbf241a66c63fe1b2088bc4720e0ef36a3d75a197a97d78",
"zh:5263effc40349d48ed458ea5d418e7321db441d7987b35fabbdd3faa53ed114d",
"zh:5b13d535084dacba3d511d5c815db4b5ae83e9c6226938bbf20a30c4e05116cb",
"zh:69da944ea0c86ec4e64ae844f580d13910fd66f1d8a9ecc7890ff0ace29aef36",
"zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3",
"zh:7fce212ccf0fd267a7f318c793e174605cbaa7814f9b30be16ed1d0526ab398f",
"zh:97523ef340365bfaf759cc1eb4a202af7b27ac87e1cb5f0309a585d63e205bbd",
"zh:9f3fefa30abc39a1073e66b88701b5437f4b04b0082091408c97f6a8e5b64bd3",
"zh:e16d43079cc894bfb0980ff211ea1787cdb913f24826461a8967ac91fd146ea8",
"zh:e4630f531b59e813fa405942c7648252c741313ccd49bc1be85f2ea964016ed3",
"zh:ebd2549e8b5b2894efb0ba70f2f6034ae5fb5821d1e2831ba5af8fa5e5870829",
"zh:ed601fdbf4813d041b3773781e2331c7ea074f8a5b505d2b105059a89b44301c",
"zh:f08f8e3d05759b72421de4c54f6938396d3e13fdfdbe7505877b1c64342dfa3a",
"zh:fea9e0172235a52343826d77e8331bcfeb785d514b4f5ee39f524d541b1a8749",
]
}

View File

@@ -0,0 +1,35 @@
terraform {
required_providers {
system = {
source = "neuspaces/system"
version = "0.4.0"
}
}
}
provider "system" {
ssh {
host = "jaglan-beta-m42"
user = "core"
agent = true
}
}
resource "system_file" "static_content" {
path = "/etc/consul.d/consul.hcl"
content = "Hello world!"
}
resource "terraform_data" "jaglan-beta" {
provisioner "file" {
source = "consul.hcl"
#destination = "/etc/consul.d/consul.hcl"
destination = "./consul.hcl"
}
connection {
type = "ssh"
user = "core"
host = "jaglan-beta-m42"
}
}

View File

@@ -0,0 +1,24 @@
datacenter = "jaglan-beta"
#data_dir = "/var/lib/nomad"
#plugin_dir = "/usr/local/lib/nomad/plugins"
server {
enabled = true
bootstrap_expect = 1
server_join {
retry_join = ["jaglan-beta-m01", "jaglan-beta-m42"]
}
}
tls {
http = true
rpc = true
ca_file = "/etc/nomad.certs/nomad-ca.pem"
cert_file = "/etc/nomad.certs/server.pem"
key_file = "/etc/nomad.certs/server-key.pem"
verify_server_hostname = true
verify_https_client = true
}

Binary file not shown.

View File

@@ -0,0 +1,11 @@
We use terraform for this configuration step just to make it easier
to develop what the configuration should be, once it is stable we
can move it into the butane definition.
1. Generate secrets
1. consul `encrypt`, `consul keygen` and store in consul.hcl
2. nomad keys?
2. Init & apply terraform
1. `terraform init`
2. `terraform plan --out plan.tfplan`
3. `terraform apply plan.tfplan`