this post was submitted on 31 May 2025
57 points (95.2% liked)

Selfhosted

61512 readers
1319 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

Detailed Rules Post

  1. Be civil.

  2. No spam.

  3. Posts are to be related to self-hosting.

  4. Don't duplicate the full text of your blog or readme if you're providing a link.

  5. Submission headline should match the article title.

  6. No trolling.

  7. Promotion posts require active participation, with an account that is at least 30 days old. F/LOSS without a paywall has exceptions, with requirements. See the rules link for details. Tags [CBH] or [AIP] are required, see the links in Rule 8 for details.

  8. AI-related discussions and AI-involved promotional posts have additional requirements for tagging, as noted in Rule 7 and the AI & Promotional Post Expanded Rules post, and find example disclosures here.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 3 years ago
MODERATORS
 

I have a few VMs and PMs around the house that I'd setup over time and I'd now like to rebuild some, not to mention just simplify the whole lot.

How the hell do I get from a working system to an equivalent ansible playbook without many (MANY) iterations of trial & error - and potentially destroying the running system??

Ducking around didn't really show much so I'm either missing a concept / keyword, or, no-one does this.

Pointers?

TIA

you are viewing a single comment's thread
view the rest of the comments
[–] bushvin@lemmy.world 18 points 1 year ago (2 children)

I would copy the existing system onto a new system:

  1. Update system to the latest packages
  2. Create a new base system using the same distro
  3. Check which packages are not on the new system, add them to your playbook
  4. Install packages on new system
  5. This will take some time. Run a find of all files and pass them to md5sum or sha512sum to get a list of files with their checksum. Compare the list from the old system to the new system.
  6. Update your playbook with these findings. Template is probably the way to go, Lineinfile might be good as well, use copy if nothimg else works.
  7. Check firewall settings and update your playbook.

Anyhow this will take some iterations, but while you have a copy of your ‘production’ system, you can test on your ‘test’ machine until you have the same functionality.

[–] Cyber@feddit.uk 11 points 1 year ago (1 children)

Hmm, that's not a bad shout actually...

I can fire up VMs to replicate the real system and maybe (depending on space) keep them as a testbed for future mods.

Thanks, good idea.

[–] bushvin@lemmy.world 1 points 1 year ago

I have my moments… 😉 Feel free to pm me if you need more advice.

[–] WhyJiffie@sh.itjust.works 2 points 1 year ago

oh the find with the hash sum is good advice! I would have done this but manually, maybe with the double commander sync dirs tool.

but also, for configs this might be the best time to move your custom config to ordered dropin files for all things that support it.