Coder Social home page Coder Social logo

Comments (7)

gingerwizard avatar gingerwizard commented on September 23, 2024 1

Hi @geoffroya i've made some changes which should ensure the java version is only updated if the an update_java param is passed. I'll make further improvements to perform a repo update in this scenario also. This should avoid unnecessary checks.

I have concerns the above approach may cause issues where a non-compatible version of java is installed. What about a flag install_java, with a default value of true. If false, we skip the java install.

@dliappis thoughts?

from ansible-elasticsearch.

dliappis avatar dliappis commented on September 23, 2024

@gingerwizard agreed. I assume @geoffroya is referring to a situation where java has been installed without a package manager, hence the checking for the executable in the shell PATH.

Your recommendation for an install_java flag defaulting to True sounds reasonable to me.
I thought for a second if we could make this slightly more intelligent, e.g. check if there is already a java package installed and then set install_java=false (which would be overridable), but the lack of a list option for the package module would make all of this cumbersome.

from ansible-elasticsearch.

gingerwizard avatar gingerwizard commented on September 23, 2024

@geoffroya we will add a flag for the next release. Feel free to make the pull request or i'll just add when i have a moment. Thanks for the feedback either way!

from ansible-elasticsearch.

geoffroya avatar geoffroya commented on September 23, 2024

Hi @gingerwizard

I've created a pull request to add the flag, as suggested by @dliappis

from ansible-elasticsearch.

gingerwizard avatar gingerwizard commented on September 23, 2024

@geoffroya resolved through #107

from ansible-elasticsearch.

vesharma avatar vesharma commented on September 23, 2024

If you install java with alternative it will not work. Even I tried with command with that I can install java but unable to determine whether java was exist or not so looking for else if or kind of filter in playbook

from ansible-elasticsearch.

vesharma avatar vesharma commented on September 23, 2024

  • name: check
    hosts: all
    become: true
    gather_facts: false
    tasks:

    • name: print a message
      command: java -version 2>&1 | grep version | awk '{print $3}' | sed 's/"//g'
      register: version
      ignore_errors: True

    • name: print java version
      debug:
      msg: " {{ version i}} "
      when: " version.rc == 0 "

    • name: install java version
      command: "{{ item }}"
      when: "version.rc !=0"
      with_items:

      • alternatives --install /usr/sbin/java java /ql/java/jdk1.8.0_152/bin/java 1000

from ansible-elasticsearch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.