buluma.influxdb2

Ansible ロール influxdb2

Ansibleを使ってInfluxDB 2.0をインストールし、設定します。

GitHub バージョン 問題 プルリクエスト ダウンロード
github Version Issues PullRequests Ansible Role

例のプレイブック

この例はmolecule/default/converge.ymlから取られ、各プッシュ、プルリクエスト、リリースの際にテストされています。

---
- name: Converge
  hosts: all
  gather_facts: true
  become: yes
  vars:
    apt_autostart_state: enabled
    pip_package: python3-pip
    pip_executable: "{{ 'pip3' if pip_package.startswith('python3') else 'pip' }}"
    pip_install_packages:
      - name: setuptools
      - name: requests

  pre_tasks:
    - name: aptキャッシュを更新します。
      apt: update_cache=true cache_valid_time=600
      when: ansible_os_family == 'Debian'

    - name: 古いOSのためにパッケージ名を設定します。
      ansible.builtin.set_fact:
        pip_package: python-pip
      when: >
        (ansible_os_family == 'RedHat') and (ansible_distribution_major_version | int < 8)
        or (ansible_distribution == 'Debian') and (ansible_distribution_major_version | int < 10)
        or (ansible_distribution == 'Ubuntu') and (ansible_distribution_major_version | int < 18)
  roles:
    - role: buluma.influxdb2
      influxdb_orgs:
        - name: main-org
          description: メイン組織
        - name: guest-org

      influxdb_users:
        - name: admin01
          org: main-org
          password: secretPassword
        - name: guest01
          org: guest-org
          password: secretPassword

      influxdb_buckets:
        - name: bucket01
          description: 最初のバケット
          org: main-org
          retention: 1d
        - name: bucket02
          org: main-org

マシンの準備が必要です。CIでは、molecule/default/prepare.ymlを使用してこの準備が行われます。

---
- name: コンテナの準備
  hosts: all
  gather_facts: true
  become: yes
  serial: 30%
  vars:
    apt_autostart_state: enabled

  roles:
    - role: buluma.bootstrap
    - role: buluma.apt_autostart
    - role: buluma.pip
    - name: buluma.influxdb2

  post_tasks:
    - name: /environmentfile.txtを配置
      ansible.builtin.copy:
        content: "value=influxdb"
        dest: /environmentfile.txt
        mode: "0644"

これらのロールの使用方法についての完全な説明と例も参照してください。

ロール変数

変数のデフォルト値はdefaults/main.ymlに設定されています。

---
influxdb_dependencies:
  - apt-transport-https
  - curl
  - gnupg

influxdb_packages:
  - influxdb2
  - influxdb2-cli

influxdb_package_state: present

influxdb_config_path: /etc/influxdb
influxdb_bolt_path: /var/lib/influxdb/influxd.bolt
influxdb_engine_path: /var/lib/influxdb/engine

influxdb_host: http://localhost:8086

influxdb_config: {}
#  http-bind-address: 0.0.0.0:8086
#  reporting-disabled: true

influxdb_primary_org: example-org
influxdb_primary_bucket: example-bucket
influxdb_primary_username: example-user
influxdb_primary_password: ExAmPl3PA55W0rD

# 管理者ユーザーのためのルートトークンを設定
influxdb_admin_token: EXAMPLE-TOKEN

influxdb_orgs: []
#  - name: main-org
#    description: メイン組織
#  - name: guest-org

influxdb_users: []
#  - name: admin01
#    org: main-org
#    password: secretPassword
#  - name: guest01
#    org: guest-org
#    password: secretPassword

influxdb_buckets: []
#  - name: bucket01
#    description: 最初のバケット
#    org: main-org
#    retention: 1d
#  - name: bucket02
#    description: 第二のバケット
#    org: main-org

influxdb_service_enabled: true

influxdb_service_state: started

influxdb_skip_onboarding: false

要件

使用されるロールの状態

システムを準備するために以下のロールが使用されます。他の方法でシステムを準備することもできます。

要件 GitHub バージョン
buluma.bootstrap Ansible Molecule Version
buluma.apt_autostart Ansible Molecule Version
buluma.pip Ansible Molecule Version

コンテキスト

このロールは、多くの互換性のあるロールの一部です。さらなる情報については、これらのロールのドキュメントを参照してください。

関連するロールの概要は以下の通りです。

依存関係

互換性

このロールは、以下のコンテナイメージでテストされています。

コンテナ タグ
Debian 全て
Ubuntu 全て
Kali 全て

必要なAnsibleの最小バージョンは2.12で、以下のテストが行われています:

  • 前のバージョン。
  • 現在のバージョン。
  • 開発版。

問題が見つかった場合は、GitHubに登録してください。

変更履歴

ロールの履歴

ライセンス

MIT

著者情報

Shadow Walker

プロジェクトについて

Install and configure InfluxDB 2.0 using Ansible.

インストール
ansible-galaxy install buluma.influxdb2
ライセンス
apache-2.0
ダウンロード
7.9k
所有者
DevOps Engineer