eihli / hashistack-starterpack

Vagrant and Ansible provisioning cluster of Consul and Nomad with Envoy.
6 stars 0 forks source link

bootstrap.sh is in wrong location #1

Open joshuacox opened 2 years ago

joshuacox commented 2 years ago

following the example:

$ packer build -debug example-image.pkr.hcl
Error: Failed preparing provisioner-block "shell" ""

  on example-image.pkr.hcl line 12:
  (source code not available)

1 error(s) occurred:

* Bad script 'bootstrap.sh': stat bootstrap.sh: no such file or directory

Debug mode enabled. Builds will not be parallelized.

==> Wait completed after 1 microsecond

==> Builds finished but no artifacts were created.

Moving that file into the directory with the pkr.hcl file does not help either:

$ cp ../bootstrap.sh ./

$ packer build example-image.pkr.hcl
vagrant.example: output will be in this color.

==> vagrant.example: Creating a Vagrantfile in the build directory...
==> vagrant.example: Adding box using vagrant box add ...
    vagrant.example: (this can take some time if we need to download the box)
==> vagrant.example: Calling Vagrant Up (this can take some time)...
==> vagrant.example: destroying Vagrant box...
==> vagrant.example: Deleting output directory...
Build 'vagrant.example' errored after 6 seconds 825 milliseconds: error: SSH Port was not properly retrieved from SSHConfig.

==> Wait completed after 6 seconds 825 milliseconds

==> Some builds didn't complete successfully and had errors:
--> vagrant.example: error: SSH Port was not properly retrieved from SSHConfig.

==> Builds finished but no artifacts were created.
joshuacox commented 2 years ago

Also, it is unclear how to update the dev.ini file, is it supposed to point to the repo or the vagrant folder in the infra directory of the repo?

for example:

sed -i 's!\.vagrant!/tmp/hashistack-starterpack/.vagrant!' dev.ini

or

sed -i 's!\.vagrant!/tmp/hashistack-starterpack/infra/vagrant!' dev.ini

in either case it fails very similarly:

$ packer build example-image.pkr.hcl
vagrant.example: output will be in this color.

==> vagrant.example: Creating a Vagrantfile in the build directory...
==> vagrant.example: Adding box using vagrant box add ...
    vagrant.example: (this can take some time if we need to download the box)
==> vagrant.example: Calling Vagrant Up (this can take some time)...
==> vagrant.example: destroying Vagrant box...
==> vagrant.example: Deleting output directory...
Build 'vagrant.example' errored after 909 milliseconds 158 microseconds: error: SSH Port was not properly retrieved from SSHConfig.

==> Wait completed after 909 milliseconds 185 microseconds

==> Some builds didn't complete successfully and had errors:
--> vagrant.example: error: SSH Port was not properly retrieved from SSHConfig.

==> Builds finished but no artifacts were created.
joshuacox commented 2 years ago

Also there is no generic directory anywhere in this repo:

$ find . -type d -name 'generic'

though it is indeed referenced in the pkr.hcl file and the readme:

$ grep -ir generic *
infra/vagrant/example-image.pkr.hcl:  source_path = "generic/ubuntu2004"
README.org:Our Packerfile starts from ~generic/ubuntu2004~ and then runs the code in ~bootstrap.sh~ to provision a fresh box that all of our agents use.
eihli commented 2 years ago

Thanks for the detailed info. I appreciate you taking the time to try it out and document what's broken. I should have left a note in the README that this repository is in an unfinished state. Your notes will serve as a good guide for where I should start when I have the time to pick this back up.