commit 98d005b149177ea5dd0389b84f25d0d509242873
parent f5266e02eb93c62f3f2d9670438ea822aab8fa21
Author: Andreas Gruhler <andreas.gruhler@adfinis.com>
Date: Thu, 25 Jun 2020 16:41:33 +0200
use file_permission for local_file
Diffstat:
2 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/libvirt/terraform/vms.tf b/libvirt/terraform/vms.tf
@@ -44,9 +44,7 @@ resource "tls_private_key" "id_rsa" {
resource "local_file" "ssh_private_key" {
sensitive_content = tls_private_key.id_rsa.private_key_pem
filename = "${path.module}/../ssh/id_rsa"
- provisioner "local-exec" {
- command = "chmod 600 ${path.module}/../ssh/id_rsa"
- }
+ file_permission = "0600"
}
resource "local_file" "ssh_public_key" {
sensitive_content = tls_private_key.id_rsa.public_key_openssh
@@ -218,4 +216,4 @@ resource "null_resource" "update_inventory" {
# recreate mapping of qemu VM id to hostnames
command = "echo '${templatefile("${path.module}/templates/qemu-config.yml.tpl", { hosts = libvirt_domain.host })}' > ../ansible/qemu-config.yml"
}
-}
-\ No newline at end of file
+}
diff --git a/proxmox/terraform/vms.tf b/proxmox/terraform/vms.tf
@@ -59,9 +59,7 @@ resource "tls_private_key" "id_rsa" {
resource "local_file" "ssh_private_key" {
sensitive_content = tls_private_key.id_rsa.private_key_pem
filename = "${path.module}/../ssh/id_rsa"
- provisioner "local-exec" {
- command = "chmod 600 ${path.module}/../ssh/id_rsa"
- }
+ file_permission = "0600"
}
resource "local_file" "ssh_public_key" {
sensitive_content = tls_private_key.id_rsa.public_key_openssh