Commit 66e4f038 authored by Ross McDonald's avatar Ross McDonald
Browse files

Merge pull request #9 from aisch/optional-python-lib

optionally install python client
parents 725aecb3 b4dfd52b
...@@ -17,6 +17,10 @@ influxdb_load_sample_data: no ...@@ -17,6 +17,10 @@ influxdb_load_sample_data: no
influxdb_sample_database_name: sample_database influxdb_sample_database_name: sample_database
influxdb_sample_measurement_name: random_ints influxdb_sample_measurement_name: random_ints
influxdb_bind_hostname: "{{ ansible_hostname }}"
influxdb_install_python_client: no
# NOTE: Since Ansible uses Python on the backend, all boolean values are capitalized when being # NOTE: Since Ansible uses Python on the backend, all boolean values are capitalized when being
# rendered (which is not valid TOML). To get around this, make sure you quote any boolean values # rendered (which is not valid TOML). To get around this, make sure you quote any boolean values
# (true -> "true") to ensure correct formatting (for template variables). # (true -> "true") to ensure correct formatting (for template variables).
......
...@@ -11,6 +11,16 @@ ...@@ -11,6 +11,16 @@
- curl - curl
- apt-transport-https - apt-transport-https
- name: Install any necessary PIP dependencies [Debian/Ubuntu]
apt:
name: "{{ item }}"
state: present
update_cache: yes
cache_valid_time: 3600
with_items:
- python-pip
when: influxdb_install_python_client
- name: Import InfluxData GPG signing key [Debian/Ubuntu] - name: Import InfluxData GPG signing key [Debian/Ubuntu]
apt_key: apt_key:
url: https://repos.influxdata.com/influxdb.key url: https://repos.influxdata.com/influxdb.key
......
...@@ -6,6 +6,14 @@ ...@@ -6,6 +6,14 @@
with_items: with_items:
- curl - curl
- name: Install any necessary PIP dependencies [RedHat/CentOS]
yum:
name: "{{ item }}"
state: present
with_items:
- python-pip
when: influxdb_install_python_client
- name: Add InfluxData repository file [RHEL/CentOS] - name: Add InfluxData repository file [RHEL/CentOS]
template: template:
src: etc/yum.repos.d/influxdata.repo.j2 src: etc/yum.repos.d/influxdata.repo.j2
......
...@@ -16,6 +16,13 @@ ...@@ -16,6 +16,13 @@
- include: install-debian.yml - include: install-debian.yml
when: ansible_os_family == "Debian" when: ansible_os_family == "Debian"
- name: Install InfluxDB python client package [PIP]
pip: >
name=influxdb
state={{ influxdb_python_client_state | default(omit) }}
version={{ influxdb_python_client_version | default(omit) }}
when: influxdb_install_python_client
- name: Capture InfluxDB version information - name: Capture InfluxDB version information
command: influxd version command: influxd version
register: influxdb_runtime_version_raw register: influxdb_runtime_version_raw
......
...@@ -18,8 +18,8 @@ reporting-disabled = {{ influxdb_disable_reporting }} ...@@ -18,8 +18,8 @@ reporting-disabled = {{ influxdb_disable_reporting }}
[meta] [meta]
enabled = {{ influxdb_meta_enabled }} enabled = {{ influxdb_meta_enabled }}
dir = "{{ influxdb_meta_dir }}" dir = "{{ influxdb_meta_dir }}"
bind-address = "{{ ansible_hostname }}:{{ influxdb_meta_port }}" bind-address = "{{ influxdb_bind_hostname }}:{{ influxdb_meta_port }}"
http-bind-address = "{{ ansible_hostname }}:{{ influxdb_meta_http_port }}" http-bind-address = "{{ influxdb_bind_hostname }}:{{ influxdb_meta_http_port }}"
retention-autocreate = {{ influxdb_meta_retention_autocreate }} retention-autocreate = {{ influxdb_meta_retention_autocreate }}
election-timeout = "{{ influxdb_meta_election_timeout }}" election-timeout = "{{ influxdb_meta_election_timeout }}"
heartbeat-timeout = "{{ influxdb_meta_heartbeat_timeout }}" heartbeat-timeout = "{{ influxdb_meta_heartbeat_timeout }}"
...@@ -118,7 +118,7 @@ reporting-disabled = {{ influxdb_disable_reporting }} ...@@ -118,7 +118,7 @@ reporting-disabled = {{ influxdb_disable_reporting }}
[admin] [admin]
enabled = {{ influxdb_admin_enabled }} enabled = {{ influxdb_admin_enabled }}
bind-address = "{{ ansible_hostname }}:{{ influxdb_admin_port }}" bind-address = "{{ influxdb_bind_hostname }}:{{ influxdb_admin_port }}"
https-enabled = {{ influxdb_admin_https_enabled }} https-enabled = {{ influxdb_admin_https_enabled }}
https-certificate = "{{ influxdb_admin_https_certificate }}" https-certificate = "{{ influxdb_admin_https_certificate }}"
...@@ -139,7 +139,7 @@ reporting-disabled = {{ influxdb_disable_reporting }} ...@@ -139,7 +139,7 @@ reporting-disabled = {{ influxdb_disable_reporting }}
[http] [http]
enabled = {{ influxdb_http_enabled }} enabled = {{ influxdb_http_enabled }}
bind-address = "{{ ansible_hostname }}:{{ influxdb_http_port }}" bind-address = "{{ influxdb_bind_hostname }}:{{ influxdb_http_port }}"
auth-enabled = {{ influxdb_http_auth_enabled }} auth-enabled = {{ influxdb_http_auth_enabled }}
log-enabled = {{ influxdb_http_log_enabled }} log-enabled = {{ influxdb_http_log_enabled }}
write-tracing = {{ influxdb_http_write_tracing }} write-tracing = {{ influxdb_http_write_tracing }}
...@@ -190,12 +190,20 @@ reporting-disabled = {{ influxdb_disable_reporting }} ...@@ -190,12 +190,20 @@ reporting-disabled = {{ influxdb_disable_reporting }}
# ignore-unnamed = {{ influxdb_graphite_ignore_unnamed }} # ignore-unnamed = {{ influxdb_graphite_ignore_unnamed }}
### ###
{% if influxdb_runtime_version | version_compare('0.11', '<') %}
### [[collectd]] ### [[collectd]]
{% else %}
### [collectd]
{% endif %}
### ###
### Controls the listener for collectd data. ### Controls the listener for collectd data.
### ###
{% if influxdb_runtime_version | version_compare('0.11', '<') %}
[[collectd]] [[collectd]]
{% else %}
[collectd]
{% endif %}
enabled = {{ influxdb_collectd_enabled }} enabled = {{ influxdb_collectd_enabled }}
bind-address = ":{{ influxdb_collectd_port }}" bind-address = ":{{ influxdb_collectd_port }}"
database = "{{ influxdb_collectd_database }}" database = "{{ influxdb_collectd_database }}"
...@@ -206,12 +214,20 @@ reporting-disabled = {{ influxdb_disable_reporting }} ...@@ -206,12 +214,20 @@ reporting-disabled = {{ influxdb_disable_reporting }}
typesdb = "{{ influxdb_collectd_typesdb }}" typesdb = "{{ influxdb_collectd_typesdb }}"
### ###
{% if influxdb_runtime_version | version_compare('0.11', '<') %}
### [[opentsdb]] ### [[opentsdb]]
{% else %}
### [opentsdb]
{% endif %}
### ###
### Controls the listener for OpenTSDB data. ### Controls the listener for OpenTSDB data.
### ###
{% if influxdb_runtime_version | version_compare('0.11', '<') %}
[[opentsdb]] [[opentsdb]]
{% else %}
[opentsdb]
{% endif %}
enabled = {{ influxdb_opentsdb_enabled }} enabled = {{ influxdb_opentsdb_enabled }}
# bind-address = ":{{ influxdb_opentsdb_port }}" # bind-address = ":{{ influxdb_opentsdb_port }}"
# database = "{{ influxdb_opentsdb_database }}" # database = "{{ influxdb_opentsdb_database }}"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment