hashicorp / packer-plugin-oracle

Packer plugin for Oracle Builder
https://www.packer.io/docs/builders/oracle
Mozilla Public License 2.0
9 stars 13 forks source link

Not able to authenticate using config file on windows while running packer build #20

Open samarved opened 3 years ago

samarved commented 3 years ago

Issues on GitHub are intended to be related to bugs or feature requests, so we recommend using our other community resources instead of asking here if you have a question.

I have written below packer configuration file

source "oracle-oci" "example" { availability_domain = "fGpl:US-ASHBURN-AD-1" base_image_ocid = "ocid1.image.oc1.iad.aaaaaaaas2dadadadadsadtjobv2pgprzvsvdttho3a" image_name = "OCI-Custom-Image" shape = "VM.Standard2.1" ssh_username = "opc" access_cfg_file = "C:\Users\Anandkumar\.oci\config" subnet_ocid = "ocid1.subnet.oc1.iad.aaaaaaaafonrdwsc6zvaswtwq4dsmilsx67d6q" }

build { sources = ["source.oracle-oci.example"]

provisioner "shell" { inline = ["echo Configuration is going to Start", "sudo yum install bind-utils" ] } }

When I run packer build I am getting the below error. Packer version 1.7.4

PS C:\Users\Anandkumar\OneDrive - Personal\Hashicorp Examples\Packer> packer build .\build.pkr.hcl oracle-oci.example: output will be in this color.

==> oracle-oci.example: Creating temporary ssh key for instance... ==> oracle-oci.example: Creating instance... ==> oracle-oci.example: Problem creating instance: Service error:NotAuthorizedOrNotFound. Authorization failed or requested resource not found.. http status code: 404. Opc request id: 50dfe82afe71836965e6b7d29cf89f9a/4B6825337CBA98FF424BED9DB7AAC466/D068EFB76A5CBE95E943B0DE186F9985 Build 'oracle-oci.example' errored after 2 seconds 126 milliseconds: Problem creating instance: Service error:NotAuthorizedOrNotFound. Authorization failed or requested resource not found.. http status code: 404. Opc request id: 50dfe82afe71836965e6b7d29cf89f9a/4B6825337CBA98FF424BED9DB7AAC466/D068EFB76A5CBE95E943B0DE186F9985

==> Wait completed after 2 seconds 126 milliseconds

==> Some builds didn't complete successfully and had errors: --> oracle-oci.example: Problem creating instance: Service error:NotAuthorizedOrNotFound. Authorization failed or requested resource not found.. http status code: 404. Opc request id: 50dfe82afe71836965e6b7d29cf89f9a/4B6825337CBA98FF424BED9DB7AAC466/D068EFB76A5CBE95E943B0DE186F9985

==> Builds finished but no artifacts were created. PS C:\Users\Anandkumar\OneDrive - Personal\Hashicorp Examples\Packer>

I am able to run OCI CLI commands from windows command prompt without any issues. I am not getting why its not getting authenticated using confi file when running packer build command.

Djelibeybi commented 3 years ago

Can you run with the -debug flag so we can get more detail on where exactly it's failing?