From f32ed858a4b155138f6728016ea5604cdd2335b4 Mon Sep 17 00:00:00 2001 From: arnaudfroidmont Date: Mon, 27 Jun 2022 14:34:05 -0600 Subject: [PATCH] Use python3 for influxdb --- playbooks/roles/telegraf/tasks/el.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/playbooks/roles/telegraf/tasks/el.yml b/playbooks/roles/telegraf/tasks/el.yml index 210772b5..8502f21f 100755 --- a/playbooks/roles/telegraf/tasks/el.yml +++ b/playbooks/roles/telegraf/tasks/el.yml @@ -20,12 +20,16 @@ become: true pip: name: influxdb + executable: pip-3 - name: Create database - influxdb_database: - hostname: "{{ hostvars[groups['bastion'][0]]['ansible_fqdn'] }}" - database_name: "telegraf" - run_once: true + shell: "python3 -c \"import influxdb; influxdb.InfluxDBClient(host='{{ hostvars[groups['bastion'][0]]['ansible_fqdn'] }}', port=8086).create_database('telegraph')\"" + +#- name: Create database +# influxdb_database: +# hostname: "{{ hostvars[groups['bastion'][0]]['ansible_fqdn'] }}" +# database_name: "telegraf" +# run_once: true - name: Install telegraf vars: