weareinteractive.newrelic

Ansible weareinteractive.newrelic ロール

Build Status Galaxy GitHub Tags GitHub Stars

weareinteractive.newrelicAnsible ロールで、以下のことができます:

  • newrelic をインストール
  • newrelic を設定
  • サービスを設定

注:

Ansible Galaxy が 組織 をサポートするようになったため、このロールは franklinkim.newrelic から weareinteractive.newrelic に移動しました!

インストール

ansible-galaxy を使用する:

$ ansible-galaxy install weareinteractive.newrelic

requirements.yml を使用する:

- src: weareinteractive.newrelic

git を使用する:

$ git clone https://github.com/weareinteractive/ansible-newrelic.git weareinteractive.newrelic

依存関係

  • Ansible >= 2.4

変数

このロールのすべてのデフォルト変数のリストで、defaults/main.ymlにもあります。

---
#
# newrelic_license_key: あなたのキー

# ユーザー名
newrelic_user: newrelic
# ユーザーグループ
newrelic_group: newrelic
# ユーザーに追加するグループ
newrelic_groups: []
# サーバーモニターのログメッセージを保存するファイルの名前
newrelic_logfile: /var/log/newrelic/nrsysmond.log
# ログファイルに必要な詳細レベル
newrelic_loglevel: info
# NFSクライアントの統計収集を無効にするには true に設定
newrelic_disable_nfs: yes
# Dockerコンテナの統計収集を無効にするには true に設定
newrelic_disable_docker: yes
# ブート時に起動
newrelic_service_enabled: yes
# 現在の状態: started, stopped
newrelic_service_state: started
# デフォルトのホスト名を使用する。デフォルトのホスト名を上書きするには値を設定
newrelic_override_hostname:
# label_type/label_valueの組み合わせ: label_type:label_value
newrelic_labels:
# 使用するプロキシサーバー(例: proxy-host:8080)
newrelic_proxy:
# Dockerメモリを修正するオプション(参照:https://discuss.newrelic.com/t/wrong-path-to-cpu-and-memoy-data/36177)
newrelic_cgroup_style:

ハンドラー

これらは handlers/main.yml に定義されているハンドラーです。

---

- name: newrelic を再起動
  service:
    name: newrelic-sysmond
    state: restarted
  when: newrelic_service_state != 'stopped'

使用方法

これは例のプレイブックです:

---

- hosts: all
  become: yes
  roles:
    - weareinteractive.newrelic
  vars:
    newrelic_license_key: ab2fa361cd4d0d373833cad619d7bcc424d27c16
    # Docker環境でサービスを開始しない
    newrelic_service_state: stopped
    newrelic_service_enabled: false

テスト

$ git clone https://github.com/weareinteractive/ansible-newrelic.git
$ cd ansible-newrelic
$ make test

コントリビューション

正式なスタイルガイドはないため、既存のコーディングスタイルを維持するように注意してください。新しい機能や変更された機能に対してはユニットテストと例を追加してください。

  1. フォークする
  2. 特徴ブランチを作成する(git checkout -b my-new-feature
  3. 変更をコミットする(git commit -am 'Add some feature'
  4. ブランチにプッシュする(git push origin my-new-feature
  5. 新しいプルリクエストを作成する
  • 注: README.md ファイルを更新するには、以下をインストールして実行してください:*
$ gem install ansible-role
$ ansible-role docgen

ライセンス

Copyright (c) We Are Interactive, MITライセンスの下で。

プロジェクトについて

Installs and configure newrelic

インストール
ansible-galaxy install weareinteractive.newrelic
ライセンス
mit
ダウンロード
114.4k