Skip to content

Commit f32ed85

Browse files
Use python3 for influxdb
1 parent e22b471 commit f32ed85

File tree

1 file changed

+8
-4
lines changed
  • playbooks/roles/telegraf/tasks

1 file changed

+8
-4
lines changed

playbooks/roles/telegraf/tasks/el.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,16 @@
2020
become: true
2121
pip:
2222
name: influxdb
23+
executable: pip-3
2324

2425
- name: Create database
25-
influxdb_database:
26-
hostname: "{{ hostvars[groups['bastion'][0]]['ansible_fqdn'] }}"
27-
database_name: "telegraf"
28-
run_once: true
26+
shell: "python3 -c \"import influxdb; influxdb.InfluxDBClient(host='{{ hostvars[groups['bastion'][0]]['ansible_fqdn'] }}', port=8086).create_database('telegraph')\""
27+
28+
#- name: Create database
29+
# influxdb_database:
30+
# hostname: "{{ hostvars[groups['bastion'][0]]['ansible_fqdn'] }}"
31+
# database_name: "telegraf"
32+
# run_once: true
2933

3034
- name: Install telegraf
3135
vars:

0 commit comments

Comments
 (0)