An Ansible role that installs Rsyslog and configures a server as rsyslog client.
-
The role assumes that you already copied certificates to a client server.
Certificates must be placed under
/var/data/rsyslog_certs
directory on the client. The role automatically ckecks and fix files permissions.
Available variables are listed below, along with default values (see defaults/main.yml
):
rsyslog_server_hostname: ''
Required! A hostname of rsyslog server (without protocol prefix). Example: logs-server.example.com
rsyslog_server_port: ''
Required! A Rsyslog service server port number.
rsyslog_client_hostname: ''
Required! A hostname of rsyslog client (without protocol prefix). Example: some-app.example.com
rsyslog_server_clients_update: False
Automaticaly updates clients list on the Rsyslog server.
None.
- hosts: host
roles:
- { role: jet-dev.rsyslog-client }
The role can be run in a standalone mode.
Important! It requires Ansible to be installed.
- Execute
standalone/run.sh
script with client's hostname as a first parameter and server's hostname as a second parameter.
./standalone/run.sh client.example.com log-server.example.com
- Create an inventory file within
standalone
directory or use already createdstandalone.inventory
file:
standalone/standalone.inventory
- Populate the inventory file with required host(s) and (optional) host / group variables. Example:
[all]
client.example.com ansible_connection=ssh ansible_user=root
- Run
standalone/run.playbook.yml
withrsyslog_server_hostname
as extra variable (you can pass other variables in this way):
ansible-playbook -v -i standalone.inventory -e rsyslog_server_hostname=log-server.example.com run.playbook.yml
Note: rsyslog_client_hostname
variable will be automatically populated from special Ansible variable inventory_hostname
.
MIT / BSD
Role was created in 2020 by Jet.Dev.
Repository on GitHub.