Skip to content

Commit

Permalink
fix: delete include template provider (hadenlabs#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
luismayta committed Sep 24, 2021
1 parent c82ccce commit b6c262a
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 68 deletions.
4 changes: 2 additions & 2 deletions commands.tf
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ resource "null_resource" "openvpn_install" {
}

provisioner "remote-exec" {
inline = [data.template_file.vpn_install.rendered]
inline = [local.template.vpn_install]
}
}

Expand All @@ -68,7 +68,7 @@ resource "null_resource" "openvpn_adduser" {
}

provisioner "remote-exec" {
inline = [data.template_file.vpn_update_user.rendered]
inline = [local.template.vpn_update_user]
}
}

Expand Down
17 changes: 0 additions & 17 deletions data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,3 @@ data "aws_ami" "amazon_linux" {

owners = ["099720109477"]
}

data "template_file" "vpn_install" {
template = file(format("%s/%s", path.module, "scripts/openvpn/install.tpl.sh"))

vars = {
public_ip = aws_eip.this.public_ip
client = var.admin_user
}
}

data "template_file" "vpn_update_user" {
template = file(format("%s/%s", path.module, "scripts/openvpn/update_user.tpl.sh"))

vars = {
client = var.admin_user
}
}
10 changes: 0 additions & 10 deletions examples/basic/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,10 @@ terraform {
version = ">=3.2.0"
}

template = {
source = "hashicorp/template"
version = ">=1.0.0"
}

null = {
source = "hashicorp/null"
version = ">=0.1.0"
}

local = {
source = "hashicorp/local"
version = ">=1.3.0"
}

}
}
30 changes: 21 additions & 9 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
locals {
template = {
vpn_install = templatefile(
format("%s/%s", path.module, "scripts/openvpn/install.tpl.sh"), {
public_ip = aws_eip.this.public_ip
client = var.admin_user
})
vpn_update_user = templatefile(
format("%s/%s", path.module, "scripts/openvpn/update_user.tpl.sh"), {
client = var.admin_user
})
}

defaults = {
rules_ingress = [
{
Expand Down Expand Up @@ -148,14 +160,14 @@ resource "aws_instance" "this" {
ignore_changes = [ami]
}

ami = data.aws_ami.amazon_linux.id
instance_type = var.instance_type
key_name = aws_key_pair.this.key_name
subnet_id = aws_subnet.this.id
ami = data.aws_ami.amazon_linux.id
instance_type = var.instance_type
key_name = aws_key_pair.this.key_name
subnet_id = aws_subnet.this.id
associate_public_ip_address = true
vpc_security_group_ids = [aws_security_group.this.id]
ebs_optimized = true
monitoring = true
vpc_security_group_ids = [aws_security_group.this.id]
ebs_optimized = true
monitoring = true

root_block_device {
encrypted = "true"
Expand All @@ -165,8 +177,8 @@ resource "aws_instance" "this" {
}

metadata_options {
http_endpoint = "enabled"
http_tokens = "required"
http_endpoint = "enabled"
http_tokens = "required"
}
}

Expand Down
Empty file removed provider.tf
Empty file.
Empty file removed test/openvpn-basic/provider.tf
Empty file.
11 changes: 0 additions & 11 deletions test/openvpn-basic/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,9 @@ terraform {
version = ">=3.2.0"
}

template = {
source = "hashicorp/template"
version = ">=1.0.0"
}

null = {
source = "hashicorp/null"
version = ">=0.1.0"
}

local = {
source = "hashicorp/local"
version = ">=1.3.0"
}

}
}
Empty file.
10 changes: 0 additions & 10 deletions test/openvpn-rules-ingress/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,10 @@ terraform {
version = ">=3.2.0"
}

template = {
source = "hashicorp/template"
version = ">=1.0.0"
}

null = {
source = "hashicorp/null"
version = ">=0.1.0"
}

local = {
source = "hashicorp/local"
version = ">=1.3.0"
}

}
}
9 changes: 0 additions & 9 deletions versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,10 @@ terraform {
version = ">=3.2.0"
}

template = {
source = "hashicorp/template"
version = ">=1.0.0"
}

null = {
source = "hashicorp/null"
version = ">=0.1.0"
}

local = {
source = "hashicorp/local"
version = ">=1.3.0"
}
}
}

0 comments on commit b6c262a

Please sign in to comment.