semaphore icon indicating copy to clipboard operation
semaphore copied to clipboard

[Feature Request] Accessing Facts with API

Open lemonka opened this issue 3 years ago • 3 comments

I believe there is no such possibility but I might be wrong https://ansible-semaphore.com/api/

lemonka avatar Feb 06 '22 09:02 lemonka

What facts do you mean?

fiftin avatar Feb 06 '22 09:02 fiftin

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] }}

lemonka avatar Feb 06 '22 09:02 lemonka

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.

andreas-marschke avatar Jan 30 '24 01:01 andreas-marschke