自動化で Ansible を使用する
はじめる前に
Jira スペースの自動化を管理するには、次のような適切なスペース権限が必要です。
Company-managed spaces: You’ll need the Administer space and Browse space permissions for your space. Learn more about permissions for company-managed spaces
Team-managed spaces: You’ll need Administrator app access for your space. Learn more about permissions for team-managed spaces
To manage global automations, you’ll need the Administer Jira permission. Learn more about global permissions in Jira Cloud.
Ansible では、接続が正しく機能するように、次の設定が行われていることを確認してください。
Open up the
HTTPSport in the Ansible Automation controller. Read more about Ansible network ports and protocolsEnable X-origin requests for Automation in Ansible. Read how to enable X-original requests in Ansible
You’ll need to makeCORS_ORIGIN_ALLOW_ALL = Trueand add your Jira site's URL to allowed regexes, likeCORS_ALLOWED_ORIGIN_REGEXES = [r"<https://<your_jira_site>>.atlassian.net*",]If you use a firewall, allow the Atlassian IP address
[IP address]to ensure access to Ansible Automation Controller. Read more about Atlassian IP addresses and domains
自動化ルールを Ansible と統合する
You can use your existing application in Ansible to connect to Atlassian Automation. If you don’t have an application, create a new one. Read how to create an application in Ansible to get started. Use the details below while creating:
Redirect URIs: https://id.atlassian.com/outboundAuth/finish
Client Type: Confidential
Authorisation Grant Type: Authorisation CodeJira Service Management で、[自動化] に移動して [ルールを作成] を選択します。
Select the Ansible action for your rule. Launch job template in Ansible is the only available action at the moment.
[接続] を選択して、Ansible との接続を作成します。接続すると、自動化ルールによって他のツールや製品で変更を加えられるようになります。
使用する接続で、Atlassian Automation に接続したいアプリ情報を入力します。
アプリケーション名。Ansible 接続を簡単に識別できるように、一意の名前を付けてください。これはアプリケーションの名前である必要はありませんが、一意の識別子を付けてアプリケーション名を指定すると便利です。たとえば、Acme A や Acme B とします。ここで Acme はアプリケーション名、A と B は固有の値です。
クライアント ID。Ansible のアプリケーションのクライアント ID です。アプリケーションを作成した後に一度だけ表示されます。
クライアント シークレット。Ansible のアプリケーションのクライアント シークレットです。アプリケーションを作成した後に一度だけ表示されます。
Ansible Tower URL。これは通常、Ansible の Automation コントローラーを開いているときにブラウザのアドレス バーに表示される URL です。
[接続] を選択して接続の作成を完了します。
このアクションは、応答待ちをサポートします (Enterprise プランのみ)
有効にした場合、ルールは Ansible が 15 分以内に正常な応答を返した場合にのみ再開されます。それ以外の場合、ルールは失敗します。
障害応答の場合でもルールを再開するように設定できます。つまり、Ansible が 15 分以内に正常な応答を返さない場合でも、ルールは再開されます。
Ansible からペイロードにアクセスするには、{{ansibleJobTemplate.output}} スマート値を使用します。
この内容はお役に立ちましたか?