Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
akerl committed Mar 30, 2019
0 parents commit 035b0d3
Show file tree
Hide file tree
Showing 9 changed files with 116 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "scripts"]
path = scripts
url = https://github.com/armorfret/ci-helpers
26 changes: 26 additions & 0 deletions .prospectus
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Prospectus.extra_dep('file', 'prospectus_travis')

item do
noop

extend ProspectusTravis::Build.new('armorfret/terraform-linode-wireguard-image')

deps do
item do
name 'terraform'

expected do
github_release
repo 'hashicorp/terraform'
regex /^v?([\d.]+)$/
filter /^v?([\d.]+)$/
end

actual do
grep
file '.travis.yml'
regex /^\s+- TERRAFORM_VERSION=([\d.]+)$/
end
end
end
end
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
dist: trusty
env:
global:
- TFBIN_DIR=$HOME/tfbin
- TERRAFORM_VERSION=0.11.13
install:
- "./scripts/download_terraform.sh $TERRAFORM_VERSION"
script:
- "~/tfbin/terraform fmt -write=false -diff=true -check"
notifications:
email: false
22 changes: 22 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
The MIT License (MIT)

Copyright (c) 2019 Les Aker

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
terraform-linode-wireguard-image
=========

[![MIT Licensed](https://img.shields.io/badge/license-MIT-green.svg)](https://tldrlegal.com/license/mit-license)

Terraform module that creates a [Linode](https://linode.com) Image pre-baked with updates and [this Ansible repo](https://github.com/akerl/deploy-wireguard-server/) for deploying [Wireguard](https://www.wireguard.com).

## Usage

```
module "wireguard_image" {
source = "github.com/akerl/terraform-linode-wireguard-base"
}
```

## License

terraform-linode-wireguard-base is released under the MIT License. See the bundled LICENSE file for details.
21 changes: 21 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
resource "random_id" "vm_suffix" {
byte_length = 8
}

module "vm" {
source = "armorfret/wireguard-base/linode"
version = "0.0.1"
name = "wg-image_${random_id.vm_suffix.hex}"
region = "us-east"
type = "g6-standard-1"
algo_repo = "${var.deploy_repo}"
source_image_id = "linode/ubuntu18.10"
ssh_keys = ["${var.ssh_keys}"]
}

resource "linode_image" "image" {
linode_id = "${module.vm.linode_id}"
disk_id = "${module.vm.disk_id}"
label = "wireguard-image"
description = "Created by Terraform"
}
4 changes: 4 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
output "image_id" {
value = "${linode_image.image.id}"
description = "ID of the Linode Image"
}
1 change: 1 addition & 0 deletions scripts
Submodule scripts added at be42d6
10 changes: 10 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
variable "deploy_repo" {
type = "string"
default = "https://github.com/akerl/deploy-wireguard-server"
description = "Repo to use for Ansible code"
}

variable "ssh_keys" {
type = "list"
description = "SSH public keys used to log in as root to the server"
}

0 comments on commit 035b0d3

Please sign in to comment.