Hello,
I’m writing an Ansible script that install and configure filebeat (agent of logstash).
I’ve finished the installation part. Now i need to add the configuration part to the script. I pretty new with Ansible and i need some help.
The user that suppose to run the script will have to select a few groups from a list, and each group from the list contains a few logs paths, which need to be added to the filebeat configuration file.
For example:
Groups to select foe example: redis, nginx, php-fpm
Redis logs:
/var/log/redis/redis.log
/var/log/redis/sentinel.log
Nginx logs:
/var/log/nginx/access.log
/var/log/nginx/error.log
php-fpm logs:
/var/log/php-fpm/error.log
If the user will select redis and php-fpm, these logs will be added to filebeat configuration file (on the remote host), which located on /etc/filebeat/filebeat.yml, under paths section:
`
filebeat:
prospectors: