Automated Ubuntu 20.04 Template with GitLab CI/CD and vsphere-iso

Dear HashiCorp Community I need your help for understanding things.
I want to set up an automated Ubuntu 20.04 Template with a GitLab CI/CD in our vCenter.
So I configured a gitlab-runner with an own written packer Docker-Image (https://hub.docker.com/r/docker4bscg/packer) which should execute in the gitlab ci/cd my packer configs from the gitlab project. But the Problem now is, how do I expose the Packer HTTP Server which serves my cloud-init user-data/meta-data file? Or how do I make the subiquity config accessable via CI/CD over the Packer Gitlab Runner? Because the packer runs inside the Docker container, which got his own docker network.
I hope you guys understand my question(s) and can help me solving it.

Greetings.

It might be easiest to supply the cloud-init data via the cd_files option instead of the server, to avoid networking issues. See https://www.packer.io/docs/builders/vmware/iso#cd-configuration for details.

2 Likes

hey thank you for your advice, so I tried things out, but I don’t know how to set the boot autoinstall command, to get ubuntu to know that the user-data and meta-data files are inside the cd.
here is my code-snipped:

    "cd_files": ["{{template_dir}}/ubuntu-20.04/meta-data", "{{template_dir}}/ubuntu-20.04/user-data"],
    "cd_label": "cidata",
    
    "iso_paths": [
      "[ColoNord-ISOs] ISOs/ubuntu-20.04.1-live-server-amd64.iso"
    ],
    "boot_wait": "5s",
    "floppy_files": ["{{template_dir}}/preseed.cfg"],
    "boot_command": [
      "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
      "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
      "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
      "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
      "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
      "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
      "<wait><esc><wait><f6><wait><esc><wait>",
      "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
      "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
      "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
      "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
      "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
      "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
      "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
      "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
      "<bs><bs><bs>",
      "/casper/vmlinuz ",
      "initrd=/casper/initrd ",
      " ipv6.disable=1 autoinstall ",
      "ds=nocloud-net;seedfrom=/cidata/",
      "<enter>"
    ]

I think this is the follow-up thread for this topic. :slight_smile:

1 Like