Skip to content

Commit

Permalink
Fix: Update notify linting
Browse files Browse the repository at this point in the history
Latest ansible-lint now requires notifiy pass casing test.
* Remove obsolete `listen` in handlers.
* Make single notify consistent.

Signed-off-by: SuperQ <[email protected]>
  • Loading branch information
SuperQ committed May 15, 2024
1 parent 96e7fd7 commit 542df94
Show file tree
Hide file tree
Showing 63 changed files with 95 additions and 138 deletions.
2 changes: 0 additions & 2 deletions roles/alertmanager/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
- name: Restart alertmanager
listen: "restart alertmanager"
become: true
ansible.builtin.systemd:
daemon_reload: true
Expand All @@ -9,7 +8,6 @@
register: alertmanager_restarted

- name: Reload alertmanager
listen: "reload alertmanager"
become: true
ansible.builtin.systemd:
name: alertmanager
Expand Down
9 changes: 3 additions & 6 deletions roles/alertmanager/tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
mode: 0644
validate: "{{ _alertmanager_binary_install_dir }}/amtool check-config %s"
no_log: "{{ false if (lookup('env', 'CI')) or (lookup('env', 'MOLECULE_PROVISIONER_NAME')) else true }}"
notify:
- restart alertmanager
notify: Restart alertmanager

- name: Create systemd service unit
ansible.builtin.template:
Expand All @@ -28,8 +27,7 @@
owner: root
group: root
mode: 0644
notify:
- restart alertmanager
notify: Restart alertmanager

- name: Copy alertmanager template files
ansible.builtin.copy:
Expand All @@ -40,5 +38,4 @@
group: alertmanager
mode: 0644
with_fileglob: "{{ alertmanager_template_files }}"
notify:
- restart alertmanager
notify: Restart alertmanager
6 changes: 2 additions & 4 deletions roles/alertmanager/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@
with_items:
- alertmanager
- amtool
notify:
- restart alertmanager
notify: Restart alertmanager

- name: Propagate locally distributed alertmanager and amtool binaries
ansible.builtin.copy:
Expand All @@ -83,5 +82,4 @@
when:
- alertmanager_binary_local_dir | length > 0
- not alertmanager_skip_install
notify:
- restart alertmanager
notify: Restart alertmanager
1 change: 0 additions & 1 deletion roles/bind_exporter/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
- name: Restart bind_exporter
listen: "restart bind_exporter"
become: true
ansible.builtin.systemd:
daemon_reload: true
Expand Down
4 changes: 2 additions & 2 deletions roles/bind_exporter/tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
owner: root
group: root
mode: '0644'
notify: restart bind_exporter
notify: Restart bind_exporter

- name: Create bind_exporter config directory
ansible.builtin.file:
Expand All @@ -29,7 +29,7 @@
owner: root
group: '{{ bind_exporter_system_group }}'
mode: '0640'
notify: restart bind_exporter
notify: Restart bind_exporter

- name: Allow bind_exporter port in SELinux on RedHat OS family
community.general.seport:
Expand Down
4 changes: 2 additions & 2 deletions roles/bind_exporter/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
mode: '0755'
owner: root
group: root
notify: restart bind_exporter
notify: Restart bind_exporter
when: not ansible_check_mode

- name: Propagate locally distributed bind_exporter binary
Expand All @@ -68,4 +68,4 @@
when:
- bind_exporter_binary_local_dir | length > 0
- not bind_exporter_skip_install
notify: restart bind_exporter
notify: Restart bind_exporter
2 changes: 0 additions & 2 deletions roles/blackbox_exporter/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
- name: Restart blackbox_exporter
listen: "restart blackbox_exporter"
become: true
ansible.builtin.systemd:
daemon_reload: true
Expand All @@ -9,7 +8,6 @@
register: blackbox_exporter_restarted

- name: Reload blackbox_exporter
listen: "reload blackbox_exporter"
become: true
ansible.builtin.systemd:
name: blackbox_exporter
Expand Down
6 changes: 2 additions & 4 deletions roles/blackbox_exporter/tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
owner: root
group: root
mode: '0644'
notify:
- restart blackbox_exporter
notify: Restart blackbox_exporter

