[mtail] More configuration to select what should be monitored
Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>certbot_on_virtu
							parent
							
								
									0f59004446
								
							
						
					
					
						commit
						4b70700526
					
				| 
						 | 
				
			
			@ -0,0 +1,6 @@
 | 
			
		|||
---
 | 
			
		||||
glob_mtail:
 | 
			
		||||
  config:
 | 
			
		||||
    - dhcpd.mtail
 | 
			
		||||
    - radiusd.mtail
 | 
			
		||||
  remove: []
 | 
			
		||||
| 
						 | 
				
			
			@ -56,3 +56,9 @@ loc_rsyslog_server:
 | 
			
		|||
      vars:
 | 
			
		||||
        - name: InputRELPServerRun
 | 
			
		||||
          value: 20514
 | 
			
		||||
 | 
			
		||||
loc_mtail:
 | 
			
		||||
  config:
 | 
			
		||||
    - dhcpd.mtail
 | 
			
		||||
  remove:
 | 
			
		||||
    - radiusd.mtail
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										4
									
								
								hosts
								
								
								
								
							
							
						
						
									
										4
									
								
								hosts
								
								
								
								
							| 
						 | 
				
			
			@ -105,6 +105,10 @@ linx.adm.crans.org
 | 
			
		|||
[mailman]
 | 
			
		||||
mailman.adm.crans.org
 | 
			
		||||
 | 
			
		||||
[mtail]
 | 
			
		||||
gulp.cachan-adm.crans.org
 | 
			
		||||
tealc.adm.crans.org
 | 
			
		||||
 | 
			
		||||
[prometheus]
 | 
			
		||||
monitoring.adm.crans.org
 | 
			
		||||
fyre.cachan-adm.crans.org
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -44,9 +44,10 @@
 | 
			
		|||
#  roles: ["prometheus-node-exporter-postfix"]
 | 
			
		||||
 | 
			
		||||
# Monitor logs with mtail
 | 
			
		||||
- hosts: tealc.adm.crans.org,gulp.cachan-adm.crans.org
 | 
			
		||||
- hosts: mtail
 | 
			
		||||
  vars:
 | 
			
		||||
    mirror: '{{ glob_mirror | default({}) | combine(loc_mirror | default({})) }}'
 | 
			
		||||
    mtail: '{{ glob_mtail | default({}) | combine(loc_mtail | default({})) }}'
 | 
			
		||||
  roles:
 | 
			
		||||
    - mtail
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -30,9 +30,14 @@
 | 
			
		|||
    src: "mtail/{{ item }}.j2"
 | 
			
		||||
    dest: "/etc/mtail/{{ item }}"
 | 
			
		||||
    mode: 0644
 | 
			
		||||
  loop:
 | 
			
		||||
    - dhcpd.mtail
 | 
			
		||||
    - radiusd.mtail
 | 
			
		||||
  loop: "{{ mtail.config }}"
 | 
			
		||||
  notify: Restart mtail
 | 
			
		||||
 | 
			
		||||
- name: Drop unusued configuration
 | 
			
		||||
  file:
 | 
			
		||||
    path: "/etc/mtail/{{ item }}"
 | 
			
		||||
    state: absent
 | 
			
		||||
  loop: "{{ mtail.remove }}"
 | 
			
		||||
  notify: Restart mtail
 | 
			
		||||
 | 
			
		||||
- name: Indicate role in motd
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue