semaphore
semaphore copied to clipboard
[Feature Request] Accessing Facts with API
I believe there is no such possibility but I might be wrong https://ansible-semaphore.com/api/
What facts do you mean?
https://docs.ansible.com/ansible/latest/user_guide/playbooks_vars_facts.html#ansible-facts
I was wondering would it be possible to get JSON with something similar
API/project/{project_id}/facts/{hostname}/ will return {{ ansible_facts }}
API/project/{project_id}/facts/{hostname}/branch1/branch2 will return {{ ansible_facts[branch1][branch2] }}
That would require extension of semaphore beyond executing Ansible but also keeping track of the facts being generated by ansible, which would be only an unstructured dataset.
Instead, as this would come with a myriad of added complexity depending on your setup etc. I instead suggest for your setup to define a Facts dumping playbook and use it from semaphore's playbook log.
I think this would otherwise create too much complexity.