diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2023-10-31 09:25:23 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2023-10-31 12:15:56 +0100 |
commit | 926ddbf926d46aeedead10a19a69d95560c89466 (patch) | |
tree | 1067b8bdfc7a1a7f76ae627aa85cfbc048449e8e /terraform/telegraf/telegraf-os | |
parent | c7d942c02b034ce339bdb554e61410d3faa7f5c8 (diff) | |
download | infra-926ddbf926d46aeedead10a19a69d95560c89466.tar.gz infra-926ddbf926d46aeedead10a19a69d95560c89466.tar.bz2 infra-926ddbf926d46aeedead10a19a69d95560c89466.tar.xz infra-926ddbf926d46aeedead10a19a69d95560c89466.zip |
knot
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 |