- name: Create blackbox_exporter config directory
ansible.builtin.file:
Expand All @@ -24,5 +23,4 @@
owner: root
group: "{{ blackbox_exporter_group }}"
mode: '0644'
notify:
- reload blackbox_exporter
notify: Reload blackbox_exporter
4 changes: 2 additions & 2 deletions roles/blackbox_exporter/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
mode: 0755
owner: root
group: root
notify: restart blackbox_exporter
notify: Restart blackbox_exporter
when: not ansible_check_mode

- name: Propagate locally distributed blackbox_exporter binary
Expand All @@ -64,7 +64,7 @@
when:
- blackbox_exporter_binary_local_dir | length > 0
- not blackbox_exporter_skip_install
notify: restart blackbox_exporter
notify: Restart blackbox_exporter

- name: Install libcap on Debian systems
ansible.builtin.package:
Expand Down
1 change: 0 additions & 1 deletion roles/cadvisor/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
- name: Restart cadvisor
listen: "restart cadvisor"
become: true
ansible.builtin.systemd:
daemon_reload: true
Expand Down
2 changes: 1 addition & 1 deletion roles/cadvisor/tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
owner: root
group: root
mode: 0644
notify: restart cadvisor
notify: Restart cadvisor

- name: Allow cadvisor port in SELinux on RedHat OS family
community.general.seport:
Expand Down
4 changes: 2 additions & 2 deletions roles/cadvisor/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
mode: 0755
owner: root
group: root
notify: restart cadvisor
notify: Restart cadvisor
when: not ansible_check_mode

- name: Propagate locally distributed cadvisor binary
Expand All @@ -56,4 +56,4 @@
when:
- cadvisor_binary_local_dir | length > 0
- not cadvisor_skip_install
notify: restart cadvisor
notify: Restart cadvisor
1 change: 0 additions & 1 deletion roles/chrony_exporter/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
- name: Restart chrony_exporter
listen: "restart chrony_exporter"
become: true
ansible.builtin.systemd:
daemon_reload: true
Expand Down
4 changes: 2 additions & 2 deletions roles/chrony_exporter/tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
owner: root
group: root
mode: 0644
notify: restart chrony_exporter
notify: Restart chrony_exporter

- name: Create chrony_exporter config directory
ansible.builtin.file:
Expand All @@ -23,7 +23,7 @@
owner: root
group: root
mode: 0644
notify: restart chrony_exporter
notify: Restart chrony_exporter

- name: Allow chrony_exporter port in SELinux on RedHat OS family
community.general.seport:
Expand Down
4 changes: 2 additions & 2 deletions roles/chrony_exporter/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
mode: 0755
owner: root
group: root
notify: restart chrony_exporter
notify: Restart chrony_exporter
when: not ansible_check_mode

- name: Propagate locally distributed chrony_exporter binary
Expand All @@ -66,4 +66,4 @@
when:
- chrony_exporter_binary_local_dir | length > 0
- not chrony_exporter_skip_install
notify: restart chrony_exporter
notify: Restart chrony_exporter
1 change: 0 additions & 1 deletion roles/fail2ban_exporter/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
- name: Restart fail2ban_exporter
listen: "restart fail2ban_exporter"
become: true
ansible.builtin.systemd:
daemon_reload: true
Expand Down
2 changes: 1 addition & 1 deletion roles/fail2ban_exporter/tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
owner: root
group: root
mode: 0644
notify: restart fail2ban_exporter
notify: Restart fail2ban_exporter

- name: Allow fail2ban_exporter port in SELinux on RedHat OS family
community.general.seport:
Expand Down
4 changes: 2 additions & 2 deletions roles/fail2ban_exporter/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
mode: 0755
owner: root
group: root
notify: restart fail2ban_exporter
notify: Restart fail2ban_exporter
when: not ansible_check_mode

- name: Propagate locally distributed fail2ban_exporter binary
Expand All @@ -48,4 +48,4 @@
when:
- fail2ban_exporter_binary_local_dir | length > 0
- not fail2ban_exporter_skip_install
notify: restart fail2ban_exporter
notify: Restart fail2ban_exporter
1 change: 0 additions & 1 deletion roles/ipmi_exporter/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
- name: Restart ipmi_exporter
listen: "restart ipmi_exporter"
become: true
ansible.builtin.systemd:
daemon_reload: true
Expand Down
7 changes: 3 additions & 4 deletions roles/ipmi_exporter/tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
owner: root
group: root
mode: 0644
notify: restart ipmi_exporter
notify: Restart ipmi_exporter

