Need help running Ansible Playbook to install Elastic Search

Looking at I am trying to install elastic search.

I have run command

ansible-galaxy install elastic.elasticsearch

Now I have the following file, I added the two parameters es_api_basic_auth_username and es_api_basic_auth_password and now trying to run the playbook.

[siddis14@adwnode1 ~]$ cat elastic.yml

  • name: Elasticsearch with custom configuration
    hosts: localhost
    • role: elastic.elasticsearch
      es_instance_name: "node1"
      • "/opt/elasticsearch/data"
        es_log_dir: "/opt/elasticsearch/logs"
        es_config: "node1" "custom-cluster" "localhost:9301"
        http.port: 9201
        transport.tcp.port: 9301 false
        node.master: true
        bootstrap.memory_lock: true
        es_scripts: false
        es_templates: false
        es_version_lock: false
        es_heap_size: 1g
        es_start_service: false
        es_plugins_reinstall: false
        es_api_port: 9201
      • plugin: ingest-geoip
        proxy_port: 8080
        es_api_basic_auth_username: elastic
        es_api_basic_auth_password: elastic

when I run this I get stuck on a task error. I dont know what to do at this point

TASK [elastic.elasticsearch : RedHat - Ensure Java is installed] *********************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "The Python 2 bindings for rpm are needed for this module. If you require Python 3 support use the dnf Ansible module instead.. The Python 2 yum module is needed for this module. If you require Python 3 support use the dnf Ansible module instead."}
to retry, use: --limit @/home/siddis14/elastic.retry

PLAY RECAP ***************************************************************************************************************************************************************************
localhost : ok=14 changed=0 unreachable=0 failed=1

I was able to get further in the installation by adding hosts: es_master

Now I am getting a weird path error for java during check which doesnt make sense

TASK [elastic.elasticsearch : correct java version selected] *************************************************************************************************************************
fatal: []: FAILED! => {"changed": false, "msg": "Specified path /usr/lib/jvm/java-1.8.0-openjdk-\n/usr/lib/jvm/java-1.8.0-oracle- does not exist"}
to retry, use: --limit @/home/siddis14/elastic.retry

PLAY RECAP *************************************************************************************************************************************************************************** : ok=16 changed=0 unreachable=0 failed=1

Looking at the path I have these files installed via rpms

[siddis14@adwnode1 ~]$ ls -l /usr/lib/jvm/java-1.8.0-openjdk-
-rwxr-xr-x 1 root root 7336 Apr 13 2017 /usr/lib/jvm/java-1.8.0-openjdk-

[siddis14@adwnode1 ~]$ ls -l /usr/lib/jvm/java-1.8.0-oracle-
-rwxr-xr-x 1 root root 7734 Apr 6 2017 /usr/lib/jvm/java-1.8.0-oracle-

These are the rpms installed in my system

[siddis14@adwnode1 ~]$ rpm -qa | grep java-1.8.0

Hi @Shahzeb_Siddiqui

Looks like you ran into a genuine bug with the ansible playbook which I have fixed in Thanks for finding and reporting it!

Since it looks like you already have java installed on this machine I think you might want to be disabling the java install from this role. You can do this by setting es_java_install: false

Taken from the additional configuration section in the readme.

  • es_java_install If set to false, Java will not be installed. (true (default) or false)

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