Category: ansible

Instead of providing some solution I will lay out here the problem and some thoughts about it. The usual ‘cloud-native’ approach is to create instances from any automated provision system (AWS, openstack, you name it) and to use them to form inventory for Ansible.

It sounds somewhere between silly and strange, but hear me out: Ansible supports multiple inventories, and you can provide ‘meat’ (groups and variables together with hostnames) in one inventory, and bare bones (list of hosts and ansible_host variable) in another.

Nevertheless there is a certain demand for ‘dynamic provision’: guys doing development may want to have a playground to mess with, CI want own a set of servers to torture them with tests.

There are cases you want to switch between ‘copies’ of different productions, but nevertheless, you want to keep those intricate nuances intact.

Related Articles