Create vagrant user on provisioning

I am working on a project where want to replace a small library of demonstration/labs with a git repo of vagrant files as well as just the base vagrant box for a virtual appliance.

The virtual appliance I am trying to automate for my lab use is a FortiGate and i currently have it in a configuration where i can reliably deploy boxes in vmware using vagrant, but I dont have the ability to create the vagrant user without activating the 14 day trial period timer due to the nuance of how the FortiGate VM is designed. I can reset the timer with a factory reset, but that erases my vagrant user and my "reset" admin password, forcing a brand new process of setting passwords once again.

When the VM is deployed, it has a default username of \`admin\` and a blank password. This is then requested upon first SSH to change the password.

What I am hoping to be able to do is when the VMs are first provisioned, it will build the VM, boot up, login with the username(admin) and blank password, change the password, and then from that point on either:

1. operate with that new username/password
2. create a new vagrant user/password/ssh-key combo during the original provisioning and leverage that account

Leave a Comment