fix: change logstash_inputs variable: dict to array
This commit is contained in:
parent
f8426465ed
commit
237e9f7a20
4 changed files with 11 additions and 19 deletions
|
@ -5,6 +5,10 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/)
|
|||
|
||||
## [Unreleased]
|
||||
|
||||
### Changed
|
||||
|
||||
- change logstash_inputs variable: dict to array
|
||||
|
||||
## v1.0.0 - 2019-09-29
|
||||
|
||||
### Added
|
||||
|
|
|
@ -6,6 +6,6 @@ logstash_default_config:
|
|||
path.data: /var/lib/logstash
|
||||
path.logs: /var/log/logstash
|
||||
logstash_full_config: '{{ logstash_default_config|combine(logstash_config, recursive=True) }}'
|
||||
logstash_inputs: {}
|
||||
logstash_inputs: []
|
||||
logstash_outputs: []
|
||||
logstash_filters: []
|
||||
|
|
|
@ -1,21 +1,7 @@
|
|||
# {{ ansible_managed }}
|
||||
|
||||
input {
|
||||
{% for name, options in logstash_inputs.iteritems() %}
|
||||
{{ name }} {
|
||||
{% for option, value in options.iteritems() %}
|
||||
{% if value is string %}
|
||||
{{ option }} => "{{ value }}"
|
||||
{% elif value is number %}
|
||||
{{ option }} => {{ value }}
|
||||
{% elif value is sameas True %}
|
||||
{{ option }} => true
|
||||
{% elif value is sameas False %}
|
||||
{{ option }} => false
|
||||
{% elif value is iterable %}
|
||||
{{ option }} => ["{{ value|join('", ') }}"]
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
}
|
||||
{% for input in logstash_inputs %}
|
||||
{{ input }}
|
||||
{% endfor %}
|
||||
}
|
||||
|
|
|
@ -5,8 +5,10 @@
|
|||
logstash_plugins:
|
||||
- name: logstash-output-influxdb
|
||||
logstash_inputs:
|
||||
file:
|
||||
path: /var/log/syslog
|
||||
- >
|
||||
file {
|
||||
path => "/var/log/syslog"
|
||||
}
|
||||
logstash_outputs:
|
||||
- >
|
||||
file {
|
||||
|
|
Loading…
Reference in a new issue