- name: Create ipmi_exporter config directory
ansible.builtin.file:
Expand All @@ -23,7 +23,7 @@
owner: root
group: root
mode: 0644
notify: restart ipmi_exporter
notify: Restart ipmi_exporter

- name: Copy the ipmi_exporter config file
ansible.builtin.template:
Expand All @@ -33,8 +33,7 @@
group: "{{ ipmi_exporter_system_group }}"
mode: 0640
no_log: "{{ false if (lookup('env', 'CI')) or (lookup('env', 'MOLECULE_PROVISIONER_NAME')) else true }}"
notify:
- restart ipmi_exporter
notify: Restart ipmi_exporter

- name: Allow ipmi_exporter port in SELinux on RedHat OS family
community.general.seport:
Expand Down
4 changes: 2 additions & 2 deletions roles/ipmi_exporter/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
mode: 0755
owner: root
group: root
notify: restart ipmi_exporter
notify: Restart ipmi_exporter
when: not ansible_check_mode

- name: Propagate locally distributed ipmi_exporter binary
Expand All @@ -66,7 +66,7 @@
when:
- ipmi_exporter_binary_local_dir | length > 0
- not ipmi_exporter_skip_install
notify: restart ipmi_exporter
notify: Restart ipmi_exporter

- name: Install freeipmi package
ansible.builtin.package:
Expand Down
1 change: 0 additions & 1 deletion roles/memcached_exporter/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
- name: Restart memcached_exporter
listen: "restart memcached_exporter"
become: true
ansible.builtin.systemd:
daemon_reload: true
Expand Down
4 changes: 2 additions & 2 deletions roles/memcached_exporter/tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
owner: root
group: root
mode: 0644
notify: restart memcached_exporter
notify: Restart memcached_exporter

- name: Create memcached_exporter config directory
ansible.builtin.file:
Expand All @@ -23,7 +23,7 @@
owner: root
group: root
mode: 0644
notify: restart memcached_exporter
notify: Restart memcached_exporter

- name: Allow memcached_exporter port in SELinux on RedHat OS family
community.general.seport:
Expand Down
4 changes: 2 additions & 2 deletions roles/memcached_exporter/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
mode: 0755
owner: root
group: root
notify: restart memcached_exporter
notify: Restart memcached_exporter
when: not ansible_check_mode

- name: Propagate locally distributed memcached_exporter binary
Expand All @@ -66,4 +66,4 @@
when:
- memcached_exporter_binary_local_dir | length > 0
- not memcached_exporter_skip_install
notify: restart memcached_exporter
notify: Restart memcached_exporter
1 change: 0 additions & 1 deletion roles/mongodb_exporter/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
- name: Restart mongodb_exporter
listen: "restart mongodb_exporter"
become: true
ansible.builtin.systemd:
daemon_reload: true
Expand Down
4 changes: 2 additions & 2 deletions roles/mongodb_exporter/tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
owner: root
group: root
mode: 0644
notify: restart mongodb_exporter
notify: Restart mongodb_exporter

- name: Create mongodb_exporter config directory
ansible.builtin.file:
Expand All @@ -23,7 +23,7 @@
owner: root
group: root
mode: 0644
notify: restart mongodb_exporter
notify: Restart mongodb_exporter

- name: Allow mongodb_exporter port in SELinux on RedHat OS family
community.general.seport:
Expand Down
4 changes: 2 additions & 2 deletions roles/mongodb_exporter/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
mode: 0755
owner: root
group: root
notify: restart mongodb_exporter
notify: Restart mongodb_exporter
when: not ansible_check_mode

- name: Propagate locally distributed mongodb_exporter binary
Expand All @@ -66,4 +66,4 @@
when:
- mongodb_exporter_binary_local_dir | length > 0
- not mongodb_exporter_skip_install
notify: restart mongodb_exporter
notify: Restart mongodb_exporter
1 change: 0 additions & 1 deletion roles/mysqld_exporter/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
- name: Restart mysqld_exporter
listen: "restart mysqld_exporter"
become: true
ansible.builtin.systemd:
daemon_reload: true
Expand Down
Loading

0 comments on commit 542df94

Please sign in to comment.