Skip to content
This repository has been archived by the owner on Feb 13, 2021. It is now read-only.

Centos8 image creation through packer on azure results in to errors #274

Open
zurrehma opened this issue Aug 27, 2020 · 0 comments
Open

Comments

@zurrehma
Copy link

Can somebody tell me what I am doing wrong here as I am unable to create the image? actually the commands, when I run on my host Centos machine, works fine but when I execute the same commands through packer result into error.
JSON file:

{
  "builders": [{
    "type": "azure-arm",
  
    "client_id": "{{user `azure-client-id`}}",
    "client_secret": "{{user `azure-client-secret`}}",
    "tenant_id": "{{user `azure-tenant-id`}}",
    "subscription_id": "{{user `azure-subscription-id`}}",
    
    "managed_image_resource_group_name": "{{user `azure-resource-group`}}",
    "managed_image_name": "CentOS8-Packer",
  
    "os_type": "Linux",
    "image_publisher": "OpenLogic",
    "image_offer": "CentOS",
    "image_sku": "8_2-gen2",

    "location": "{{user `azure-region`}}",
    "vm_size": "{{user `vm-size`}}"
  }],

  "provisioners": [
    {
      "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'",
      "script":"ami-script.sh"
      "type": "shell"
    }
  ]
}

ami-script.sh content:

#!/bin/bash -e
dnf update -y
dnf install terminator xrdp -y

Error:

image
image

Also posted here

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant