How do I trigger a Ansible on an EC2 instance from our hosted react site?

0

I have a react site which allows us to store specific device information, and we also have created an ec2 instance which takes that data and allows us to configure the device. We are trying to create a way to run the playbook within the EC2 using a button on the website, however currently drawing a blank on how to do so.

If possible can any one help at all?

posta un anno fa305 visualizzazioni
1 Risposta
1

Hi,

I believe this depends on the Ansible product you are implementing, i.e. if you have Tower or other third party utilities. Another factor is where you are hosting your playbooks.

This piece of Red Hat documentation may be the answer you're looking for.

Worth noting: Ansible is written in a way that it assumes your playbooks are local using Python's os.path module, but limitations may also depend on what you're trying to accomplish with your playbook(s). If you are using Tower, here's the API integration reference documentation. You could also use Tower's webui to control playbook runs, if that's a feasible alternative.

mraml
con risposta un anno fa
  • @mraml We were try to do it without using third party utilities and doing it solely on AWS. The one idea I had was to connect the button to aws run command and have that run the script on AWS when triggered. But with that I struggle to make it trigger with the details of a specific user, or even how to trigger the run command from the button.

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande