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!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
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.