How to use a packer with a window file?

I have a firewall using a field on top of a virtual box with a script position.

Now I'm trying to use the packer to display the field after the submission.

However, I cannot find a builder to use the ".box" file that I already have. What am I doing wrong?

+5
source share
2 answers

I just got a solution to this tiny little problem (convert the vagrant.box file to .ova for use by the packer):

  • Create vm using the .box file as the base. I use this Vagrantfile , with the opscode-centos-7.0 field:
  $ provisioning_script = << PROVISIONING_SCRIPT
     adduser packer
     echo "packer" |  passwd packer --stdin
     echo "packer ALL = (ALL: ALL) NOPASSWD: ALL"> /etc/sudoers.d/packer
     PROVISIONING_SCRIPT

     Vagrant.configure (2) do | config |
       config.vm.box = "opscode-centos-7.0"
       config.ssh.insert_key = false
       config.vm.provider "virtualbox" do | v |
         v.name = "packer-base"
       end
       config.vm.provision: shell, inline: $ provisioning_script
     end
  • run vagrant up
  • run vagrant halt
  • run vboxmanage export --ovf20 -o packer-base.ova packer-base
  • run vagrant destroy

This also creates the packer user with a default password, so that the packer can easily connect to the instance to do something. Also, pay attention to the insert_key parameter, which will prevent replacing the default swear key with a secure one and allow subsequent settings of the vagabonds to correctly connect via SSH to new images (after the package is completed).

+3
source

If you want to create a firewall that works with the provider's virtual server, look here .

However, input requires iso or ovf , not a firewall.

Check out these templates to start using the virtual machine builder with the packer.

Be sure to run a post-processor to convert the virtual vm box to a stroller window.

0
source

Source: https://habr.com/ru/post/1215722/


All Articles