Initial test version

This commit is contained in:
Jason Rothstein 2022-05-06 15:16:16 -05:00
parent 830e33facb
commit 03bb0578a5
12 changed files with 121 additions and 18 deletions

64
.gitignore vendored
View File

@ -1,20 +1,33 @@
# ---> Ansible
*.retry
# ---> Terraform
# Local .terraform directories
**/.terraform/*
# ---> Linux
*~
# .tfstate files
*.tfstate
*.tfstate.*
# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*
# .terraform.lock.hcl
**/.terraform.lock.hcl
# KDE directory preferences
.directory
# Crash log files
crash.log
# Linux trash folder which might appear on any partition or disk
.Trash-*
# Ignore any .tfvars files that are generated automatically for each Terraform run. Most
# .tfvars files are managed as part of configuration and so should be included in
# version control.
#
# example.tfvars
# .nfs files are created when an open file is removed but is still being accessed
.nfs*
# 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
# ---> Windows
# Windows thumbnail cache files
@ -69,12 +82,20 @@ Network Trash Folder
Temporary Items
.apdisk
# ---> VisualStudioCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
# ---> Linux
*~
# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*
# KDE directory preferences
.directory
# Linux trash folder which might appear on any partition or disk
.Trash-*
# .nfs files are created when an open file is removed but is still being accessed
.nfs*
# ---> Vim
# Swap
@ -95,3 +116,10 @@ tags
# Persistent undo
[._]*.un~
# ---> VisualStudioCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

23
Makefile Normal file
View File

@ -0,0 +1,23 @@
.PHONY: all
all: init fmt validate
.PHONY: init
init:
terraform init -upgrade=false
.PHONY: initupgrade
initupgrade:
terraform init -upgrade=true
.PHONY: fmt
fmt: init
terraform fmt
.PHONY: validate
validate: init fmt
terraform validate
.PHONY: clean
clean:
$(RM) -r .terraform .terraform.lock.hcl

4
output.instance.tf Normal file
View File

@ -0,0 +1,4 @@
output "instance" {
value = linode_instance.this
}

View File

@ -0,0 +1,11 @@
resource "linode_instance" "this" {
authorized_keys = var.authorized_keys
backups_enabled = true
booted = true
label = "${var.host_name}.${var.domain_name}"
image = var.image
private_ip = true
tags = var.tags
type = var.type
region = var.region
}

9
terraform.tf Normal file
View File

@ -0,0 +1,9 @@
terraform {
required_providers {
linode = {
source = "linode/linode"
version = ">= 1.27.1"
}
}
required_version = ">= 1.1.9"
}

View File

@ -0,0 +1,4 @@
variable "authorized_keys" {
default = []
type = list(string)
}

4
variable.domain_name.tf Normal file
View File

@ -0,0 +1,4 @@
variable "domain_name" {
default = "example.com"
type = string
}

4
variable.host_name.tf Normal file
View File

@ -0,0 +1,4 @@
variable "host_name" {
default = "hello-world"
type = string
}

4
variable.image.tf Normal file
View File

@ -0,0 +1,4 @@
variable "image" {
default = "linode/fedora35"
type = string
}

4
variable.region.tf Normal file
View File

@ -0,0 +1,4 @@
variable "region" {
default = "us-central"
type = string
}

4
variable.tags.tf Normal file
View File

@ -0,0 +1,4 @@
variable "tags" {
default = []
type = list(string)
}

4
variable.type.tf Normal file
View File

@ -0,0 +1,4 @@
variable "type" {
default = "g6-nanode-1"
type = string
}