Chef Cookbook to install and configure LogDNA Agent
Chef Workstation 21+
- CentOS 7
- Ubuntu 18.04
- Ubuntu 20.04
Attributes have default values set in attributes/default.rb
.
node['logdna']['agent_install']
: Whether to install or not. Default istrue
node['logdna']['agent_configure']
: Whether to configure or not. Default istrue
node['logdna']['agent_service']
: How to manage LogDNA Agent Service. Default is:start
. The possible values are::start
: in order to start:stop
: in order to stop:restart
: in order to restart
node['logdna']['conf_key']
: LogDNA API Key - LogDNA Agent won't start unlessnode['logdna']['conf_key']
is setnode['logdna']['conf_config']
: File Path for the LogDNA Agent configuration (defaults to/etc/logdna.conf
)node['logdna']['conf_logdir']
: Log Directories to be addednode['logdna']['conf_logfile']
: Log Files to be addednode['logdna']['conf_exclude']
: Log Files or Directories to be excludednode['logdna']['conf_exclude_regex']
: Exclusion Rule for Log Linesnode['logdna']['conf_hostname']
: Alternative host name to be usednode['logdna']['conf_tags']
: Tags to be added
There are different recipes for doing each process for each kind of system; you can find all in recipes/
folder.
The default recipe is the main recipe calling all others depending on attributes and platform. There are the following cases:
- if
node['logdna']['agent_install']
istrue
, it will callinstall_debian
orinstall_redhat
depending on node's platform - if
node['logdna']['agent_configure']
is set totrue
, it will callconfigure
recipe - if
node['logdna']['conf_key']
is set ornode['logdna']['agent_service']
is set to:stop
, it will callservice_debian
orservice_redhat
depending on node's platform
The recipe to install LogDNA Agent onto deb
or apt
based systems.
The recipe to install LogDNA Agent onto rpm
or yum
based systems.
The recipe to configure LogDNA Agent using node['logdna']['conf_*']
attributes.
The recipe to enable and manage LogDNA Agent Service on deb
or apt
based systems.
The recipe to enable and manage LogDNA Agent Service on rpm
or yum
based systems.
You can utilize Test Kitchen to test the instances listed above. Test Kitchen is configured to use VirtualBox w/ Vagrant. You can also put your LogDNA key in the kitchen.yml file under conf_key
value if you want to fully test.
For example to test CentOS 7 you can do the following: $ kitchen converge centos-7 $ kitchen verify centos-7 #Will run an Inspec test to ensure the cookbook applied correctly.
Contributions are always welcome. See the contributing guide to learn how you can help.
- Author: Samir Musali, LogDNA
- Maintainer: [Scott Gallagher] scott@logdna.com, LogDNA
- License: MIT