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回答
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.

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