By andresogando
I had created a packer image that runs a shell script after booting a droplet using ubuntu.
The problem is that if I use that snapshot it will create droplets with the same data from the snapshot (obviously because is a “copy of another droplet”)
what I want to achieve is to run the script each time a droplet is created from that “snapshot” not to have the same data propagated over every droplet.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Heya @andresogando,
I’m not sure I understand you entirely so let me try to reiterate and you can confirm or deny if It’s correct:
You’re looking/trying to create a process where a script runs each time a new droplet is created from a snapshot in Packer with Ubuntu, is that correct?
You’ll need to set up your script to execute as part of the droplet’s startup process. This way, every time a new droplet is created from the snapshot, the script will run afresh, allowing for dynamic data handling or configuration rather than just replicating the snapshot’s state.
Let me know if that is what you need to achieve or if I’m mistaken please provide a more detailed explanation and we can take it from there.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.