[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:
 | 
					      vars:
 | 
				
			||||||
        - name: InputRELPServerRun
 | 
					        - name: InputRELPServerRun
 | 
				
			||||||
          value: 20514
 | 
					          value: 20514
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					loc_mtail:
 | 
				
			||||||
 | 
					  config:
 | 
				
			||||||
 | 
					    - dhcpd.mtail
 | 
				
			||||||
 | 
					  remove:
 | 
				
			||||||
 | 
					    - radiusd.mtail
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										4
									
								
								hosts
								
								
								
								
							
							
						
						
									
										4
									
								
								hosts
								
								
								
								
							| 
						 | 
					@ -105,6 +105,10 @@ linx.adm.crans.org
 | 
				
			||||||
[mailman]
 | 
					[mailman]
 | 
				
			||||||
mailman.adm.crans.org
 | 
					mailman.adm.crans.org
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[mtail]
 | 
				
			||||||
 | 
					gulp.cachan-adm.crans.org
 | 
				
			||||||
 | 
					tealc.adm.crans.org
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[prometheus]
 | 
					[prometheus]
 | 
				
			||||||
monitoring.adm.crans.org
 | 
					monitoring.adm.crans.org
 | 
				
			||||||
fyre.cachan-adm.crans.org
 | 
					fyre.cachan-adm.crans.org
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -44,9 +44,10 @@
 | 
				
			||||||
#  roles: ["prometheus-node-exporter-postfix"]
 | 
					#  roles: ["prometheus-node-exporter-postfix"]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Monitor logs with mtail
 | 
					# Monitor logs with mtail
 | 
				
			||||||
- hosts: tealc.adm.crans.org,gulp.cachan-adm.crans.org
 | 
					- hosts: mtail
 | 
				
			||||||
  vars:
 | 
					  vars:
 | 
				
			||||||
    mirror: '{{ glob_mirror | default({}) | combine(loc_mirror | default({})) }}'
 | 
					    mirror: '{{ glob_mirror | default({}) | combine(loc_mirror | default({})) }}'
 | 
				
			||||||
 | 
					    mtail: '{{ glob_mtail | default({}) | combine(loc_mtail | default({})) }}'
 | 
				
			||||||
  roles:
 | 
					  roles:
 | 
				
			||||||
    - mtail
 | 
					    - mtail
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -30,9 +30,14 @@
 | 
				
			||||||
    src: "mtail/{{ item }}.j2"
 | 
					    src: "mtail/{{ item }}.j2"
 | 
				
			||||||
    dest: "/etc/mtail/{{ item }}"
 | 
					    dest: "/etc/mtail/{{ item }}"
 | 
				
			||||||
    mode: 0644
 | 
					    mode: 0644
 | 
				
			||||||
  loop:
 | 
					  loop: "{{ mtail.config }}"
 | 
				
			||||||
    - dhcpd.mtail
 | 
					  notify: Restart mtail
 | 
				
			||||||
    - radiusd.mtail
 | 
					
 | 
				
			||||||
 | 
					- name: Drop unusued configuration
 | 
				
			||||||
 | 
					  file:
 | 
				
			||||||
 | 
					    path: "/etc/mtail/{{ item }}"
 | 
				
			||||||
 | 
					    state: absent
 | 
				
			||||||
 | 
					  loop: "{{ mtail.remove }}"
 | 
				
			||||||
  notify: Restart mtail
 | 
					  notify: Restart mtail
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Indicate role in motd
 | 
					- name: Indicate role in motd
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue