geerlingguy.elasticsearch-curator

Ansible ロール: Elasticsearch Curator

CI

これは、RedHat/CentOS または Debian/Ubuntu に Elasticsearch Curator をインストールするための Ansible ロールです。

必要条件

特にありませんが、どこかで Elasticsearch が動いていると非常に便利です!

RedHat/CentOS では、python-pip パッケージをインストールできるように EPEL リポジトリが設定されていることを確認してください。EPEL リポジトリは、プレイブックのロールに geerlingguy.repo-epel を追加することでインストールできます。

ロール変数

使用可能な変数は以下にリストされています。デフォルト値も含まれます(defaults/main.yml を参照):

elasticsearch_curator_version: ''

インストールする elasticsearch-curator のバージョンです。使用可能なバージョンは Python Package Index にリストされています。デフォルトではバージョンは指定されていないため、最新バージョンがインストールされます。

elasticsearch_curator_cron_jobs:
  - name: "Elasticsearch curator actions を実行します。"
    job: "/usr/local/bin/curator ~/.curator/action.yml"
    minute: 0
    hour: 1

cron ジョブのリストです。通常、action.yml に定義されたアクションを使用して 1 つの cron ジョブを実行しますが、cron ジョブを分けたり、curator_cli を使用してアクションを個別に実行することもできます。minutehourdayweekdaymonth のいずれかを cron ジョブに追加できます。明示的に設定されていない値はデフォルトで * になります。また、state を使用してジョブが present または absent であるべきかを定義できます。

elasticsearch_curator_config_directory: ~/.curator

Curator の設定(およびアクションファイル)が保存されるディレクトリです。

elasticsearch_curator_hosts:
  - 'localhost:9200'
elasticsearch_curator_http_auth: ''

これらの変数はデフォルトの elasticsearch_curator_yaml で使用されるパラメータを制御します。独自のカスタム elasticsearch_curator_yaml を定義する場合、これらの変数を定義または上書きする必要はないことがあります。_hosts はポート番号を持つホストのリストで、_http_auth は基本的な http_authuser:pass 文字列です。Elasticsearch インスタンスが基本的な HTTP 認証を必要とする場合に使用します。

elasticsearch_curator_yaml: |
  ---
  client:
    hosts: {{ elasticsearch_curator_hosts | to_yaml }}
    url_prefix:
    use_ssl: False
    certificate:
    client_cert:
    client_key:
    ssl_no_validate: False
    http_auth: {{ elasticsearch_curator_http_auth }}
    timeout: 30
    master_only: False
  logging:
    loglevel: INFO
    logfile:
    logformat: default
    blacklist: ['elasticsearch', 'urllib3']

この YAML は ~/.curator/curator.yml に格納され、Elasticsearch Curator が Elasticsearch に接続する際の接続詳細や Curator のログ設定を保存します。

elasticsearch_curator_action_yaml: |
  ---
  actions:
    1:
      action: delete_indices
      options:
        ignore_empty_list: True
        disable_action: False
      filters:
      - filtertype: pattern
        kind: prefix
        value: logstash-
        exclude:
      - filtertype: age
        source: name
        direction: older
        timestring: '%Y.%m.%d'
        unit: days
        unit_count: 45
        exclude:

この YAML は ~/.curator/action.yml に格納され、デフォルトの cron ジョブが実行されるときに Curator が実行するアクションを定義します。詳細は Curator actions file を参照してください。

elasticsearch_curator_pip_package: 'python3-pip'
elasticsearch_curator_pip_executable: "{{ 'pip3' if elasticsearch_curator_pip_package.startswith('python3') else 'pip' }}"

インストールが必要なシステム pip パッケージと、実行する pip 実行ファイルです。古い OS や Python 2 を使用する場合は、これを上書きして python-pip および pip に変更する必要があるかもしれません。

依存関係

  • geerlingguy.repo-epel (RedHat/CentOS のみ)

例 プレイブック

- hosts: search
  roles:
    - { role: geerlingguy.elasticsearch-curator }

ライセンス

MIT / BSD

作者情報

このロールは 2014 年に Jeff Geerling によって作成されました。彼は Ansible for DevOps の著者です。

プロジェクトについて

Elasticsearch curator for Linux.

インストール
ansible-galaxy install geerlingguy.elasticsearch-curator
ライセンス
mit
ダウンロード
110.2k
所有者
Father, author, developer, maker. Sometimes called "an inflammatory enigma". #stl #drupal #ansible #k8s #raspberrypi #crohns