Skip to content

Commit

Permalink
Looping through monitored services
Browse files Browse the repository at this point in the history
  • Loading branch information
Respheal committed Sep 9, 2020
1 parent fa715a4 commit b47e9de
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 3 deletions.
9 changes: 9 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# defaults/main.yml

monit_config_dir: "/etc/monit.d/"
monitored_services:
- httpd
- mariadb
- nginx
- php-fpm
- redis

# probably have some sanity checking in that it won't include the
# monitor file if a variable doesn't exist unless an override is included
7 changes: 4 additions & 3 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
state: present
when: ansible_os_family == "RedHat"

- name: (Debian 10) Add PHP repo
- name: (Debian 10) Add backports repo
apt_repository:
repo: "deb http://deb.debian.org/debian buster-backports main"
state: present
Expand All @@ -32,10 +32,11 @@

- name: Install Configs
template:
src: httpd
dest: "{{monit_config_dir}}/httpd"
src: services/{{ item }}
dest: "{{ monit_config_dir }}/{{ item }}"
owner: root
group: root
mode: "0644"
with_items: "{{ monitored_services }}"
notify:
- restart monit
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit b47e9de

Please sign in to comment.