Skip to content

jet-dev-team/ansible-role-rsyslog-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jet.Dev logo

Ansible role: Rsyslog Client

An Ansible role that installs Rsyslog and configures a server as rsyslog client.

 

Requirements

  1. SSL/TLS certificates

    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.

 

Role variables

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.

 

Dependencies

None.

 

Example playbook

- hosts: host
  roles:
    - { role: jet-dev.rsyslog-client }

 

Standalone run

The role can be run in a standalone mode.

Important! It requires Ansible to be installed.

How to run

Quick path

  1. 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

Advanced

  1. Create an inventory file within standalone directory or use already created standalone.inventory file:
standalone/standalone.inventory
  1. Populate the inventory file with required host(s) and (optional) host / group variables. Example:
[all]
client.example.com ansible_connection=ssh ansible_user=root
  1. Run standalone/run.playbook.yml with rsyslog_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.

 

License

MIT / BSD

 

Authors information

Role was created in 2020 by Jet.Dev.

Repository on GitHub.