Skip to content

Commit

Permalink
ostree systems cannot write to /usr; use /etc instead
Browse files Browse the repository at this point in the history
Use /etc/systemd/system instead of /usr/lib/systemd/system
for the elasticsearch service file on ostree systems.

Signed-off-by: Rich Megginson <[email protected]>
  • Loading branch information
richm committed Oct 31, 2023
1 parent 169a85e commit 0b6863c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions roles/elasticsearch/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,20 @@
- elasticsearch_metrics_provider == 'pcp'
- elasticsearch_agent | d(false) | bool

- name: Check if system is ostree
stat:
path: "{{ ostree_booted_file }}"
vars:
ostree_booted_file: /run/ostree-booted
register: __ostree_booted_stat

- name: Ensure correct service path for ostree systems
when:
- __ostree_booted_stat.stat.exists
- __elasticsearch_service_path != "/etc/systemd/system"
set_fact:
__elasticsearch_service_path: /etc/systemd/system

- name: Ensure PCP Elasticsearch export service exists
template:
src: pcp2elasticsearch.service.j2
Expand Down

0 comments on commit 0b6863c

Please sign in to comment.