Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9336847
D8168.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D8168.id.diff
View Options
diff --git a/azure/terraform/admin.tf b/azure/terraform/admin.tf
--- a/azure/terraform/admin.tf
+++ b/azure/terraform/admin.tf
@@ -153,7 +153,12 @@
ip_address = azurerm_network_interface.backup-interface[each.key].private_ip_address,
facter_subnet = "azure_euwest"
facter_deployment = "admin"
- disk_setup = {}
+ disk_setup = {
+ swaps = [{
+ filepath = "/mnt/swapfile"
+ size = "14336" # GB
+ }]
+ }
})
destination = var.firstboot_script
diff --git a/azure/terraform/templates/firstboot.sh.tpl b/azure/terraform/templates/firstboot.sh.tpl
--- a/azure/terraform/templates/firstboot.sh.tpl
+++ b/azure/terraform/templates/firstboot.sh.tpl
@@ -49,6 +49,18 @@
uuid=$(blkid -o value -s UUID ${disk.base_disk}1)
echo "UUID=\"$uuid\" ${disk.mountpoint} ${disk.filesystem} ${disk.mount_options} 0 0" >> /etc/fstab
%{ endif }
+
+%{ for swap in try(disk_setup.swaps, []) }
+%{ if try(swap.filepath, "") != "" }
+# Create a swapfile
+dd if=/dev/zero of=${swap.filepath} bs=1M count=${swap.size}
+# enable swap
+chmod 600 ${swap.filepath}
+mkswap ${swap.filepath}
+swapon ${swap.filepath}
+# Reference it in /etc/fast so it's persistent across reboots
+echo "${swap.filepath} swap swap defaults 0 0" >> /etc/fstab
+%{ endif }
%{ endfor }
%{ if length(try(disk_setup.raids, [])) != 0 }
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Jul 3 2025, 7:46 AM (10 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3222355
Attached To
D8168: azure indexer workers: Add swap on nodes when provisioning
Event Timeline
Log In to Comment