Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ haproxy_chroot: /var/lib/haproxy
haproxy_user: haproxy
haproxy_group: haproxy

haproxy_proxies: []
haproxy_frontends: []
haproxy_backends: []

Expand Down
6 changes: 6 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
backup: false
dest: /etc/logrotate.d/haproxy
src: logrotated-haproxy.j2
tags:
- haproxy-configure
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand why this could be useful, but this is just one of our many openmicroscopy roles and playbooks so I'd prefer not to add tags to individual roles unless we have an overall plan.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand, I'll keep it in my own code.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, do you know when/if you will have such a plan?
That tag name actually comes from @geerlingguy's original role.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm afraid we don't have a timeline yet.


# TODO: This is still in development- more configuration is needed to prevent
# some haproxy logs going to the console, and to potentially take account of
Expand All @@ -25,6 +27,8 @@
when: haproxy_syslog_enable
notify:
- restart rsyslog
tags:
- haproxy-configure

- name: Ensure HAProxy is enabled (so init script will start it on Debian).
become: true
Expand Down Expand Up @@ -54,6 +58,8 @@
mode: 0644
validate: haproxy -f %s -c -q
notify: restart haproxy
tags:
- haproxy-configure

- name: Ensure HAProxy is started and enabled on boot.
become: true
Expand Down
5 changes: 5 additions & 0 deletions templates/haproxy.cfg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ defaults
errorfile 504 /etc/haproxy/errors/504.http
{% endif %}

{% for proxy in haproxy_proxies %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no structure to this section, i.e. there's nothing here that makes this specific to proxies, it could be used for any arbitrary configuration. How about move it to the end of the file, and call it something like haproxy_additional_config?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I believe the role has to allow for any configurations. This makes the role usable outside the scope of the currently intended/supported uses.

I would like to add support for the stats entry later on.

I agree for the name and location. I will update this.

{{ proxy.content }}
{% endfor %}


{% for front in haproxy_frontends %}
frontend {{ front.name }}
bind {{ front.address }} {{ front.bind_params |default('') }}
Expand Down