Hacker News new | ask | show | jobs
by bazfoo 3810 days ago
I found myself doing the same thing for Ansible.

The problem I ran into was where I wanted to test service restarting in a systemd based environment. Older releases using sysvinit work perfectly fine.

3 comments

This is why you should check out systemd-nspawn. It was designed especially for this use case.

Also. If you're on upstart, give lxc a shot. We currently test our ansible scripts by deploying to lxc by giving each container a static IP in a bridged network to simulate our production environment. Just swap ansible inventory files. Works like a charm.

This gist works with test-kitchen to run systemd in a centos 7-based container.

It should be simple enough to adjust to run ansible.

https://gist.github.com/glenjamin/2d04e9c2a163c7848173

This is a major problem with the now-in-vogue use of Docker for testing this sort of thing, yes. They aren't replacements for a virtual machine, and testing against something that doesn't even resemble the deployment environment is wacky to me.