buluma.influxdb2
Rola Ansible influxdb2
Zainstaluj i skonfiguruj InfluxDB 2.0 za pomocą Ansible.
GitHub | Wersja | Problemy | Prośby o zmiany | Pobrania |
---|---|---|---|---|
Przykładowy Playbook
Ten przykład pochodzi z molecule/default/converge.yml
i jest testowany przy każdym pushu, prośbie o zmiany i wydaniu.
---
- name: Połączenie
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: Zaktualizuj pamięć podręczną apt.
apt: update_cache=true cache_valid_time=600
when: ansible_os_family == 'Debian'
- name: Ustaw nazwę pakietu dla starszych systemów operacyjnych.
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: Główna organizacja
- name: guest-org
influxdb_users:
- name: admin01
org: main-org
password: secretPassword
- name: guest01
org: guest-org
password: secretPassword
influxdb_buckets:
- name: bucket01
description: Pierwszy koszyk
org: main-org
retention: 1d
- name: bucket02
org: main-org
Maszyna musi być przygotowana. W CI jest to robione za pomocą molecule/default/prepare.yml
:
---
- name: Przygotowanie kontenera
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: umieść /environmentfile.txt
ansible.builtin.copy:
content: "value=influxdb"
dest: /environmentfile.txt
mode: "0644"
Zobacz także pełne wyjaśnienie i przykład dotyczące korzystania z tych ról.
Zmienne roli
Domyślne wartości dla zmiennych są ustawione w 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
# Ustaw swój token główny dla użytkownika administratora
influxdb_admin_token: EXAMPLE-TOKEN
influxdb_orgs: []
# - name: main-org
# description: Główna organizacja
# - name: guest-org
influxdb_users: []
# - name: admin01
# org: main-org
# password: secretPassword
# - name: guest01
# org: guest-org
# password: secretPassword
influxdb_buckets: []
# - name: bucket01
# description: Pierwszy koszyk
# org: main-org
# retention: 1d
# - name: bucket02
# description: Drugi koszyk
# org: main-org
influxdb_service_enabled: true
influxdb_service_state: started
influxdb_skip_onboarding: false
Wymagania
- pakiety pip wymienione w requirements.txt.
Stan używanych ról
Poniższe role są używane do przygotowania systemu. Możesz przygotować swój system w inny sposób.
Wymaganie | GitHub | Wersja |
---|---|---|
buluma.bootstrap | ||
buluma.apt_autostart | ||
buluma.pip |
Kontekst
Ta rola jest częścią wielu kompatybilnych ról. Sprawdź dokumentację tych ról w celu uzyskania dalszych informacji.
Oto przegląd związanych ról:
Kompatybilność
Ta rola była testowana na tych obrazach kontenerów:
kontener | tagi |
---|---|
Debian | wszystkie |
Ubuntu | wszystkie |
Kali | wszystkie |
Minimalna wymagana wersja Ansible to 2.12, testy zostały wykonane dla:
- Poprzedniej wersji.
- Bieżącej wersji.
- Wersji rozwojowej.
Jeśli znajdziesz problemy, zgłoś je na GitHubie
Dziennik zmian
Licencja
Informacje o autorze
ansible-galaxy install buluma.influxdb2