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.

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则