Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support "option" in STATS section #45

Closed
haydenseitz opened this issue Jun 16, 2021 · 4 comments
Closed

Support "option" in STATS section #45

haydenseitz opened this issue Jun 16, 2021 · 4 comments
Assignees

Comments

@haydenseitz
Copy link
Contributor

Is there any way to pass "option" parameters in the STATS section? Below is an example use case to mute logging from the stats dashboard:

listen stats
    bind       *:8080
    mode       http
    maxconn    10
    stats      enable
    stats      admin if TRUE
    stats      refresh 10s
    stats      show-legends
    stats      show-node
    stats      hide-version
    stats      uri /
    option     dontlog-normal      <---
    timeout    client 100s
    timeout    server 100s
    timeout    connect 100s
    timeout    queue 100s
@goldyfruit
Copy link
Contributor

goldyfruit commented Jun 16, 2021

Hi @haydenseitz

Yes, as documented in the README (in the stats section), you could use the haproxy_stats_options variable to set a list of options.

haproxy_stats_options:
  - dontlog-normal

EDIT

After checking, the haproxy_stats_options parameter will only add stats options. There is currently no way to add option to the stats listrener.

Here is the template: https://github.com/uoi-io/ansible-haproxy/blob/master/templates/etc/haproxy/haproxy-stats.cfg.j2

@haydenseitz
Copy link
Contributor Author

I was going to submit a PR to add that functionality, but I was able to set up a stats page with options using haproxy_frontend:

haproxy_stats: false
haproxy_frontend:
  - stats:
      binds:
        - :9001
      stats:
        - enable
        - refresh 10s
        - show-legends
        - show-node
        - hide-version
        - uri /
      options:
        - dontlog-normal

@goldyfruit
Copy link
Contributor

goldyfruit commented Jun 17, 2021

Glad you found a workaround. I did a commit to add the capability: 3abed7d

Add this to your playbook:

haproxy_stats_listener_options
  - dontlog-normal

@haydenseitz
Copy link
Contributor Author

nice, thank you!

@goldyfruit goldyfruit self-assigned this Jun 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants