I am new to Ansible and trying to learn how it might work in my environment. I was wondering if there was a mechanism whereby one could generate an Ansible config for an already running machine that was not built under Ansible? In other words, I would like to convert my existing non-Ansible managed infrastructure to be managed by Ansible. A sane starting place would seem to be some method to convert my existing vm’s to Ansible without a bunch of “manual” work.
My apologies if this is a FAQ but I could not find anything on the topic when I searched for it.
Thanks!
Hi Robert,
Let me try to answer your question as I also just got into ansible for the past two or so weeks.
Ansible is agentless therefore you don’t need to add anything to your existing infrastructure in order use it, this is one feature that has really made me dig in more into it. SSH access for me, is all I need.
My starting point was to split my hosts file into various catergories ( webservers, dbservers, mails etc) of the existing infrastructure I am managing. I have since then run simple playbooks like getting os details using the “setup” module.
I have had a good start with it and I already foresee so many possibilities.
Regards,
David.
How in heaven’s name would any tool know what you built, how you built it, and how to recreate it ? That’s just fantasy-land. There are an infinite number of ways of getting a system setup from rpms or tgz or git pulls or hand-configuring etc.
You can easily convert a hand-built system to a ansible-configured one, but you need to do the heavy lifting at least once.