diff --git a/roles/prometheus/tasks/configure.yml b/roles/prometheus/tasks/configure.yml index 7f56078..d8cd506 100644 --- a/roles/prometheus/tasks/configure.yml +++ b/roles/prometheus/tasks/configure.yml @@ -1,23 +1,23 @@ --- - name: "Configure| Copy Prometheus configuration files" notify: "(Re)start Prometheus service" + with_fileglob: + - "{{ prometheus_config_source_dir }}/*.yml" ansible.builtin.copy: src: "{{ item }}" dest: "{{ prometheus_config_dir }}/{{ item | basename }}" owner: "{{ prometheus_user }}" group: "{{ prometheus_group }}" mode: "0660" - with_fileglob: - - "{{ prometheus_config_source_dir }}/*.yml" - name: "Configure | Copy alert rules" notify: "(Re)start Prometheus service" when: prometheus_alertrules_source_dir is defined + with_fileglob: + - "{{ prometheus_alertrules_source_dir }}/*.yml" ansible.builtin.copy: src: "{{ item }}" dest: "{{ prometheus_config_dir }}/{{ item | basename }}" owner: "{{ prometheus_user }}" group: "{{ prometheus_group }}" mode: "0660" - with_fileglob: - - "{{ prometheus_alertrules_source_dir }}/*.yml" diff --git a/roles/prometheus/tasks/install.yml b/roles/prometheus/tasks/install.yml index a2a4a33..c4922e8 100644 --- a/roles/prometheus/tasks/install.yml +++ b/roles/prometheus/tasks/install.yml @@ -63,6 +63,9 @@ state: absent - name: "Install | Move official prometheus and promtool binaries" + with_items: + - prometheus + - promtool ansible.builtin.copy: src: "{{ prometheus_dir }}/prometheus-{{ prometheus_version }}.linux-amd64/{{ item }}" dest: "/usr/local/bin/{{ item }}" @@ -70,9 +73,6 @@ owner: "{{ prometheus_user }}" group: "{{ prometheus_group }}" remote_src: true - with_items: - - prometheus - - promtool - name: "Install | Create a systemd service unit" notify: "(Re)start Prometheus service"