Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4740b02

Browse files
phorcys420aslilac
authored andcommitted
chore(examples/templates/azure-linux): migrate tohashicorp/cloud-init provider (#15785)
1 parent695113b commit4740b02

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

‎examples/templates/azure-linux/main.tf

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ terraform {
66
azurerm={
77
source="hashicorp/azurerm"
88
}
9+
cloudinit={
10+
source="hashicorp/cloudinit"
11+
}
912
}
1013
}
1114

@@ -167,12 +170,24 @@ module "jetbrains_gateway" {
167170

168171
locals {
169172
prefix="coder-${data.coder_workspace_owner.me.name}-${data.coder_workspace.me.name}"
173+
}
174+
175+
data"cloudinit_config""user_data" {
176+
gzip=false
177+
base64_encode=true
170178

171-
userdata=templatefile("cloud-config.yaml.tftpl", {
172-
username="coder"# Ensure this user/group does not exist in your VM image
173-
init_script=base64encode(coder_agent.main.init_script)
174-
hostname=lower(data.coder_workspace.me.name)
175-
})
179+
boundary="//"
180+
181+
part {
182+
filename="cloud-config.yaml"
183+
content_type="text/cloud-config"
184+
185+
content=templatefile("${path.module}/cloud-init/cloud-config.yaml.tftpl", {
186+
username="coder"# Ensure this user/group does not exist in your VM image
187+
init_script=base64encode(coder_agent.main.init_script)
188+
hostname=lower(data.coder_workspace.me.name)
189+
})
190+
}
176191
}
177192

178193
resource"azurerm_resource_group""main" {
@@ -275,7 +290,7 @@ resource "azurerm_linux_virtual_machine" "main" {
275290
sku="20_04-lts-gen2"
276291
version="latest"
277292
}
278-
user_data=base64encode(local.userdata)
293+
user_data=data.cloudinit_config.user_data.rendered
279294

280295
tags={
281296
Coder_Provisioned="true"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp