aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tasks/lineinfile.yml
blob: ff09478b88da8f9de14098601728518bfa7aee60 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
---
- name: Make sure targets are deployed
  ansible.builtin.lineinfile:
    path: '{{ item.path if item.path is defined else prometheus_target_exporter_defaults[item.id].path }}'
    line: '{{ prometheus_target_strategy_lineinfile_prefix ~
           (item.host if item.host is defined else prometheus_target_exporter_defaults[item.id].host) ~
           prometheus_target_strategy_lineinfile_suffix }}'
    state: present
  become: true
  delegate_to: '{{ prometheus_target_host }}'
  loop: '{{ prometheus_target_exporter }}'
  notify:
    - Run command hook
    - Run shell hook