Merge "Fix haproxy access to rsyslogd on Noble"
This commit is contained in:
commit
883024ced8
@ -22,6 +22,20 @@
|
||||
that:
|
||||
- haproxy_config_template is defined
|
||||
|
||||
- name: Fix rsyslog apparmor profile on Noble and newer
|
||||
when: ansible_distribution_version is version('24.04', '>=')
|
||||
block:
|
||||
- name: Edit rsyslogd apparmor profile
|
||||
lineinfile:
|
||||
path: /etc/apparmor.d/usr.sbin.rsyslogd
|
||||
regexp: '^profile rsyslogd /usr/sbin/rsyslogd {'
|
||||
line: 'profile rsyslogd /usr/sbin/rsyslogd flags=(attach_disconnected) {'
|
||||
register: profile_update
|
||||
|
||||
- name: Reload rsyslogd apparmor profile
|
||||
command: apparmor_parser -r /etc/apparmor.d/usr.sbin.rsyslogd
|
||||
when: profile_update.changed
|
||||
|
||||
- name: Write rsyslog file
|
||||
copy:
|
||||
src: rsyslog.d/49-haproxy.conf
|
||||
|
@ -32,3 +32,10 @@ def test_haproxy_statsd_running(host):
|
||||
out = json.loads(cmd.stdout)
|
||||
assert out[0]["State"]["Status"] == "running"
|
||||
assert out[0]["RestartCount"] == 0
|
||||
|
||||
def test_haproxy_logging(host):
|
||||
# rsyslog is configured to add a unix socket at this path
|
||||
assert host.file('/var/lib/haproxy/dev/log').is_socket
|
||||
# Haproxy logs to syslog via the above socket which produces
|
||||
# this logfile
|
||||
assert host.file('/var/log/haproxy.log').is_file
|
||||
|
Loading…
x
Reference in New Issue
Block a user