<- Back
Comments (22)
- _mig5Here's a video of JinjaTurtle, the companion tool that converts configs to Jinja2 templates and Ansible vars:https://asciinema.org/a/765293Enroll will automatically make use of jinjaturtle if it's on the $PATH, to generate templates.
- bcyeThis looks like a great way to learn Ansible too. Instead of learning alongside random examples, you can setup your server and see how it would look like in Ansible.Awesome stuff!
- novoreorxI wonder if Nix has similar tools, as it is famous for declarative system management, which is quite suitable for server provisioning.
- QuarrelVery cool.I just saved the state of my WSL2 instance, pushed it to github. Amazingly simple.FWIW, I was required to add the --harvest, which your quick start seems to be missing?ie I used:uvx enroll single-shot --harvest ./harvest --out ./ansible
- neilvThis is a great idea. I have done this manually, and it was a lot of work.Even with a tool, people will still have to understand the output, enough that they can spot situations like "this part doesn't make sense at all", "that bit isn't static", "holy crud, there's an unsecured secret", "this part suggests a dependency on this other server we didn't know was involved, and which the tool doesn't investigate".
- ImustaskforhelpBravo, I will play with it. I haven't played with ansible till now but I know that its related to automation.If something can make ansible easier for me to try out like this tool while being pragmatic, I will give this a try someday thank you!How accurate does this tool end up becoming though? Like can I just run some bunch of commands to setup a server and then use this with ansible?Would this end up being a good use for it or would I just re-invent something similar to cloud-init on wrong abstraction. (On all fairness, one thing troubling me about cloud-init is that I would need to probably have a list of all commands that I want to run and all changes which sometimes if history command might have some issues or you do end up writing files etc. ends up being a little messy)I haven't played that much with both cloud-init and ansible either but I am super interested to know more about enroll and others as well as I found it really cool!
- barbazooThis is a fantastic idea. I can imagine using this to pull in any manual changes I might have made to the server because I’m not the most disciplined person.
- proxysnaGenuenly the thing i've been dreaming about for a while. Nice work.
- nightshift1This makes me think of the now defunct https://github.com/SUSE/machinery
- smoyerI have quite a few machines that were constructed using Ansible ... When I get a chance, I'll reverse then and compare the results to the IaC that created them
- westurnerCould it also detect changed package files; if there are per-package-file checksums like with `debsums` and `rpm -V`?Does it check extended filesystem labels with e.g. getfacl for SELinux support?I've also done this more than a few times and not written a tool.At least once I've scripted better then regex to convert a configuration file to a Jinja2 templated configuration file (from the current package's default commented config file with the latest options). And then the need is to diff: non-executable and executable guidelines, the package default config (on each platform), and our config.Sometimes it's better not to re-specify a default config param and value, but only if the defaults are sane on every platform. Cipher lists for example.P2V (physical to virtual) workflows don't result in auditable system policy like this.Most of the OS and Userspace packages backed up in full system images (as with typical P2V workflows) are exploitably out of date in weeks or months.To do immutable upgrades with rollback, Rpm-ostree distros install the RPM packages atop the latest signed immutable rootfs image, and then layer /etc on top (and mounts in /var which hosts flatpaks and /var/home). It keeps a list of packages to reinstall and it does a smart merge of /etc. Unfortunately etckeeper (which auto-git-commits /etc before and after package upgrades) doesn't yet work with rpm-ostree distros.Ansible does not yet work with rpm-ostree distros. IIRC the primary challenge is that ansible wants to run each `dnf install` individually and that takes forever with rpm-ostree. It is or is not the same to install one long list of packages individually or to install multiple groups of packages in the same sequence. It should be equivalent if the package install and post-install scripts are idempotent, but is not equivalent if e.g. `useradd` is called without an explicit UID in package scripts which run as roo, too.I wrote a PR to get structured output (JSON) from `dnf history`, but it was for dnf4.From https://news.ycombinator.com/item?id=43617363 :> upgrading the layered firefox RPM without a reboot requires -A/--apply-live (which runs twice) and upgrading the firefox flatpak doesn't require a reboot, but SELinux policies don't apply to flatpaks which run unconfined FWIU.Does it log a list of running processes and their contexts; with `ps -Z`?There are also VM-level diff'ing utilities for forensic-level differencing.
- tecoholicVery cool idea and kudos for building and making the idea into a reality.
- xystpoor man’s nixOS
- yowlingcatVery cool! Managing ones boxes as cattle and not pets almost always seems like a better idea in retrospect but historically it is easier said than done. Moreover, I like the idea of being able to diff a box's actual state from a current Ansible system to verify that it actually is as configured for further parity between deployed/planned.
- olekspin[dead]