-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* func: add initial enos skeleton * style: add headers * func: change the variables input to a map of objects to simplify the workloads creation * style: formating * Add tests for servers and clients * style: separate the tests in diferent scripts * style: add missing headers * func: add tests for allocs * style: improve output * func: add step to copy remote upgrade version * style: hcl formatting * fix: remove the terraform nomad provider * fix: Add clean token to remove extra new line added in provision * fix: Add clean token to remove extra new line added in provision * fix: Add clean token to remove extra new line added in provision * fix: add missing license headers * style: hcl fmt * style: rename variables and fix format * func: remove the template step on the workloads module and chop the noamd token output on the provide module * fix: correct the jobspec path on the workloads module * fix: add missing variable definitions on job specs for workloads * style: formatting * fix: Add clean token to remove extra new line added in provision * func: add module to upgrade servers * style: missing headers * func: add upgrade module * func: add install for windows as well * func: add an intermediate module that runs the upgrade server for each server * fix: add missing license headers * fix: remove extra input variables and connect upgrade servers to the scenario * fix: rename missing env variables for cluster health scripts * func: move the cluster health test outside of the modules and into the upgrade scenario * fix: fix the regex to ignore snap files on the gitignore file * fix: Add clean token to remove extra new line added in provision * fix: Add clean token to remove extra new line added in provision * fix: Add clean token to remove extra new line added in provision * fix: remove extra input variables and connect upgrade servers to the scenario * style: formatting * fix: move taken and restoring snapshots out of the upgrade_single_server to avoid possible race conditions * fix: rename variable in health test * fix: Add clean token to remove extra new line added in provision * func: add an intermediate module that runs the upgrade server for each server * fix: Add clean token to remove extra new line added in provision * fix: Add clean token to remove extra new line added in provision * fix: Add clean token to remove extra new line added in provision * func: fix the last_log_index check and add a versions check * func: done use for_each when upgrading the servers, hardcodes each one to ensure they are upgraded one by one * Update enos/modules/upgrade_instance/variables.tf Co-authored-by: Tim Gross <[email protected]> * Update enos/modules/upgrade_instance/variables.tf Co-authored-by: Tim Gross <[email protected]> * Update enos/modules/upgrade_instance/variables.tf Co-authored-by: Tim Gross <[email protected]> * func: make snapshot by calling every server and allowing stale data * style: formatting * fix: make the source for the upgrade binary unknow until apply * func: use enos bundle to install remote upgrade version, enos_files is not meant for dynamic files --------- Co-authored-by: Tim Gross <[email protected]>
- Loading branch information
1 parent
a914888
commit cf0a046
Showing
14 changed files
with
499 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,3 +51,4 @@ resource "enos_local_exec" "verify_versions" { | |
] | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// Don't commit cluster snapshots | ||
*.snap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Copyright (c) HashiCorp, Inc. | ||
# SPDX-License-Identifier: BUSL-1.1 | ||
|
||
terraform { | ||
required_providers { | ||
enos = { | ||
source = "registry.terraform.io/hashicorp-forge/enos" | ||
} | ||
} | ||
} | ||
|
||
locals { | ||
binary_destination = var.platform == "windows" ? "C:/opt/" : "/usr/local/bin/" | ||
ssh_user = var.platform == "windows" ? "Administrator" : "ubuntu" | ||
} | ||
|
||
resource "enos_bundle_install" "nomad" { | ||
destination = local.binary_destination | ||
|
||
artifactory = var.artifactory_release | ||
|
||
transport = { | ||
ssh = { | ||
host = var.server_address | ||
private_key_path = var.ssh_key_path | ||
user = local.ssh_user | ||
} | ||
} | ||
} | ||
|
||
resource "enos_remote_exec" "restart_linux_services" { | ||
count = var.platform == "linux" ? 1 : 0 | ||
depends_on = [enos_bundle_install.nomad] | ||
|
||
|
||
transport = { | ||
ssh = { | ||
host = var.server_address | ||
private_key_path = var.ssh_key_path | ||
user = local.ssh_user | ||
} | ||
} | ||
|
||
inline = [ | ||
"sudo systemctl restart nomad", | ||
] | ||
} | ||
|
||
resource "enos_remote_exec" "restart_windows_services" { | ||
count = var.platform == "windows" ? 1 : 0 | ||
depends_on = [enos_bundle_install.nomad] | ||
|
||
transport = { | ||
ssh = { | ||
host = var.server_address | ||
private_key_path = var.ssh_key_path | ||
user = local.ssh_user | ||
} | ||
} | ||
|
||
inline = [ | ||
"powershell Restart-Service Nomad" | ||
] | ||
} |
Oops, something went wrong.