LoginSignup
1
1

More than 5 years have passed since last update.

AnsibleでNew RelicにDeployの通知をする

Posted at

New Relic は無料版でもいつデプロイしたかどうかを記録する事ができます。
(参考NewRelicページ)

image

Ansibleではnewrelic_deploymentを使えば簡単にできます。
以下は抜粋ですが、こんな風にすればいけます。
なお、環境変数にNEWRELIC_API_KEYは設定しています。

  - name: checkout repository
    git: repo={{ repository }}
         dest={{ dest }}
         version={{ branch }}
         accept_hostkey=yes
    register: gitresult
  - name: notify deployment to New Relic
    newrelic_deployment: token={{ lookup('env', 'NEWRELIC_API_KEY') }}
                         application_id={{ newrelic_app_id}}
                         revision={{ gitresult.after }}
                         description={{ branch}}

参考

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1