...
 
Commits (2)
[defaults]
roles_path = ./roles
library = /usr/share/ansible:./library
force_color = 1
gathering = smart
# fork max(n, num_hosts) times
forks = 50
# google for errors more easily
module_lang=en_US.UTF-8
pipelining = True
# I want no cows here
nocows = 1
{"Modules":[{"Key":"schulungsumgebung","Source":"./modules/schulungsumgebung","Dir":"modules/schulungsumgebung"},{"Key":"","Source":"","Dir":"."}]}
\ No newline at end of file
{
"hcloud": "49177de71d41074856e6a925103539172428e4b8370b8de04a512686aaa1a115",
"random": "791ef28ff31913d9b2ef0bedb97de98bebafe66d002bc2b9d01377e59a6cfaed"
}
\ No newline at end of file
## 1.19.1 (July 16, 2020)
NOTES:
* First release under new terraform registry
* Provider was moved to https://github.com/hetznercloud/terraform-provider-hcloud
## 1.19.0 (July 10, 2020)
BUG FIXES:
* Update to hcloud-go v1.18.2 to fix a conflict issue
* Ensure `alias_ip` retain the same order.
NOTES:
* This release uses Terraform Plugin SDK v1.15.0.
## 1.18.1 (July 02, 2020)
BUG FIXES
* Set correct defaults for `cookie_name` and `cookie_lifetime`
properties of `hcloud_load_balancer_service`.
* Remove unsupported `https` protocol from health check documentation.
* Force recreate of `hcloud_network` if `ip_range` changes.
## 1.18.0 (June 30, 2020)
FEATURES:
* **New Resource**: `hcloud_load_balancer_target` which allows to add a
target to a load balancer. This resource extends the `target` property
of the `hcloud_load_balancer` resource. `hcloud_load_balancer_target`
should be preferred over the `target` property of
`hcloud_load_balancer`.
## 1.17.0 (June 22, 2020)
FEATURES:
* **New Datasource**: `hcloud_load_balancer`
* **New Resource**: `hcloud_load_balancer`
* **New Resource**: `hcloud_load_balancer_service`
* **New Resource**: `hcloud_load_balancer_network`
BUG FIXES:
* resources/hcloud_network_route: Fix panic when trying to lookup an already deleted Network route
## 1.16.0 (March 24, 2020)
BUG FIXES:
* resource/hcloud_ssh_key: Fix panic when we update labels in SSH keys
* resource/hcloud_server_network: Fix alias ips ignored on creation of server network
* resource/hcloud_server: Use first assigned `ipv6_address` as value instead of the network address. **Attention: This can be a breaking change**
NOTES:
* This release uses Terraform Plugin SDK v1.8.0.
## 1.15.0 (November 11, 2019)
IMPROVEMENTS:
* resources/hcloud_server: Add retry mechanism for enabling the rescue mode.
NOTES:
* This release uses Terraform Plugin SDK v1.3.0.
## 1.14.0 (October 01, 2019)
NOTES:
* This release uses the Terraform Plugin SDK v1.1.0.
## 1.13.0 (September 19, 2019)
IMPROVEMENTS:
* resources/hcloud_floating_ip: Add `name` attribute to get or set the name of a Floating IP.
* datasource/hcloud_floating_ip: Add `name` attribute to get Floating IPs by their name.
NOTES:
* This release is Terraform 0.12.9+ compatible.
* Updated hcloud-go to `v1.16.0`
* The provider is now tested and build with Go `1.13`
## 1.12.0 (July 29, 2019)
FEATURES:
* **New Datasource**: `hcloud_ssh_keys` Lookup all SSH keys.
IMPROVEMENTS:
* resources/hcloud_server_network: Add `mac_address` attribute to get the mac address of the Network interface.
BUG FIXES:
* Fix an error on server creation, when an iso id was given instead of an iso name.
NOTES:
* This release is Terraform 0.12.5+ compatible.
* Updated hcloud-go to `v1.15.1`
* Added hcloud-go request debugging when using `TF_LOG`.
## 1.11.0 (July 10, 2019)
FEATURES:
* **New Resource**: `hcloud_network` Manage Networks.
* **New Resource**: `hcloud_network_subnet` Manage Networks Subnets.
* **New Resource**: `hcloud_network_route` Manage Networks Routes.
* **New Resource**: `hcloud_server_network` Manage attachment between servers and Networks.
* **New Datasource**: `hcloud_network` Lookup Networks.
## 1.10.0 (May 14, 2019)
NOTES:
* This release is Terraform 0.12-RC1+ compatible.
## 1.9.0 (March 15, 2019)
IMPROVEMENTS:
* datasource/hcloud_server: Add `with_status` attribute to get images by their status.
* datasource/hcloud_image: Add `with_status` attribute to get servers by their status.
* datasource/hcloud_volume: Add `with_status` attribute to get volumes by their status.
* Added `with_selector` to all datasources that support label selectors.
NOTES:
* **Deprecation**: datasource/hcloud_server: `selector`, will be removed in the near future.
* **Deprecation**: datasource/hcloud_floating_ip: `selector`, will be removed in the near future.
* **Deprecation**: datasource/hcloud_image: `selector`, will be removed in the near future.
* **Deprecation**: datasource/hcloud_ssh_key: `selector`, will be removed in the near future.
* **Deprecation**: datasource/hcloud_volume: `selector`, will be removed in the near future.
## 1.8.1 (March 12, 2019)
BUG FIXES:
* Fix an error on server creation, when a image id was given instead of a image name.
* Fix an missing error on `terraform plan`, when using an image name which does not exists.
## 1.8.0 (February 06, 2019)
FEATURES:
* **New Datasource**: `hcloud_server` Lookup a server.
IMPROVEMENTS:
* Add API token length validation
## 1.7.0 (December 18, 2018)
FEATURES:
* **New Datasource**: `hcloud_location` Lookup a location.
* **New Datasource**: `hcloud_locations` Lookup all locations.
* **New Datasource**: `hcloud_datacenter` Lookup a datacenter.
* **New Datasource**: `hcloud_datacenters` Lookup all datacenters.
* Volume Automounting is now available for `hcloud_volume` and `hcloud_volume_attachment`
## 1.6.0 (December 03, 2018)
IMPROVEMENTS:
* datasource/hcloud_image: Add `most_recent` attribute to get the latest image when multiple images has the same label.
BUG FIXES:
* Fix an error on volume_attachment creation, when server was locked.
## 1.5.0 (November 16, 2018)
FEATURES:
* **New Resource**: `hcloud_volume_attachment` Manage the attachment between volumes and servers.
IMPROVEMENTS:
* resources/hcloud_server: Add `backups` attribute to enable or disable backups.
NOTES:
* **Read Only**: resources/hcloud_server: `backup_window`, removed the ability to set the attribute. This attribute is now read only.
* Updated hcloud-go to `v1.11.0`
## 1.4.0 (October 18, 2018)
FEATURES:
* **New Resource**: `hcloud_volume` Manage volumes.
* **New Datasource**: `hcloud_volume` Lookup volumes.
NOTES:
* **Deprecation**: resource/hcloud_server: `backup_window`, will be removed in the near future.
## 1.3.0 (September 12, 2018)
FEATURES:
- **New Resource**: `hcloud_rnds` Manage reverse DNS entries for servers and Floating IPs.
* **New Resource**: `hcloud_floating_ip_assignment` Manage the association between Floating IPs and servers.
- **New Datasource**: `hcloud_floating_ip` Lookup Floating ips.
- **New Datasource**: `hcloud_image` Lookup images.
- **New Datasource**: `hcloud_ssh_key` Lookup SSH Keys.
- **New Provider Config**: `poll_interval` Configures the interval in which actions are polled by the client. Default `500ms`. Increase this interval if you run into rate limiting errors.
IMPROVEMENTS:
* resource/hcloud_server: Add `ipv6_network` attribute.
NOTES:
* Updated hcloud-go to `v1.9.0`
## 1.2.0 (June 07, 2018)
NOTES:
* Switched from MIT licence to MPL2
* removed `reverse_dns` property of `hcloud_floating_ip`, because it was not useable, see https://github.com/hetznercloud/terraform-provider-hcloud/issues/32
* improved test coverage
* updated terraform to `v0.11.7`
* updated hcloud-go to `v1.6.0`
* added log when waiting for an action to complete
BUG FIXES:
* delete records from state that are invalid or are not found by the server
* resource update methods return the result of the read method
## 1.1.0 (March 2, 2018)
* Save hashsum of `user_data`, existing state is migrated
* update hcloud-go to v1.4.0
* update terraform from v0.11.2 to v0.11.3
## 1.0.0 (January 30, 2018)
* Initial release
Terraform Provider for the Hetzner Cloud
==================
[![GitHub release](https://img.shields.io/github/tag/hetznercloud/terraform-provider-hcloud.svg?label=release)](https://github.com/terraform-providers/terraform-provider-hcloud/releases/latest) [![Build Status](https://travis-ci.org/terraform-providers/terraform-provider-hcloud.svg?branch=master)](https://travis-ci.org/terraform-providers/terraform-provider-hcloud)
- Website: https://www.terraform.io
- Documentation: https://www.terraform.io/docs/providers/hcloud/index.html
<img src="https://cdn.rawgit.com/hashicorp/terraform-website/master/content/source/assets/images/logo-hashicorp.svg" width="600px">
Requirements
------------
- [Terraform](https://www.terraform.io/downloads.html) 0.12.x
- [Go](https://golang.org/doc/install) 1.13.0 (to build the provider plugin)
Building the provider
---------------------
Clone repository to: `$GOPATH/src/github.com/terraform-providers/terraform-provider-hcloud`
```sh
$ mkdir -p $GOPATH/src/github.com/terraform-providers; cd $GOPATH/src/github.com/terraform-providers
$ git clone https://github.com/terraform-providers/terraform-provider-hcloud.git
```
Enter the provider directory and build the provider
```sh
$ cd $GOPATH/src/github.com/terraform-providers/terraform-provider-hcloud
$ make build
```
Using the provider
----------------------
if you are building the provider, follow the instructions to [install it as a plugin](https://www.terraform.io/docs/plugins/basics.html#installing-a-plugin). After placing it into your plugins directory, run `terraform init` to initialize it.
Developing the provider
---------------------------
If you wish to work on the provider, you'll first need [Go](http://www.golang.org) installed on your machine (version 1.11+ is *required*). You'll also need to correctly setup a [GOPATH](http://golang.org/doc/code.html#GOPATH), as well as adding `$GOPATH/bin` to your `$PATH`.
To compile the provider, run `make build`. This will build the provider and put the provider binary in the `$GOPATH/bin` directory.
```sh
$ make build
...
$ ./bin/terraform-provider-hcloud
...
```
In order to test the provider, you can simply run `make test`.
```sh
$ make test
```
In order to run the full suite of Acceptance tests run `make testacc`.
*Note:* Acceptance tests create real resources, and often cost money to run.
```
$ make testacc
```
{
"registry.terraform.io/hashicorp/local": {
"hash": "h1:P3mtBQSRp/KhVLJgwdHZRTWaYsT6A9nSwrmKrRZwsW8=",
"version": "1.4.0"
},
"registry.terraform.io/hashicorp/random": {
"hash": "h1:nFL6uiwsQFLiP8QCr35sPfWe9LpXI3/c7gP9tYnih+k=",
"version": "2.3.0"
},
"registry.terraform.io/terraform-providers/hcloud": {
"hash": "h1:HkQU003+X/xj7X/qgv9lKqmrvU66YjkR2B2Pjut+YSE=",
"version": "1.19.1"
}
}
\ No newline at end of file
User: schulung
Password: foobar
schulung-1-puppetmaster: 95.217.131.23
schulung-1-node1 95.217.152.144
schulung-1-node2 95.217.220.61
#cloud-config
users:
- name: schulung
lock_passwd: false
passwd: ${password}
groups: users
sudo: ALL=(ALL) NOPASSWD:ALL
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC6nC2NGZm6aKpfmsDNYia0PrSPQgIxjtM9M+G685kEZUIpHYMNpJW9EbpcORNMYgXGK074Qzq0McXKMr+t4+lVS5KT5MPU+0X9TZ43EjyabZDQBOfGQFv2GtJJ9NSXmKGSx1iirqk4WH2jNaIUomzBN44GYzSJUknbRn5rE3vZib+HkV5ybNMYBr3X0MEA/JMZsqjfcw0WWL9lVNDr2ZDbuZIxPB0Z4lL8szAlsT3H0qnjGyI0I+8uVpEGbYhHnl/lHtFOvNBEJxzhxEQs8RS8CAJvR+cxSkAKcU3THBFPECVvORL+E+qIaRLwfzRwHCSIFi94ls9Siqvmn23TDEhsVI5C++/3/ZblJuuwTCD06EXg/1nZ7Pm0GLxpqjYy0WN3wyNP1knlcTUukJ5rTTyHuG7HgYdgH2ew/c81Gk7MsA34wPAR0FdWjggaJg0PaStxgWzJ6YNfTybPXAPZRdNJMh9AcjCId8jXRUWZNi3AeRrDgaP/2lJWr5SDHF+wJlGfUZR36sMhrNvN1TMdAY6HlCXJc6auXluBDAAMIxr4098Y8XgVVMjzX56/+jhXY+YpM0hD3Tv8X284AEpj7bHV6ff7ttg5ZU0lLaMoS0TkZ9KLuLCdRlSf3jMZZWUoS85VLHmsc1zgpEGOGx/HY4yOjc/aMqFeQVFSIOMm9yK58Q== andre.naehring@credativ.de
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEApLjZA49ao1n58z2EGkhOsYzOBl1yNRcG7YyYSni2pp+OWJ7UbkO+kiMJb2pz8JcU2zBHA2RxgRqrP6QS0w1Bf2qaO7W6brwOmKIirrAufDTPtdg+Q3G+xvtsx0+W62ozLCRh1HNEgjty1sA+GyA13jgHlDqDnnh9B8e7Y9HdkJUNGkQpyw+iwjxi2MY5Mvuvi6T2L+o5i2Wi6Su0QzdUUmpRhr1TLicXPftEggHVQamkzbr6zoimRGLcRp3ZJ8KzuMBie3ZKGNzIVMNcZaQYYHlS2+KRUucIL8nK1kQ2xbv2tDaMIGK62TIunJSYjUkH8nMllCgbm90jFM9OV5S3lQ== formorer@nelson
# Configure the Hetzner Cloud Provider
provider "hcloud" {
version = "~> 1.18"
}
resource "hcloud_ssh_key" "default" {
for_each = fileset("${path.root}/keys", "*.pub")
name = "${trimsuffix(basename(each.value), ".pub")}@credativ.de"
public_key = file("${path.root}/keys/${each.value}")
}
module "schulungsumgebung" {
source = "./modules/schulungsumgebung"
count = 1
instance = count.index
ssh_keys = [for value in hcloud_ssh_key.default: value.name]
}
User: schulung
Password: ${password}
${prefix}-puppetmaster: ${puppetmaster}
%{ for index,ip in nodes ~}
${prefix}-node${index + 1} ${ip}
%{ endfor }
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC6nC2NGZm6aKpfmsDNYia0PrSPQgIxjtM9M+G685kEZUIpHYMNpJW9EbpcORNMYgXGK074Qzq0McXKMr+t4+lVS5KT5MPU+0X9TZ43EjyabZDQBOfGQFv2GtJJ9NSXmKGSx1iirqk4WH2jNaIUomzBN44GYzSJUknbRn5rE3vZib+HkV5ybNMYBr3X0MEA/JMZsqjfcw0WWL9lVNDr2ZDbuZIxPB0Z4lL8szAlsT3H0qnjGyI0I+8uVpEGbYhHnl/lHtFOvNBEJxzhxEQs8RS8CAJvR+cxSkAKcU3THBFPECVvORL+E+qIaRLwfzRwHCSIFi94ls9Siqvmn23TDEhsVI5C++/3/ZblJuuwTCD06EXg/1nZ7Pm0GLxpqjYy0WN3wyNP1knlcTUukJ5rTTyHuG7HgYdgH2ew/c81Gk7MsA34wPAR0FdWjggaJg0PaStxgWzJ6YNfTybPXAPZRdNJMh9AcjCId8jXRUWZNi3AeRrDgaP/2lJWr5SDHF+wJlGfUZR36sMhrNvN1TMdAY6HlCXJc6auXluBDAAMIxr4098Y8XgVVMjzX56/+jhXY+YpM0hD3Tv8X284AEpj7bHV6ff7ttg5ZU0lLaMoS0TkZ9KLuLCdRlSf3jMZZWUoS85VLHmsc1zgpEGOGx/HY4yOjc/aMqFeQVFSIOMm9yK58Q== andre.naehring@credativ.de
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEApLjZA49ao1n58z2EGkhOsYzOBl1yNRcG7YyYSni2pp+OWJ7UbkO+kiMJb2pz8JcU2zBHA2RxgRqrP6QS0w1Bf2qaO7W6brwOmKIirrAufDTPtdg+Q3G+xvtsx0+W62ozLCRh1HNEgjty1sA+GyA13jgHlDqDnnh9B8e7Y9HdkJUNGkQpyw+iwjxi2MY5Mvuvi6T2L+o5i2Wi6Su0QzdUUmpRhr1TLicXPftEggHVQamkzbr6zoimRGLcRp3ZJ8KzuMBie3ZKGNzIVMNcZaQYYHlS2+KRUucIL8nK1kQ2xbv2tDaMIGK62TIunJSYjUkH8nMllCgbm90jFM9OV5S3lQ== formorer@nelson
resource "hcloud_network" "intNet" {
name = "${local.prefix}-intNet_${random_string.network_name.result}"
ip_range = local.subnet
labels = var.labels
}
resource "hcloud_server" "puppetmaster" {
name = "${local.prefix}-puppetmaster"
image = "debian-10"
server_type = "cx21"
ssh_keys = var.ssh_keys
labels = var.labels
user_data = templatefile("${path.root}/cloud-init/user_data.yaml.templ", {
password = bcrypt("foobar", 5)
})
}
resource "hcloud_server" "node" {
name = "${local.prefix}-node${count.index}"
image = "debian-10"
server_type = "cx11"
ssh_keys = var.ssh_keys
labels = var.labels
count = 2
}
resource "hcloud_network_subnet" "net" {
network_id = hcloud_network.intNet.id
type = "cloud"
network_zone = "eu-central"
ip_range = local.puppetnet
}
resource "hcloud_server_network" "puppetnet" {
server_id = hcloud_server.puppetmaster.id
network_id = hcloud_network.intNet.id
ip = cidrhost(local.puppetnet, 1)
}
resource "hcloud_server_network" "puppetnetnode" {
server_id = hcloud_server.node[count.index].id
count = length(hcloud_server.node.*.id)
network_id = hcloud_network.intNet.id
ip = cidrhost(local.puppetnet, count.index + 2)
}
resource "local_file" "cheat_sheet" {
content = templatefile("${path.module}/cheat_sheet.tmpl",
{
puppetmaster = hcloud_server.puppetmaster.ipv4_address
nodes = [for value in hcloud_server.node: value.ipv4_address]
prefix = local.prefix
password = local.password
})
filename = "cheat"
}
resource "random_string" "network_name" {
length = 8
upper = false
lower = true
number = true
special = false
}
resource "random_string" "password" {
length = 12
number = true
}
variable "labels" {
type = map
default = {
scope = "puppetschulung"
owner = "swisscom_team"
}
}
variable "topic" {
type = string
default = "schulung"
}
variable "instance" {
type = string
}
variable "ssh_keys" { }
locals {
prefix = "${var.topic}-${var.instance + 1}"
subnet = "10.0.0.0/8"
puppetnet = cidrsubnet(local.subnet,8,1)
password = "foobar"
}
terraform {
required_providers {
hcloud = {
source = "terraform-providers/hcloud"
}
random = {
source = "hashicorp/random"
}
}
required_version = ">= 0.13"
}
resource "local_file" "foo" {
content = "foo!"
filename = "${path.module}/foo${var.instance}.bar"
}
output "test" {
value = "Var: ${var.instance}"
}
variable "instance" {
type = string
}
This diff is collapsed.
This diff is collapsed.
terraform {
required_providers {
hcloud = {
source = "terraform-providers/hcloud"
}
}
required_version = ">= 0.13"
}
---
- name: run bootstrap on localhost
hosts: 127.0.0.1
connection: local
tasks:
- name: run terraform
terraform:
project_path: 'plans/'
state: present