diff options
Diffstat (limited to 'terraform/telegraf/telegraf-os')
-rw-r--r-- | terraform/telegraf/telegraf-os/ansible-config.yml | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/terraform/telegraf/telegraf-os/ansible-config.yml b/terraform/telegraf/telegraf-os/ansible-config.yml index 3acab34..de886a6 100644 --- a/terraform/telegraf/telegraf-os/ansible-config.yml +++ b/terraform/telegraf/telegraf-os/ansible-config.yml @@ -1,5 +1,41 @@ - hosts: + - knot + tasks: +# - include_vars: +# file: "../{{ inventory_hostname }}/vault.yml" +# name: vault +# +# - debug: var=vault +# - debug: msg={{ vault | community.sops.decrypt }} + + - community.sops.load_vars: + file: "../{{ inventory_hostname }}/vault.yml" + name: vault + + - become: yes + file: + state: link + force: true + path: /etc/telegraf/telegraf.conf + src: /etc/trygvis/telegraf.conf + + - become: yes + copy: + dest: /etc/default/telegraf + mode: 0750 + owner: root + group: root + content: | + INFLUX_URL="https://influxdb.vpn.trygvis.io" + INFLUX_TOKEN="{{ vault.influx_token }}" + INFLUX_ORGANIZATION="trygvis" + INFLUX_BUCKET="telegraf-os-{{ inventory_hostname }}" + +# " + +- hosts: - conflatorio + - knot tasks: - become: yes file: @@ -10,3 +46,11 @@ template: dest: "/etc/trygvis/telegraf.conf" src: "telegraf.conf" + notify: reload telegraf + + handlers: + - name: reload telegraf + become: yes + systemd: + unit: telegraf + state: reloaded |