aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tasks/strategy_lineinfile.yml
diff options
context:
space:
mode:
Diffstat (limited to 'tasks/strategy_lineinfile.yml')
-rw-r--r--tasks/strategy_lineinfile.yml13
1 files changed, 13 insertions, 0 deletions
diff --git a/tasks/strategy_lineinfile.yml b/tasks/strategy_lineinfile.yml
new file mode 100644
index 0000000..a5dd01f
--- /dev/null
+++ b/tasks/strategy_lineinfile.yml
@@ -0,0 +1,13 @@
+---
+- name: Deploy target via lineinfile
+ ansible.builtin.lineinfile:
+ path: '{{ _target_path }}'
+ line: '{{ prometheus_target_strategy_lineinfile_prefix ~ _target_host ~ prometheus_target_strategy_lineinfile_suffix }}'
+ state: present
+ delegate_to: '{{ prometheus_target_host }}'
+ become: true
+ register: _lineinfile_result
+
+- name: Track changes
+ ansible.builtin.set_fact:
+ changed: '{{ changed | default(false) or _lineinfile_result.changed }}'