Ubuntu 16.04 - ansible-elasticsearch: stuck at "Wait for elasticsearch to startup"

Ansible is stuck at "Wait for elasticsearch to startup" and just times out.
Setup is Ubuntu 16.04.02

Playbook:
- name: Install and configure elasticsearch
  hosts: localhost
  remote_user: 'deploy'
  become: True
  roles:
    - role: elastic.elasticsearch

With just a single variable:
es_instance_name: "node1"

I can't figure out what goes wrong.

Have you looked at the ES logs?

There are no logs. /var/log/elasticsearch is complete empty (no files yet).

# systemctl enable elasticsearch
Failed to execute operation: No such file or directory

Something wrong with systemd.

I believe it;'s the same problem as:

Nothing is installed into system d, I am running into the same problem. I see no task that will take care of that either. It may be worth just adding to the playbook to do this?

Is there a workaround for this that someone could share to enable the service in systemd? I'm having the same issue and it is blocking me currently.

Add this to the task in /role/tasks/main.yml above "Wait for elasticsearch to startup"

- name: Debian - Ensure it's enabled on startup
  lineinfile:
    path: /etc/default/{{ es_instance_name }}_elasticsearch
    regexp: '^START_DAEMON='
    line: 'START_DAEMON=true'
  notify: restart elasticsearch
1 Like

even with adding this block, still an issue. :frowning:

has elastic guys tested this?

What error are you getting?

No this code wasn't tested by Elastic.

Fixed it. basically it didn't know which init script to execute. systemd or init.d

Hi
Could you post here the fix you made?
I have the same probl.

Tnx.

I agree, it would be neat to have this fixed.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.