From 30ac48086e6294fe0666019422cfbf656923f425 Mon Sep 17 00:00:00 2001 From: Luuk van Venrooij Date: Thu, 20 Aug 2020 14:47:18 +0200 Subject: [PATCH 1/2] - Fixed for changing templates between each Terraform runs on Azure --- .../cli/engine/providers/azure/InfrastructureBuilder.py | 4 ---- .../data/azure/terraform/infrastructure/virtual-machine.j2 | 2 ++ 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/core/src/epicli/cli/engine/providers/azure/InfrastructureBuilder.py b/core/src/epicli/cli/engine/providers/azure/InfrastructureBuilder.py index 23d0cdb798..2ddedb90ad 100644 --- a/core/src/epicli/cli/engine/providers/azure/InfrastructureBuilder.py +++ b/core/src/epicli/cli/engine/providers/azure/InfrastructureBuilder.py @@ -174,10 +174,6 @@ def get_vm(self, component_key, component_value, vm_config, network_interface_na vm.specification.network_interface_name = network_interface_name vm.specification.tags.append({'cluster': cluster_tag(self.cluster_prefix, self.cluster_name)}) vm.specification.tags.append({component_key: ''}) - if vm.specification.os_type == 'linux': - # For linux we dont need a PW since we only support SSH. We add something random for Terraform - # to run and later disable password access in Ansible. - vm.specification.admin_password = str(uuid.uuid4()) if vm_config.specification.os_type == 'windows': raise NotImplementedError('Windows VMs not supported jet.') pub_key_path = self.cluster_model.specification.admin_user.key_path + '.pub' diff --git a/core/src/epicli/data/azure/terraform/infrastructure/virtual-machine.j2 b/core/src/epicli/data/azure/terraform/infrastructure/virtual-machine.j2 index 3c3de1d4f8..1ebae7a91a 100644 --- a/core/src/epicli/data/azure/terraform/infrastructure/virtual-machine.j2 +++ b/core/src/epicli/data/azure/terraform/infrastructure/virtual-machine.j2 @@ -27,7 +27,9 @@ resource "azurerm_virtual_machine" "{{ specification.name }}" { os_profile { computer_name = "{{ specification.name }}" admin_username = "{{ specification.admin_username }}" + {%- if specification.os_type == "windows" %} admin_password = "{{ specification.admin_password }}" + {%- endif %} } {%- if specification.os_type == "linux" %} From 351913de322bf072240d09152d71d29348b24ed8 Mon Sep 17 00:00:00 2001 From: Luuk van Venrooij <11056665+seriva@users.noreply.github.com> Date: Thu, 20 Aug 2020 15:35:05 +0200 Subject: [PATCH 2/2] Update CHANGELOG-0.8.md --- CHANGELOG-0.8.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG-0.8.md b/CHANGELOG-0.8.md index 56198c5a68..89c1a4c3f1 100644 --- a/CHANGELOG-0.8.md +++ b/CHANGELOG-0.8.md @@ -9,3 +9,5 @@ - [#846](https://github.com/epiphany-platform/epiphany/issues/846) - Update Filebeat to v7.8.1 ### Fixed + +- Fix for changing Terraform templates between Epicli apply runs on Azure.