buluma.influxdb2
Rol de Ansible influxdb2
Instala y configura InfluxDB 2.0 usando Ansible.
GitHub | Versión | Problemas | Solicitudes de extracción | Descargas |
---|---|---|---|---|
Ejemplo de Playbook
Este ejemplo se toma de molecule/default/converge.yml
y se prueba en cada push, solicitud de extracción y lanzamiento.
---
- 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: Actualizar caché de apt.
apt: update_cache=true cache_valid_time=600
when: ansible_os_family == 'Debian'
- name: Configurar nombre de paquete para sistemas operativos más antiguos.
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: Organización principal
- name: guest-org
influxdb_users:
- name: admin01
org: main-org
password: secretPassword
- name: guest01
org: guest-org
password: secretPassword
influxdb_buckets:
- name: bucket01
description: Primer bucket
org: main-org
retention: 1d
- name: bucket02
org: main-org
La máquina necesita estar preparada. En CI, esto se hace usando molecule/default/prepare.yml
:
---
- name: Preparar contenedor
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: colocar /environmentfile.txt
ansible.builtin.copy:
content: "value=influxdb"
dest: /environmentfile.txt
mode: "0644"
También consulta una explicación y ejemplo completo sobre cómo usar estos roles.
Variables del Rol
Los valores predeterminados para las variables se establecen en 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
# Establecer tu token root para el usuario admin
influxdb_admin_token: EXAMPLE-TOKEN
influxdb_orgs: []
# - name: main-org
# description: Organización principal
# - name: guest-org
influxdb_users: []
# - name: admin01
# org: main-org
# password: secretPassword
# - name: guest01
# org: guest-org
# password: secretPassword
influxdb_buckets: []
# - name: bucket01
# description: Primer bucket
# org: main-org
# retention: 1d
# - name: bucket02
# description: Segundo bucket
# org: main-org
influxdb_service_enabled: true
influxdb_service_state: started
influxdb_skip_onboarding: false
Requisitos
- Paquetes pip listados en requirements.txt.
Estado de los roles usados
Los siguientes roles se utilizan para preparar un sistema. Puedes preparar tu sistema de otra manera.
Requisito | GitHub | Versión |
---|---|---|
buluma.bootstrap | ||
buluma.apt_autostart | ||
buluma.pip |
Contexto
Este rol es parte de muchos roles compatibles. Echa un vistazo a la documentación de estos roles para más información.
Aquí hay un resumen de roles relacionados:
Compatibilidad
Este rol ha sido probado en estas imágenes de contenedor:
contenedor | etiquetas |
---|---|
Debian | todas |
Ubuntu | todas |
Kali | todas |
La versión mínima de Ansible requerida es 2.12, las pruebas se han realizado en:
- La versión anterior.
- La versión actual.
- La versión de desarrollo.
Si encuentras problemas, regístralos en GitHub
Historial de cambios
Licencia
Información del autor
Install and configure InfluxDB 2.0 using Ansible.
ansible-galaxy install buluma.influxdb2