Skip to content

Commit

Permalink
Use python3 for influxdb
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaudfroidmont committed Jun 27, 2022
1 parent e22b471 commit f32ed85
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions playbooks/roles/telegraf/tasks/el.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit f32ed85

Please sign in to comment.