- 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: state: directory path: "/etc/trygvis" - become: yes template: dest: "/etc/trygvis/telegraf.conf" src: "telegraf.conf" notify: reload telegraf handlers: - name: reload telegraf become: yes systemd: unit: telegraf state: reloaded