Skip to content
Snippets Groups Projects
Commit 66c78806 authored by František Dvořák's avatar František Dvořák
Browse files

Terraform linting

parent a0412805
No related branches found
No related tags found
No related merge requests found
config {
call_module_type = "local"
force = false
}
plugin "terraform" {
enabled = true
preset = "recommended"
}
...@@ -25,9 +25,9 @@ resource "openstack_compute_secgroup_v2" "ping" { ...@@ -25,9 +25,9 @@ resource "openstack_compute_secgroup_v2" "ping" {
rule { rule {
from_port = 128 from_port = 128
to_port = 0 to_port = 0
# initial installation (bug in terraform): ip_protocol = "icmp"
ip_protocol = "ipv6-icmp" ip_protocol = "ipv6-icmp"
cidr = "::/0" cidr = "::/0"
# initial installation (bug in terraform): ip_protocol = "icmp"
} }
} }
...@@ -102,7 +102,6 @@ data "openstack_compute_flavor_v2" "gpu-flavor" { ...@@ -102,7 +102,6 @@ data "openstack_compute_flavor_v2" "gpu-flavor" {
resource "openstack_compute_instance_v2" "master" { resource "openstack_compute_instance_v2" "master" {
name = "k8s-${var.site_name}-master" name = "k8s-${var.site_name}-master"
image_id = data.openstack_images_image_v2.ubuntu.id image_id = data.openstack_images_image_v2.ubuntu.id
# 4 cores 4 GB RAM
flavor_id = data.openstack_compute_flavor_v2.master-flavor.id flavor_id = data.openstack_compute_flavor_v2.master-flavor.id
security_groups = ["default", "all"] security_groups = ["default", "all"]
user_data = file("cloud-init.yaml") user_data = file("cloud-init.yaml")
......
...@@ -20,10 +20,11 @@ resource "openstack_networking_secgroup_rule_v2" "ping" { ...@@ -20,10 +20,11 @@ resource "openstack_networking_secgroup_rule_v2" "ping" {
ethertype = strcontains(each.key, ":") ? "IPv6" : "IPv4" ethertype = strcontains(each.key, ":") ? "IPv6" : "IPv4"
port_range_min = strcontains(each.key, ":") ? 128 : 8 port_range_min = strcontains(each.key, ":") ? 128 : 8
port_range_max = 0 port_range_max = 0
# protocol = strcontains(each.key, ":") ? "ipv6-icmp" : "icmp"
protocol = "icmp" protocol = "icmp"
remote_ip_prefix = each.key remote_ip_prefix = each.key
security_group_id = openstack_networking_secgroup_v2.ping.id security_group_id = openstack_networking_secgroup_v2.ping.id
# for update:
# protocol = strcontains(each.key, ":") ? "ipv6-icmp" : "icmp"
} }
resource "openstack_networking_secgroup_rule_v2" "ssh" { resource "openstack_networking_secgroup_rule_v2" "ssh" {
......
...@@ -3,9 +3,12 @@ provider "openstack" { ...@@ -3,9 +3,12 @@ provider "openstack" {
terraform { terraform {
required_providers { required_providers {
local = "~> 2.0" local = {
source = "hashicorp/local"
version = "~> 2.0"
}
openstack = { openstack = {
source = "terraform-provider-openstack/openstack", source = "terraform-provider-openstack/openstack"
version = ">= 1.38.0" version = ">= 1.38.0"
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment