Graylog2 / graylog-ansible-role

Ansible role which installs and configures Graylog
Apache License 2.0
212 stars 126 forks source link

Elasticsearch autodiscovery decisions in role #165

Closed asachs01 closed 3 years ago

asachs01 commented 3 years ago

@juju2112 there's probably a better title for this, but it arises out of some issues in z-#4632. The crux of it is that the role is being used with commercially packaged Elasticsearch and does some things that lead to confusion when using the role with that version of ES--those are:

  1. The ansible role for graylog activates enables autodiscovery by default
  2. The ansible role does not allow to set elasticsearch_discovery_default_scheme

Would it be worth changing 1. so that the default behavior is to not enable autodiscovery and can we make it possible so that folks using the role can enable elasticsearch_discovery_default_scheme?

asachs01 commented 3 years ago

Also, FWIW, allowing users to also configure:

elasticsearch_discovery_default_user elasticsearch_discovery_default_password

Would also be helpful.

malcyon commented 3 years ago

We can change the default value. Would that be here and here?

https://github.com/Graylog2/graylog-ansible-role/blob/d4673da0bb9d68cf47cddca6850e5b7e8bbc10f2/defaults/main.yml#L59

https://github.com/Graylog2/graylog-ansible-role/blob/22a004d1f3a6d3242eaf020a4ce81b0c91a83379/templates/graylog.server.conf.j2#L244

For the other configs, are these Graylog settings or Elasticsearch settings? We are just including the official Elasticsearch role in our code. So any settings available through that role should work:

https://github.com/Graylog2/graylog-ansible-role/blob/22a004d1f3a6d3242eaf020a4ce81b0c91a83379/meta/main.yml#L8-L10

For additional graylog configs, we provide this setting. It allows users to pass any additonal Graylog configs needed.

    graylog_additional_config:
      test: value
asachs01 commented 3 years ago

Ah. Yeah, so those are Graylog config options if the additional config param can hold those, maybe we just need a readme update?

malcyon commented 3 years ago

@asachs01 I set elasticsearch_discovery_enabled to default to False and added documenation to the readme on the graylog_additional_config construct.