---
|
|
- hosts: biff
|
|
roles:
|
|
- role: lxc_guest
|
|
vm_name: logger
|
|
- role: ssh_server
|
|
connection: lxc_ssh
|
|
ansible_docker_extra_args: logger
|
|
|
|
- hosts: all
|
|
tasks:
|
|
- name: Install rsyslog on client
|
|
apt:
|
|
name: rsyslog
|
|
update_cache: yes
|
|
|
|
- hosts: logger
|
|
tasks:
|
|
- name: Configure rsyslog server
|
|
blockinfile:
|
|
block: >
|
|
$ModLoad imudp
|
|
|
|
$UDPServerRun 514
|
|
|
|
$$ModLoad imtcp
|
|
|
|
$InputTCPServerRun 514
|
|
|
|
dest: /etc/rsyslog.conf
|
|
state: present
|
|
|
|
- name: Enable rsyslog on server
|
|
service:
|
|
name: rsyslog
|
|
enabled: yes
|
|
state: started
|
|
|
|
- hosts: all
|
|
vars:
|
|
- log_destination:
|
|
tasks:
|
|
- name: Configure rsyslog client
|
|
template:
|
|
dest: /etc/rsyslog.d/50-default.conf
|
|
src: templates/rsyslog_client.conf
|
|
|
|
- name: Enable rsyslog on client
|
|
service:
|
|
name: rsyslog
|
|
enabled: yes
|
|
state: started
|