Ansible で Atlassian Automation を使用する
はじめる前に
プロジェクトの自動化を管理するには、次のような適切なプロジェクト権限が必要です。
Company-managed projects: You’ll need the Administer projects and Browse projects permissions for your project. Learn more about permissions for company-managed projects
Team-managed projects: You’ll need Administrator access for your project. Learn more about permissions for team-managed projects
To manage global automations, you’ll need the Administer Jira permission. Learn more about global permissions in Jira Cloud.
Ansible では、接続が正しく機能するように、次の設定が行われていることを確認してください。
Open up the
HTTPS
port 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 = True
and 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 CodeIn your Jira Service Management, go to Automation and select Create rule.
Select the Ansible action for your rule. Launch job template in Ansible is the only available action at the moment.
Select Connect to create a connection with Ansible. Connections allow your automation rules to make changes in other tools and products.
使用する接続で、Atlassian Automation に接続したいアプリ情報を入力します。
Application name. Provide a unique name to easily identify your Ansible connection. This doesn’t have to be the name of the application, but mentioning the application name with a unique identifier can help. For example, Acme A or Acme B, where Acme is the name of the application and A/B are the unique values.
Client ID. The client ID of the application in Ansible. It’s shown only once after you create an application.
Client secret. The client secret of the application in Ansible. It’s shown only once after you create an application.
Ansible Tower URL. This is usually the URL from the address bar of your browser while you’re in the Ansible Automation Controller.
Select Connect to complete creating your connection.
This action supports waiting for response (only for Enterprise plans)
有効にした場合、ルールは Ansible が 15 分以内に正常な応答を返した場合にのみ再開されます。それ以外の場合、ルールは失敗します。
障害応答の場合でもルールを再開するように設定できます。つまり、Ansible が 15 分以内に正常な応答を返さない場合でも、ルールは再開されます。
Ansible からペイロードにアクセスするには、{{ansibleJobTemplate.output}}
スマート値を使用します。
この内容はお役に立ちましたか?