M #-: fix minor bug in Google provider (#1678)

This commit is contained in:
Alejandro Huertas Herrero authored and GitHub committed 2022-01-03 11:31:56 +01:00
1 parent 411b9484c9
commit 7c74c031ab
2 files changed
+7 -1

No files matched your search

+5 -1
View File
@@ -66,7 +66,11 @@ module OneProvision
# Checks ansible installed version
def check_ansible_version
version = Gem::Version.new(`ansible --version`.split[1])
# Get just first line with Ansible version
version = `ansible --version`.split("\n")[0]
version = version.match(/\d+[.]\d+[.]\d+/)
version = Gem::Version.new(version)
if (version < ANSIBLE_VERSION[0]) ||
(version >= ANSIBLE_VERSION[1])
@@ -20,4 +20,6 @@ resource "google_compute_firewall" "device_<%= obj['ID'] %>" {
protocol = "udp"
ports = ["8472"]
}
source_ranges = ["0.0.0.0/0"]
}