Inject license (ghl) automatically during installation

Hello guys,

I am trying to generate an image with GHE (GitHub Enterprise) on it using packer + customized configurations, like hostname, authentication, LDAP host…

My goal is to generate images ready to go for lab tests inside AWS, Vagrant, OpenStack and VMware. Spin, perform a few tests, destroy.

GHE installation options:

https://enterprise.github.com/releases/2.21.3/download

GitHub on-premises

  • OVA
  • VHD
  • QCOW2

GitHub in the Cloud

  • AWS
  • Azure
  • GCP

However, once it starts, it has an initial step to add the SSH key… without this step, I am not able to access ssh into this machine. It means that using packer, it stuck on the “ssh_username”: “xxxx”.

Do you guys know a solution for it? I believe with Terraform; I will have the same problem.

This is my current packer code:

https://gist.github.com/rmarcandier/0e8233e0fe8c4e52a16029fb94f83848

Regards

RG

Hi @rmarcandier! :wave:

I can see that you also opened a ticket with Enterprise Support. I’ll share the answer you got here so that other members of the community can see it!

We recommend utilizing our Management Console API for your use case, specifically the “Add an authorized SSH key” endpoint.

The entire process can likely be automated through the Management Console API endpoints, including the license process, and other settings.

We can’t give examples of the full automation, as it’s possible there are unique platform-specific or other edge case constraints, but you should be able to use the Get settings endpoint to get a blob of JSON with your current settings, make changes to the JSON and then set the settings again.