If I have some Ansible playbooks as part of source code repository. And if do not want to do all this work in Foreman UI. I would like to configure Foreman in such a way so that it can pick these playbooks and inventory files from my git repo and run them in the managed host. Is this feature available?
There is not yet a feature that supports importing git repositories into Foreman and support their playbooks.
It is definitely something to look into, but more as a way to migrate such git repositories to Foreman and from then on manage playbooks and roles from within foreman.
I have the same situation at the moment and keep my playbooks in git repositories, which follow best practices suggest[1]. Those are simply checked out on disk and a job pulls and runs them scheduled. Ansible has reporting to Foreman enabled to have the hosts states.
There is work in pulp-3 to support ansible files directly. Here is a recent
video demo[1]. The pulp devs are aware of the importance of git for
managing these files but more feedback and encouragement would be good. I
hope the foreman-ansible devs are looking to integrate playbook/role
sources with existing katello features such as the file repo type and
future work.