Skip to content

Commit

Permalink
chore: rename the remaining this identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
Meysam Azad committed Feb 15, 2024
1 parent 18f938f commit 17aa3bf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions docs/codes/0001-azure-image-gallery/inventory.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ locals {
}

resource "local_sensitive_file" "ssh_private_key" {
content = tls_private_key.this.private_key_pem
content = tls_private_key.example.private_key_pem
filename = local.key_filepath
file_permission = "0400"
}
Expand All @@ -15,7 +15,7 @@ resource "local_file" "inventory" {
azure:
hosts:
azure-vm0:
ansible_host: ${azurerm_public_ip.this.ip_address}
ansible_host: ${azurerm_public_ip.example.ip_address}
ansible_user: adminuser
ansible_ssh_private_key_file: ${local.key_filepath}
ansible_ssh_common_args: '-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null'
Expand Down
14 changes: 7 additions & 7 deletions docs/codes/0001-azure-image-gallery/playbook.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
resource "null_resource" "bootstrap" {
connection {
type = "ssh"
host = azurerm_public_ip.this.ip_address
host = azurerm_public_ip.example.ip_address
user = "adminuser"
private_key = tls_private_key.this.private_key_pem
private_key = tls_private_key.example.private_key_pem
}

provisioner "local-exec" {
Expand All @@ -22,20 +22,20 @@ resource "null_resource" "bootstrap" {
}

provisioner "local-exec" {
command = "az vm deallocate --resource-group ${azurerm_resource_group.this.name} --name example-machine"
command = "az vm deallocate --resource-group ${azurerm_resource_group.example.name} --name example-machine"
}

provisioner "local-exec" {
command = "az vm generalize --resource-group ${azurerm_resource_group.this.name} --name example-machine"
command = "az vm generalize --resource-group ${azurerm_resource_group.example.name} --name example-machine"
}

triggers = {
vm_id = azurerm_linux_virtual_machine.this.id,
vm_id = azurerm_linux_virtual_machine.example.id,
}

depends_on = [
local_file.inventory,
azurerm_linux_virtual_machine.this,
azurerm_public_ip.this,
azurerm_linux_virtual_machine.example,
azurerm_public_ip.example,
]
}

0 comments on commit 17aa3bf

Please sign in to comment.