Ansible Galaxy has what you’re looking for, and you can install them directly from the command line.
- 0 Posts
- 3 Comments
Last@reddthat.comto Selfhosted@lemmy.world•Ansible Playbook - How do I reverse engineer a running system?English51·3 days agoTreat your current setup as your production server. Clone it first, and avoid making any changes directly to production. Any planned changes should ideally be tested on your clone or a pre-production environment first.
As far as I know, there’s no automated way to scan your existing system and generate Ansible playbooks for you. It’s a good habit to document every change you make to a system, ideally in a wiki or something similar, so you can refer back to it later. This is usually done in business environments, but it can be especially helpful if you haven’t run into a situation like this before.
For home use, I like to find roles or collections for common tasks on Ansible Galaxy or GitHub. These are often maintained by others and usually support multiple distributions. The downside is that they might not work for you unless you’re using a mainstream distro like Ubuntu or Debian.
If I were you, I’d make a list of all the services you need (Docker, NGINX, etc.), then search for roles on Ansible Galaxy sorted by download count. Use those to build a fresh server, and try to export your data from the old one to the new one. This is usually the easiest and least time-consuming approach, assuming your distributions are compatible.
Unless you’re genuinely interested in infrastructure automation, writing playbooks by hand will be tedious and time-consuming. Save that as a last resort.
Everything this guy makes is really well made. I had the pleasure of working with him many years ago, and he’s just as kind in person as he seems in his videos.