Skip to content

Commit

Permalink
func: move /etc and update all paths
Browse files Browse the repository at this point in the history
  • Loading branch information
Juanadelacuesta committed Dec 6, 2024
1 parent a48170a commit d842d3a
Show file tree
Hide file tree
Showing 30 changed files with 15 additions and 538 deletions.
6 changes: 4 additions & 2 deletions e2e/terraform/compute.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ resource "aws_instance" "client_ubuntu_jammy_amd64" {
}
}



resource "aws_instance" "client_windows_2016_amd64" {
ami = data.aws_ami.windows_2016_amd64[0].image_id
instance_type = var.instance_type
Expand Down Expand Up @@ -98,10 +100,10 @@ data "aws_ami" "ubuntu_jammy_amd64" {
values = ["Ubuntu"]
}

filter {
/* filter {
name = "tag:BuilderSha"
values = [data.external.packer_sha.result["sha"]]
}
} */
}

data "aws_ami" "windows_2016_amd64" {
Expand Down
6 changes: 3 additions & 3 deletions e2e/terraform/consul-clients.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ resource "local_sensitive_file" "consul_agents_cert" {
resource "random_uuid" "consul_agent_token" {}

resource "local_sensitive_file" "consul_agent_config_file" {
content = templatefile("${path.module}/etc/consul.d/clients.hcl", {
content = templatefile("${path.module}/provision-nomad/etc/consul.d/clients.hcl", {
token = "${random_uuid.consul_agent_token.result}"
autojoin_value = "auto-join-${local.random_name}"
})
Expand All @@ -61,7 +61,7 @@ resource "local_sensitive_file" "consul_agent_config_file" {
resource "random_uuid" "consul_token_for_nomad" {}

resource "local_sensitive_file" "nomad_client_config_for_consul" {
content = templatefile("${path.module}/etc/nomad.d/client-consul.hcl", {
content = templatefile("${path.module}/provision-nomad/etc/nomad.d/client-consul.hcl", {
token = "${random_uuid.consul_token_for_nomad.result}"
client_service_name = "client-${local.random_name}"
server_service_name = "server-${local.random_name}"
Expand All @@ -71,7 +71,7 @@ resource "local_sensitive_file" "nomad_client_config_for_consul" {
}

resource "local_sensitive_file" "nomad_server_config_for_consul" {
content = templatefile("${path.module}/etc/nomad.d/server-consul.hcl", {
content = templatefile("${path.module}/provision-nomad/etc/nomad.d/server-consul.hcl", {
token = "${random_uuid.consul_token_for_nomad.result}"
client_service_name = "client-${local.random_name}"
server_service_name = "server-${local.random_name}"
Expand Down
6 changes: 3 additions & 3 deletions e2e/terraform/consul-servers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ resource "local_sensitive_file" "consul_initial_management_token" {
}

resource "local_sensitive_file" "consul_server_config_file" {
content = templatefile("${path.module}/etc/consul.d/servers.hcl", {
content = templatefile("${path.module}/provision-nomad/etc/consul.d/servers.hcl", {
management_token = "${random_uuid.consul_initial_management_token.result}"
token = "${random_uuid.consul_agent_token.result}"
nomad_token = "${random_uuid.consul_token_for_nomad.result}"
Expand Down Expand Up @@ -69,7 +69,7 @@ resource "local_sensitive_file" "consul_server_cert" {

# if consul_license is unset, it'll be a harmless empty license file
resource "local_sensitive_file" "consul_environment" {
content = templatefile("${path.module}/etc/consul.d/.environment", {
content = templatefile("${path.module}/provision-nomad/etc/consul.d/.environment", {
license = var.consul_license
})
filename = "uploads/shared/consul.d/.environment"
Expand Down Expand Up @@ -117,7 +117,7 @@ resource "null_resource" "upload_consul_server_configs" {
destination = "/tmp/consul_server.hcl"
}
provisioner "file" {
source = "${path.module}/etc/consul.d/consul-server.service"
source = "${path.module}/provision-nomad/etc/consul.d/consul-server.service"
destination = "/tmp/consul.service"
}
}
Expand Down
35 changes: 0 additions & 35 deletions e2e/terraform/etc/acls/consul/consul-agent-policy.hcl

This file was deleted.

34 changes: 0 additions & 34 deletions e2e/terraform/etc/acls/consul/nomad-client-policy.hcl

This file was deleted.

30 changes: 0 additions & 30 deletions e2e/terraform/etc/acls/consul/nomad-server-policy.hcl

This file was deleted.

44 changes: 0 additions & 44 deletions e2e/terraform/etc/acls/vault/nomad-policy.hcl

This file was deleted.

1 change: 0 additions & 1 deletion e2e/terraform/etc/consul.d/.environment

This file was deleted.

42 changes: 0 additions & 42 deletions e2e/terraform/etc/consul.d/clients.hcl

This file was deleted.

20 changes: 0 additions & 20 deletions e2e/terraform/etc/consul.d/consul-server.service

This file was deleted.

17 changes: 0 additions & 17 deletions e2e/terraform/etc/consul.d/consul.service

This file was deleted.

47 changes: 0 additions & 47 deletions e2e/terraform/etc/consul.d/servers.hcl

This file was deleted.

1 change: 0 additions & 1 deletion e2e/terraform/etc/nomad.d/.environment

This file was deleted.

29 changes: 0 additions & 29 deletions e2e/terraform/etc/nomad.d/base.hcl

This file was deleted.

10 changes: 0 additions & 10 deletions e2e/terraform/etc/nomad.d/client-consul.hcl

This file was deleted.

Loading

0 comments on commit d842d3a

Please sign in to comment.