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?

已提問 1 年前檢視次數 305 次
1 個回答
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
已回答 1 年前
  • @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.

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南