Skip to content

Commit

Permalink
Override BEAT_LOG_OPTS in systemd unit file
Browse files Browse the repository at this point in the history
This overrides the defaults in the unit file for out services so that we get a log file. The tests currently assert that the log exists.

We could extend the tests to assert that logs are written to journald in the future.

Relates to elastic/beats#8942
  • Loading branch information
andrewkroh committed Dec 19, 2018
1 parent a085c31 commit e54f619
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions roles/test-beat/tasks/linux/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@
dest: '{{ beat_cfg }}'
mode: 0600

- name: Create dir for systemd overrides
file:
path: '/etc/systemd/system/{{ beat_service_name }}.service.d'
state: directory
mode: 0755

- name: Override log options for systemd to get a log file
template:
src: systemd.debug.conf
dest: '/etc/systemd/system/{{ beat_service_name }}.service.d/debug.conf'
mode: 0600

- name: 'Start {{ beat_service_name }} service'
service:
name: '{{ beat_service_name }}'
Expand Down
2 changes: 2 additions & 0 deletions roles/test-beat/templates/systemd.debug.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[Service]
Environment="BEAT_LOG_OPTS="

0 comments on commit e54f619

Please sign in to comment.