Git Product home page Git Product logo

ansible-role-java's Introduction

java role

License Build Status Galaxy Ansible Ansible

Summary

This Ansible role has the following features for:

OpenJDK

  • Install JRE, JDK
  • Additional opportunity to install from openjdk-fallback, repositories, s3, web, chocolatey, local source.

Oracle Java:

  • Install JRE, JDK, Server-JRE
  • Additional opportunity to install from s3, web, local source.

DISCLAIMER: usage of any version of this role implies you have accepted the Oracle Binary Code License Agreement for Java SE.

SAPJVM

  • Install JDK
  • Additional opportunity to install from sapjvm-fallback, s3, web, local source.

ZULU

  • Install JDK
  • Additional opportunity to install from zulu-fallback, s3, web, local source, chocolatey.

AdoptOpenJDK

  • Install JDK, JRE
  • Additional opportunity to install from adoptopenjdk-fallback, repositories, web, local source, s3, chocolatey.

SapMachine

  • Install JDK, JRE
  • Additional opportunity to install from sapmachine-fallback, web, local source, chocolatey (only latest version), s3.

Alibaba Dragonwell 8 JDK

  • Install JDK
  • Alibaba Dragonwell 8 corresponds to OpenJDK 8 and is compatible with the Java SE Standard
  • Linux/x86_64 platform only
  • Additional opportunity to install from dragonwell8-fallback, web, local source, s3.

Amazon Corretto

  • Install JDK 8 and 11
  • Install JRE 8 (Amazon Linux 2 only)
  • Additional opportunity to install from fallback, web, local source, s3.

Requirements

  • Version of the ansible for installation: 2.7
  • Supported OpenJDK version:
    • 8
      • EL 6: repositories, tarball
      • EL 7: repositories, tarball
      • EL 8: repositories, tarball
      • Ubuntu bionic: repositories, tarball
      • Debian stretch: repositories, tarball
      • Windows: tarball
    • 11
      • EL 6: tarball
      • EL 7: repositories, tarball
      • Ubuntu bionic: repositories, tarball
      • Debian stretch: tarball
      • Windows: tarball
    • 12
      • EL 6: tarball
      • EL 7: tarball
      • EL 8: tarball
      • Ubuntu bionic: tarball
      • Debian stretch: tarball
      • Windows: tarball
    • 13
      • EL 6: tarball, fallback
      • EL 7: tarball, fallback
      • EL 8: tarball, fallback
      • Ubuntu bionic: tarball, fallback
      • Debian stretch: tarball, fallback
      • Windows: tarball, fallback
  • Supported oracle java version:
    • 7
    • 8
    • 11
    • 12
  • Supported sapjvm version:
    • 7
    • 8
  • Supported zulu version:
    • 8
    • 11
    • 17
  • Supported AdoptOpenJDK version:
    • 8
    • 11
    • 12
    • 13
  • Supported SapMachine version:
    • 11
      • EL 7: fallback
      • EL 8: fallback
      • Ubuntu bionic: fallback
      • Debian stretch: fallback
      • Windows: chocolatey (only latest version, don't support java_minor_version variables), fallback
    • 12
      • EL 7: tarball
      • EL 8: tarball
      • Ubuntu bionic: tarball
      • Debian stretch: tarball
      • Windows: tarball
    • 13
      • EL 7: fallback
      • EL 8: fallback
      • Ubuntu bionic: fallback
      • Debian stretch: fallback
      • Windows: chocolatey (only latest version, don't support java_minor_version variables), fallback
  • Supported Alibaba Dragonwell version:
    • 8.0.0
    • 8.1.1
  • Supported Amazon Corretto version:
    • 8
    • 11
  • Supported OS:
    • Ubuntu
      • bionic
      • xenial
      • trusty
    • Debian
      • stretch
      • buster
    • Amazon Linux
    • Amazon Linux 2
    • EL (RHEL/CentOS)
      • 6
      • 7
      • 8
    • Windows
      • 10
      • 2016
      • 2019

Role Variables

  • java_distribution Java distribution type, one of:

    • openjdk (default)

    • oracle_java

    • sapjvm

    • zulu

    • adoptopenjdk

    • sapmachine

    • dragonwell8

    • corretto

      Notice: this variable is mandatory in case of installing other distribution than 'openjdk'.

  • java_package Java package type.

    Available:

    • jdk (default)
    • jre
  • transport Artifact source transport. Use fallback (OpenJDK, SAPJVM, AdoptOpenJDK, SapMachine, ZULU, Alibaba Dragonwell, Amazon Corretto distributions are supported), repositories(OpenJDK, AdoptOpenJDK, Amazon Corretto distributions are supported), local, web or s3 according to your requirements.

    Available:

    • repositories Installing java from system repositories (yum or apt, Linux only)

    • web Fetching artifact from custom web url

    • chocolatey Windows specific package manager (Supported OpenJDK: JDK 11, 12 or JRE 8, SapMachine, ZULU, AdoptOpenJDK)

    • local Local artifact stored on ansible master (can be used as cache for other transport)

    • s3 Download artifact from s3 bucket (Linux clients only, for Windows please use other transports)

    • fallback fetching artifacts from official sites (available for distributions: openjdk, sapjvm, zulu, adoptopenjdk, sapmachine, dragonwell8, corretto).
      This is default value for transport variable

      Notice using s3 transport requires specific packages to be installed on target host:

      • 'botocore'
      • 'boto'
      • 'boto3' These packages are not included in given role. You should install them preliminary.
  • java_tarball_install - boolean parameter to choose between tarball and package installation. Default is true if transport is not repositories.

  • java_major_version - major version of OpenJDK (8,11,17) or oracle-java (6,7,8, 11 etc.) Default is 12.

  • java_minor_version - minor version of oracle-java. For version 8.202 minor will be 202 (default). For OpenJDK this variable not needed setup manually.

  • java_arch Package architecture. (With installing OpenJDK from repositories its variable you may use only for RHEL )

    Available:

    • x64 for x86_64 (default)
    • i586 for x86
  • java_path Where java package will be installed. Notice Not use this variable if transport = repositories selected

    default values depend on OS distribution:

    • RedHat: /usr/java (/usr/lib/jvm from repositories)
    • Debian: /usr/lib/jvm
    • Windows: C:\Program Files\Java
  • java_download_path: Local folder for downloading artifacts

    Linux default: /tmp

    Windows default: TEMP environment variable

  • transport_web URI for http/https artifact e.g. "http://my-storage.com/jdk-8u172-linux-x64.tar.gz"

  • transport_web: "https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_linux-x64_bin.tar.gz" (OpenJDK 11 for example)

  • transport_local Path for local artifact e.g. "/tmp/jdk-8u172-linux-x64.tar.gz"

  • transport_s3_bucket - s3 bucket name

    default: s3_bucket

  • transport_s3_path - path to patch folder in bucket

    default: /folder

  • transport_s3_aws_access_key - aws key. Need to be set as parameter or env variables according to https://docs.ansible.com/ansible/latest/modules/aws_s3_module.html

    default: {{ lookup('env','AWS_ACCESS_KEY') }}

  • transport_s3_aws_secret_key - aws secret key. Need to be set as parameter or env variables according to https://docs.ansible.com/ansible/latest/modules/aws_s3_module.html

    default: {{ lookup('env','AWS_SECRET_KEY') }}

Configure AdoptOpenJDK

  • adoptopenjdk_impl AdoptOpenJDK Implementation
    • hotspot (default)
    • openj9

Configure executable paths

  • java_setup_path - to enable binary path setup. If true java binaries are added to system paths, profile is updated and alternatives are set. If set to false - no system settings updates will be done excepting performed by package scenarios.
    default: true

Configure alternatives priority

  • java_alternative_priority - priority configuration. Usefull if you need low priority setup. default: 100

Configure unlimited policy

  • java_unlimited_policy_enabled - to apply unlimited policy

    default: false

  • java_unlimited_policy_transport Artifact source transport. Use fallback, local, web or s3 for more predictable result.
    defaule: fallback

    Available:

    • web Fetching artifact from custom web url
    • local Local artifact stored on ansible master
    • s3 artifact in s3 bucket
  • java_unlimited_policy_transport_web URI for http/https artifact e.g. "http://my-storage.com/jce_policy-8.zip"

  • java_unlimited_policy_transport_local Path for local artifact e.g. "/tmp/jce_policy-8.zip"

  • java_unlimited_policy_transport_s3_bucket - s3 bucket name

    default: s3_bucket

  • java_unlimited_policy_transport_s3_path - path to patch folder in bucket

    default: /folder

Some examples of the installing current role

ansible-galaxy install lean_delivery.java

Example Playbook

Installing OpenJDK 17 from openjdk-fallback (default role behaviour):

- name: Install openjdk java
  hosts: all

  roles:
    - role: lean_delivery.java
      java_major_version: 17

Installing OpenJDK 8 from repositories:

- name: Install openjdk java
  hosts: all

  roles:
    - role: lean_delivery.java
      transport: repositories
      java_major_version: 8

Installing OpenJDK 11 from web:

- name: Install openjdk java
  hosts: all

  roles:
    - role: lean_delivery.java
      java_major_version: 11
      java_tarball_install: true
      transport: web
      transport_web: https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_linux-x64_bin.tar.gz

Installing Oracle java 8 from local file:

- name: Install oracle java
  hosts: all

  roles:
    - role: lean_delivery.java
      java_distribution: oracle_java
      transport: local
      transport_local: /tmp/jdk-8u181-linux-x64.tar.gz

Installing Oracle java 8 from S3 bucket:

Before install you should prepare host to use aws_s3 module https://docs.ansible.com/ansible/latest/modules/aws_s3_module.html#requirements

- name: Install java
  hosts: all
  
  roles:
    - role: lean_delivery.java
        java_distribution: oracle_java
        java_package: jre
        java_major_version: 8
        transport: s3
        transport_s3_bucket: java-s3-bucket
        transport_s3_path: /java/jre-8u181-linux-x64.tar.gz

Installing OpenJDK 11.0.2 on Windows host with win_chocolatey:

- name: Install java
  hosts: windows

  roles:
    - role: lean_delivery.java
      java_package: jdk
      transport: chocolatey
      java_major_version: 11
      java_minor_version: 0.2

Installing SAPJVM 8 from sapjvm-fallback:

- name: Install sapjvm
  hosts: all

  roles:
    - role: lean_delivery.java
      java_distribution: sapjvm
      transport: fallback
      java_major_version: 8

Installing ZULU 17 from zulu-fallback:

- name: Install zulu
  hosts: all

  roles:
    - role: lean_delivery.java
      java_distribution: zulu
      transport: fallback
      java_major_version: 17
      java_package: jdk

Installing AdoptOpenJDK 8-openj9-jre from adoptopenjdk-fallback:

- name: Install AdoptOpenJDK
  hosts: all

  roles:
    - role: lean_delivery.java
      java_distribution: adoptopenjdk
      transport: fallback
      java_package: jre
      adoptopenjdk_impl: openj9
      java_major_version: 8

Installing SapMachine sapmachine-jre-10 from sapmachine-fallback:

- name: Install SapMachine
  hosts: all

  roles:
    - role: lean_delivery.java
      java_distribution: sapmachine
      transport: fallback
      java_package: jre
      java_major_version: 10

Installing Alibaba Dragonwell 8 from dragonwell8-fallback:

- name: Install Alibaba Dragonwell8
  hosts: all

  roles:
    - role: lean_delivery.java
      java_distribution: dragonwell8
      transport: fallback
      java_major_version: 8

Installing Amazon Corretto JDK 8 from corretto-fallback:

- name: Install Amazon Corretto
  hosts: all

  roles:
    - role: lean_delivery.java
      java_distribution: corretto
      transport: fallback
      java_major_version: 8

Installing Amazon Corretto JDK 11 from repo on Amazon Linux 2:

- name: Install Amazon Corretto
  hosts: all

  roles:
    - role: lean_delivery.java
      java_distribution: corretto
      transport: repositories
      java_major_version: 11

Installing Amazon Corretto JDK 11 on Ubuntu 18.04 from web:

- name: Install Amazon Corretto
  hosts: all

  roles:
    - role: lean_delivery.java
      java_distribution: corretto
      transport: web
      transport_web: https://d3pxv6yz143wms.cloudfront.net/11.0.5.10.1/amazon-corretto-11.0.5.10.1-linux-x64.tar.gz

License

Apache

Author Information

authors:

ansible-role-java's People

Contributors

anastacia-maletskaya-epam avatar arno49 avatar artyom-gatalsky avatar dmitriystoyanov avatar dzmitry-rudnouski avatar dzmitryastrouski avatar ignatovich-artem avatar kuzmin-dmitry avatar lab-lamz4 avatar lask79 avatar lemiwork avatar pavelpikta avatar rockdreamer avatar rrhuffy avatar tgadiev avatar viachaslaukabak avatar vitali-stanevich avatar y6vmeq avatar yevgeniyshpolyanskiy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ansible-role-java's Issues

Installing java from local file will not work as expected

SUMMARY

Tried the point in the README installing from local file.
I've download the jdk11 from oracle and store it into directory /home/lars/Downloads, set transport_local to /home/lars/Downloads/jdk-11.0.2_linux-x64_bin.tar.gz
And I want to set the java_path to /opt/java

ISSUE TYPE
  • Bug Report
COMPONENT NAME
ANSIBLE VERSION
ansible 2.7.8
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/lars/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.6/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.6.8 (default, Jan  2 2019, 05:35:58) [GCC 8.2.0]
CONFIGURATION
/etc/ansible/ansible.cfg
[defaults]
[inventory]
[privilege_escalation]
[paramiko_connection]
[ssh_connection]
[persistent_connection]
[accelerate]
[selinux]
[colors]
[diff]
OS / ENVIRONMENT

Linux Solus amd64

STEPS TO REPRODUCE
cat >java.yml <<EOF
---
- name: Install Java
  hosts: localhost

  roles:
    - role: lean_delivery.java
      transport: local
      transport_local: /home/lars/Downloads/jdk-11.0.2_linux-x64_bin.tar.gz
      java_path:   /opt/java
EOF

ansible-playbook java.yml
EXPECTED RESULTS

jdk 11 will install into /opt/java

ACTUAL RESULTS
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'


PLAY [Install Java] *************************************************************************************************************************************************************

TASK [Gathering Facts] **********************************************************************************************************************************************************
ok: [localhost]

TASK [lean_delivery.java : Load a variable file based on distribution or OS family] *********************************************************************************************
ok: [localhost] => (item=/home/lars/.ansible/roles/lean_delivery.java/vars/default.yml)

TASK [lean_delivery.java : Choose platform based task] **************************************************************************************************************************
included: /home/lars/.ansible/roles/lean_delivery.java/tasks/System-Linux.yml for localhost

TASK [lean_delivery.java : Fetch oracle artifact with local transport] **********************************************************************************************************
included: /home/lars/.ansible/roles/lean_delivery.java/tasks/fetch/local.yml for localhost

TASK [lean_delivery.java : Artifact stored localy] ******************************************************************************************************************************
ok: [localhost]

TASK [lean_delivery.java : Split artifact name] *********************************************************************************************************************************
ok: [localhost]

TASK [lean_delivery.java : Set variables based on split] ************************************************************************************************************************
ok: [localhost]

TASK [lean_delivery.java : Copy artifact to destination] ************************************************************************************************************************
fatal: [localhost]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'download_default_path' is undefined\n\nThe error appears to have been in '/home/lars/.ansible/roles/lean_delivery.java/tasks/fetch/local.yml': line 22, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Copy artifact to destination\n  ^ here\n"}
PLAY RECAP **********************************************************************************************************************************************************************
localhost                  : ok=7    changed=0    unreachable=0    failed=1   

getting the error; The error was: 'java_artifact' is undefined

SUMMARY

getting error on ansible run

ISSUE TYPE
  • Bug Report
COMPONENT NAME

ansible-role-java

ANSIBLE VERSION
ha2021$ ansible --version
ansible 2.10.5
  config file = None
  configured module search path = ['/Users/ha2021/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.9/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.9.1 (default, Feb  3 2021, 07:04:15) [Clang 12.0.0 (clang-1200.0.32.29)]
[~/gitrepos/ansible-role-java] (master)

CONFIGURATION
ha2021$ ansible-config dump --only-changed
HOST_KEY_CHECKING(env: ANSIBLE_HOST_KEY_CHECKING) = False
OS / ENVIRONMENT

Ansible workstation is running:
MacOS 10.15.7

Server being configured is:
Red Hat Enterprise Linux 8.3 (Ootpa)

STEPS TO REPRODUCE
---
- name: Install AdoptOpenJDK
  hosts: dev_vm
  vars:
    - username: ansible
    - user_ssh_private_key: /Users/ha2021/gitrepos/ansible-bootstrap-server/ssh-keys/ansible-ssh-key.key
    - ansible_connection: ssh 
    - ansible_ssh_user: "{{ username }}"
    - ansible_ssh_private_key_file: "{{ user_ssh_private_key }}"

  roles:
    - role: java
      # adoptopenjdk does not work - gives error "The error was: 'java_artifact' is undefined"
      # java_download_path: /tmp
      # java_distribution: adoptopenjdk
      # transport: fallback
      # java_package: jre
      # adoptopenjdk_impl: hotspot
      # java_major_version: 13

      # openjdk 15 does not work - gives error "The error was: 'java_artifact' is undefined"
      java_distribution: openjdk
      transport: fallback
      java_major_version: 15
      java_setup_path: true
      java_download_path: /tmp
      java_tarball_install: true

      # openjdk 8 works
      # java_distribution: openjdk
      # transport: repositories
      # java_major_version: 8
      # java_setup_path: true
      # java_path: /usr/lib/jvm
      # java_tarball_install: false
      # java_alternative_priority: 100
      # java_unlimited_policy_enabled: false
EXPECTED RESULTS

java installs with no errors

ACTUAL RESULTS
TASK [java : Install java packages] **********************************************************************************************************************************************************************************
fatal: [172.X.X.X]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'java_artifact' is undefined\n\nThe error appears to be in '/Users/ha2021/gitrepos/ansible-role-java/roles/java/tasks/Linux/install/RedHat.yml': line 2, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n---\n- name: Install java packages\n  ^ here\n"}

Failed to install security policy for oracle jre

SUMMARY

Failed to install security policy for oracle jre

ISSUE TYPE
  • Bug Report
COMPONENT NAME

https://github.com/lean-delivery/ansible-role-java/blob/master/tasks/Linux/security_policy.yml

ANSIBLE VERSION
2.9.1
CONFIGURATION
OS / ENVIRONMENT

Linux

STEPS TO REPRODUCE
---
- name: Converge
  hosts: all
  roles:
    - role: ansible-role-java
      java_distribution: oracle_java
      java_package: jdk
      java_major_version: 7
      transport: local
      transport_local: /vagrant/artifatcs/jdk-7u80-linux-x64.tar.gz
      java_unlimited_policy_enabled: true
      java_unlimited_policy_transport: local
      java_unlimited_policy_transport_local: /vagrant/artifatcs/UnlimitedJCEPolicyJDK7.zip
EXPECTED RESULTS

Role complete succesfully

ACTUAL RESULTS
TASK [lean_delivery.java : Apply security policy patch] ****************************************************************************************************************************************included: /home/centos/roles/lean_delivery.java/tasks/Linux/security_policy.yml for localhost

TASK [lean_delivery.java : Fetch oracle security policy with local transport] ******************************************************************************************************************included: /home/centos/roles/lean_delivery.java/tasks/Linux/fetch/security-fetch/security-fetch-local.yml for localhost

TASK [lean_delivery.java : Copy security policy artifact to destination] ***********************************************************************************************************************ok: [localhost]

TASK [lean_delivery.java : Downloaded artifact] ************************************************************************************************************************************************ok: [localhost]

TASK [lean_delivery.java : Unzip patch file] ***************************************************************************************************************************************************changed: [localhost]

TASK [lean_delivery.java : Apply patch file] ***************************************************************************************************************************************************changed: [localhost] => (item=local_policy.jar)
changed: [localhost] => (item=US_export_policy.jar)
ok: [localhost] => (item=README.txt)

TASK [lean_delivery.java : Apply setting] ******************************************************************************************************************************************************fatal: [localhost]: FAILED! => {"changed": false, "msg": "Path /usr/java/jre1.7.0_80/jre/lib/security/java.security does not exist !", "rc": 257}

Not working with Python3.7

SUMMARY

Ansible role fails on Gathering Facts .

ISSUE TYPE
COMPONENT NAME
ANSIBLE VERSION
ansible 2.8.4
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.7.3 (default, May  3 2019, 11:24:39) [GCC 8.3.0]
CONFIGURATION
OS / ENVIRONMENT

N/A

STEPS TO REPRODUCE
- name: install java
  hosts: all
  become: true
  become_user: root
  roles:
    - role: ansible-role-java
      java_package: jdk
      java_major_version: 8
      java_distribution: oracle_java
      transport: s3
      transport_s3_path: jdk-8u212-linux-x64.tar.gz
      transport_s3_bucket: "{{ aws_bucket_name }}"
      transport_s3_aws_access_key: "{{ aws_access_key_id }}"
      transport_s3_aws_secret_key: "{{ aws_secret_access_key }}"
EXPECTED RESULTS
ACTUAL RESULTS
TASK [Gathering Facts] *********************************************************
/usr/lib/python3.7/site-packages/paramiko/kex_ecdh_nist.py:39: CryptographyDeprecationWarning: encode_point has been deprecated on EllipticCurvePublicNumbers and will be removed in a future version. Please use EllipticCurvePublicKey.public_bytes to obtain both compressed and uncompressed point encoding.
  m.add_string(self.Q_C.public_numbers().encode_point())
/usr/lib/python3.7/site-packages/paramiko/kex_ecdh_nist.py:96: CryptographyDeprecationWarning: Support for unsafe construction of public numbers from encoded data will be removed in a future version. Please use EllipticCurvePublicKey.from_encoded_point
  self.curve, Q_S_bytes
/usr/lib/python3.7/site-packages/paramiko/kex_ecdh_nist.py:111: CryptographyDeprecationWarning: encode_point has been deprecated on EllipticCurvePublicNumbers and will be removed in a future version. Please use EllipticCurvePublicKey.public_bytes to obtain both compressed and uncompressed point encoding.
  hm.add_string(self.Q_C.public_numbers().encode_point())
fatal: [default]: UNREACHABLE! => {"changed": false, "msg": "Authentication or permission failure. In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote tmp path in ansible.cfg to a path rooted in \"/tmp\". Failed command was: ( umask 77 && mkdir -p \"` echo /root/.ansible/tmp/ansible-tmp-1569748498.059054-219969678795466 `\" && echo ansible-tmp-1569748498.059054-219969678795466=\"` echo /root/.ansible/tmp/ansible-tmp-1569748498.059054-219969678795466 `\" ), exited with result 1", "unreachable": true}

Maybe you have mistake in README

When I have tried to run playbook with example from README

- name: "Install java"
  hosts: all

  roles:
    - role: "lean-delivery.java"
      java_major_version: 8
      java_minor_version: 191
      java_arch: "x64"
      java_package: "jdk"

I have got error:

[zak@localhost lean_delivery.java]$ ansible-playbook -i host playbook.yml
ERROR! the role 'lean-delivery.java' was not found in /home/zak/.ansible/roles/lean_delivery.java/roles:/home/zak/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/home/zak/.ansible/roles/lean_delivery.java

The error appears to have been in '/home/zak/.ansible/roles/lean_delivery.java/playbook.yml': line 5, column 7, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

  roles:
    - role: "lean-delivery.java"
      ^ here

Because role name in playbook has name lean-delivery.java , but folder which was created galaxy have had lean_delivery.java (underscore).

Embedding CI/CD Status Images

Could you please add ci/cd status image for the repo? It will help to understand the current status of the master branch.

SAP JVM Centos 8 tests failed

SUMMARY

Ansible verifier tests failed on Centos 8

ISSUE TYPE
  • Bug Report
COMPONENT NAME

SAP JVM

ANSIBLE VERSION
2.8.5
CONFIGURATION
OS / ENVIRONMENT

Centos 8

STEPS TO REPRODUCE
  inventory:
    group_vars:
      sapjvm:
        java_distribution: sapjvm
        transport: sapjvm-fallback
        java_major_version: 8
EXPECTED RESULTS

Ansible verivier test should be passed

ACTUAL RESULTS
    fatal: [test-aws-centos8-sapjvm-8]: FAILED! => changed=true 
      cmd:
      - java
      - -version
      delta: '0:00:00.080198'
      end: '2019-10-23 11:18:33.077975'
      msg: non-zero return code
      rc: 1
      start: '2019-10-23 11:18:32.997777'
      stderr: |-
        ERROR: transport library not found: dt_socket
        ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_LOAD(509)
        JDWP exit error AGENT_ERROR_TRANSPORT_LOAD(196): No transports initialized [debugInit.c:791]
        ERROR: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_LOAD(196)
      stderr_lines: <omitted>
      stdout: ''
      stdout_lines: <omitted>

Problem with otn transport on Windows

SUMMARY
ISSUE TYPE
  • Bug Report
COMPONENT NAME

tasks/win_fetch/oracle-fallback.yml

ANSIBLE VERSION
2.5.13
CONFIGURATION
OS / ENVIRONMENT

Windows Server 2016

STEPS TO REPRODUCE
---
- name: install Oracle-Java
  hosts: windows
  roles:
    - role: "lean_delivery.java"
EXPECTED RESULTS
ACTUAL RESULTS
    TASK [ansible-role-java : Fetch root page https://www.oracle.com/technetwork/java/javase/downloads/index.html] ***
    fatal: [test-aws-windows-ansible-role-java-8-otn]: FAILED! => changed=false 
      msg: 'WebException occurred when sending web request: The request was aborted: Could not create SSL/TLS secure channel.'
      url: https://www.oracle.com/technetwork/java/javase/downloads/index.html

JAVA installation on Windows platform

SUMMARY

JAVA is not installed to Windows hosts with 'win_chocolatey' module because of incorrect Ansible fact is used

ISSUE TYPE
  • Bug Report
COMPONENT NAME

task/main.yml

task:

  • name: "Choose platform based task "
ANSIBLE VERSION
ansible 2.5.5
CONFIGURATION

ALLOW_WORLD_READABLE_TMPFILES(/etc/ansible/se-provision/playbooks/sdl/ansible.cfg) = True
ANSIBLE_FORCE_COLOR(/etc/ansible/se-provision/playbooks/sdl/ansible.cfg) = True
DEFAULT_HOST_LIST(/etc/ansible/se-provision/playbooks/sdl/ansible.cfg) = [u'/etc/ansible/se-provision/playbooks/sdl/vagrant_inventory']
DEFAULT_MODULE_PATH(/etc/ansible/se-provision/playbooks/sdl/ansible.cfg) = [u'/etc/ansible/se-provision/library']
DEFAULT_ROLES_PATH(/etc/ansible/se-provision/playbooks/sdl/ansible.cfg) = [u'/etc/ansible/se-provision/roles']
HOST_KEY_CHECKING(/etc/ansible/se-provision/playbooks/sdl/ansible.cfg) = False
RETRY_FILES_ENABLED(/etc/ansible/se-provision/playbooks/sdl/ansible.cfg) = False

OS / ENVIRONMENT
STEPS TO REPRODUCE
- name: Install java
  hosts: windows
  roles:
    - role: ../../roles/ansible-role-java
      java_major_version: 8
      java_package: "jre"
      transport: "win-chocolatey"
EXPECTED RESULTS

Get jre 8 installed to Windows hosts with win_chocolatey module

ACTUAL RESULTS
Instead of 'tasks/system/Windows.yml' 'tasks/system/not-supported.yml' is called by 'tasks/main.yml'

Problem with oracle-fallback transport

SUMMARY

Default role transport doesn't working.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

tasks/fetch/oracle-fallback.yml
tasks/win_fetch/oracle-fallback.yml

ANSIBLE VERSION
2.7.10
CONFIGURATION
OS / ENVIRONMENT

Linux / Windows

STEPS TO REPRODUCE
- name: Install java
  hosts: all

  roles:
    - role: lean_delivery.java
      java_major_version: 8
      java_minor_version: 202
      java_arch: x64
      java_package: jdk
EXPECTED RESULTS
ACTUAL RESULTS
    TASK [ansible-role-java : Show artifacts' urls found] **************************
    ok: [test-aws-centos7-ansible-role-java-12-rpm] => 
      artifact_url_list: []
    ok: [test-aws-ubuntu18-ansible-role-java-12-otn-deb] => 
      artifact_url_list: []
    ok: [test-aws-Debian9-ansible-role-java-12-otn-tb] => 
      artifact_url_list: []
    
    TASK [ansible-role-java : No artifact urls found] ******************************
    fatal: [test-aws-centos7-ansible-role-java-12-rpm]: FAILED! => changed=false 
      msg: No artifact urls found, check java_package, java_major_version, java_minor_version, java_arch variables
    fatal: [test-aws-ubuntu18-ansible-role-java-12-otn-deb]: FAILED! => changed=false 
      msg: No artifact urls found, check java_package, java_major_version, java_minor_version, java_arch variables
    fatal: [test-aws-Debian9-ansible-role-java-12-otn-tb]: FAILED! => changed=false 
      msg: No artifact urls found, check java_package, java_major_version, java_minor_version, java_arch variables
    
    PLAY RECAP *********************************************************************
    test-aws-Debian9-ansible-role-java-12-otn-tb : ok=10   changed=0    unreachable=0    failed=1   
    test-aws-centos7-ansible-role-java-12-rpm : ok=10   changed=0    unreachable=0    failed=1   
    test-aws-ubuntu18-ansible-role-java-12-otn-deb : ok=10   changed=0    unreachable=0    failed=1   

Update required Ansible version in README.md

SUMMARY
  1. Need to update README.md by changing version of the ansible
    "Version of the ansible for installation: 2.4" -> "Version of the ansible for installation: 2.5"
    There is an error in 2.4:

TASK [lean_delivery.java : Warn on unsupported platform] ************************************************************************************************************************************************************************************
fatal: [192.168.33.16]: FAILED! => {"changed": false, "msg": "This role does not support 'RedHat' platform.Please contact [email protected]"}

ISSUE TYPE
  • Documentation Report

Fix Centos8 tests

SUMMARY

Centos8 tests failed

ISSUE TYPE
  • Bug Report
TASK [Enable EPEL repository] **************************************************
Monday 31 January 2022  11:03:44 +0000 (0:00:05.255)       0:00:05.283 ********
FAILED - RETRYING: Enable EPEL repository (3 retries left).
FAILED - RETRYING: Enable EPEL repository (2 retries left).
FAILED - RETRYING: Enable EPEL repository (1 retries left).
fatal: [test-aws-centos8-dragonwell8]: FAILED! => changed=false 
  attempts: 3
  msg: 'Failed to download metadata for repo ''appstream'': Cannot prepare internal mirrorlist: No URLs in mirrorlist'

Install Oracle JRE8 on a Windows 10 machine fails as choco_ vars not set for this by default

SUMMARY

Trying to install Oracle JRE8 on a Windows 10 machine using transport chocolatey.
Fails as oracle_java_vars.yml does not define the choco_ variables.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

vars\java_distro_configs\oracle_java_vars.yml

ANSIBLE VERSION

ansible 2.9.15
config file = None
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python3.6/dist-packages/ansible
executable location = /usr/local/bin/ansible
python version = 3.6.9 (default, Nov 7 2019, 10:44:02) [GCC 8.3.0]

CONFIGURATION

From playbook under pre_task:

  • name: Installing role
    include_role:
    name: lean_delivery.java
    vars:
    java_distribution: oracle_java
    java_package: jre
    transport: chocolatey
    java_major_version: 8
OS / ENVIRONMENT

Ansible controller: Ubuntu
Host: Windows 10 PRO

STEPS TO REPRODUCE

Just try deploy to Windows 10 host with the configuration I outlined. Will 100% fail

EXPECTED RESULTS

Playbook fails.

ACTUAL RESULTS

Dump of error:
TASK [lean_delivery.java : Install {{ choco_java_package }} from chocolatey] ***********************************************************************************************************************************************task path: /root/.ansible/roles/lean_delivery.java/tasks/Win32NT/install/chocolatey.yml:7
fatal: [dk-winv-jenag01.3shape.local]: FAILED! => {
"msg": "The task includes an option with an undefined variable. The error was: 'choco_java_package' is undefined\n\nThe error appears to be in '/root/.ansible/roles/lean_delivery.java/tasks/Win32NT/install/chocolatey.yml': line 7, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: 'Install {{ choco_java_package }} from chocolatey'\n ^ here\nWe could be wrong, but this one looks like it might be an issue with\nmissing quotes. Always quote template expression brackets when they\nstart a value. For instance:\n\n with_items:\n - {{ foo }}\n\nShould be written as:\n\n with_items:\n - "{{ foo }}"\n"
}

Update the role with cookiecutter and add tests

Add gitlab tests to cover role's supported OS - EL, Ubuntu, Debian (not Windows at the moment, it goes in a separate issue) and various roles parameters jdk/jre/server-jre, major/minor_version etc.

Add support for Temurin instead of AdoptOpenJdk

SUMMARY

AdoptOpenJdk choco package has been deprecated in flavor of Temurin
In addition, AdoptOpenJdk has been rebrand Temurin (Adoptium) and will provide upcoming version of java

ISSUE TYPE
  • Feature Idea

Oracle-fallback transport for security fetch isn't working with ansible 2.8

SUMMARY

Failed to get security policy with oracle-fallback transport

ISSUE TYPE
  • Bug Report
COMPONENT NAME

security-winfetch-oracle-fallback.yml

ANSIBLE VERSION
2.8.3
CONFIGURATION
OS / ENVIRONMENT
STEPS TO REPRODUCE

Run molecule scenario: cloud-aws-windows-8

EXPECTED RESULTS

Scenario complete successfully

ACTUAL RESULTS
fatal: [test-aws-windows2016-oracle_java-8-web]: FAILED! => changed=false 

    
  attempts: 15

    
  msg: 'Unsupported parameters for (win_get_url) module: mode. Supported parameters include: proxy_url, url_password, headers, proxy_password, proxy_username, validate_certs, force, url, checksum, checksum_algorithm, dest, use_proxy, timeout, force_basic_auth, checksum_url, url_username, password, username'

Add java unlimited security policy

SUMMARY
ISSUE TYPE
  • Feature Idea
COMPONENT NAME
ANSIBLE VERSION

CONFIGURATION
OS / ENVIRONMENT
STEPS TO REPRODUCE
EXPECTED RESULTS
ACTUAL RESULTS

OpenJDK-fallback transport

SUMMARY

The build fails, due to a wrong regex in the java role.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

openjdk-fallback transport

Add s3 transport tests for molecule

SUMMARY

Currently we have tests for web and oracle-fallback transports. But no tests for s3 scenarios.

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

molecule

ANSIBLE VERSION

2.5-2.7

OS / ENVIRONMENT

Supported Linux platforms:

  • RHEL & CentOS 6, 7
  • Ubuntu & Debian

Deprecation warning: callback_whitelist option, normalizing names to new standard, use callback_enabled instead

SUMMARY

Ansible is generating warnings saying that callback_whitelist is deprecated and to use callback_enabled instead:

[DEPRECATION WARNING]: [defaults]callback_whitelist option, normalizing names to new standard, use callback_enabled instead. This feature will be removed from ansible-core in version 2.15. Deprecation warnings can be disabled by setting
deprecation_warnings=False in ansible.cfg.
ISSUE TYPE
  • Bug Report
COMPONENT NAME
  • ansible-role-java 7.1.1
ANSIBLE VERSION
ansible [core 2.11.2]
  config file = /home/f5331870/digital-ansible/ansible.cfg
  configured module search path = ['/home/f5331870/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/f5331870/.cache/venv/mobile-ansible-core-3.8/lib64/python3.8/site-packages/ansible
  ansible collection location = /home/f5331870/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/f5331870/.cache/venv/mobile-ansible-core-3.8/bin/ansible
  python version = 3.8.6 (default, Oct 27 2020, 09:13:12) [GCC 9.3.1 20200408 (Red Hat 9.3.1-2)]
  jinja version = 3.0.1
  libyaml = True
CONFIGURATION
[DEPRECATION WARNING]: [defaults]callback_whitelist option, normalizing names to new standard, use callback_enabled instead. This feature will be removed from ansible-core in version 2.15. Deprecation warnings can be disabled by setting
deprecation_warnings=False in ansible.cfg.
ANSIBLE_NOCOWS(/home/f5331870/digital-ansible/ansible.cfg) = True
CACHE_PLUGIN(/home/f5331870/digital-ansible/ansible.cfg) = redis
CACHE_PLUGIN_CONNECTION(/home/f5331870/digital-ansible/ansible.cfg) = localhost:6379:0
CACHE_PLUGIN_TIMEOUT(/home/f5331870/digital-ansible/ansible.cfg) = 86400
CALLBACKS_ENABLED(/home/f5331870/digital-ansible/ansible.cfg) = ['profile_tasks']
DEFAULT_BECOME(/home/f5331870/digital-ansible/ansible.cfg) = False
DEFAULT_FORKS(/home/f5331870/digital-ansible/ansible.cfg) = 100
DEFAULT_HOST_LIST(/home/f5331870/digital-ansible/ansible.cfg) = ['/home/f5331870/digital-ansible/inventories/manual_inventory_int.ini']
DEFAULT_LOG_PATH(/home/f5331870/digital-ansible/ansible.cfg) = /home/f5331870/digital-ansible/.logs/ansible.log
DEFAULT_ROLES_PATH(/home/f5331870/digital-ansible/ansible.cfg) = ['/home/f5331870/digital-ansible/roles_external', '/home/f5331870/digital-ansible/roles']
DEFAULT_TIMEOUT(/home/f5331870/digital-ansible/ansible.cfg) = 180
DEFAULT_VAULT_PASSWORD_FILE(/home/f5331870/digital-ansible/ansible.cfg) = /home/f5331870/digital-ansible/vault/vault-nonprod.txt
HOST_KEY_CHECKING(/home/f5331870/digital-ansible/ansible.cfg) = False
INTERPRETER_PYTHON(/home/f5331870/digital-ansible/ansible.cfg) = auto_silent
INVENTORY_CACHE_ENABLED(/home/f5331870/digital-ansible/ansible.cfg) = True
INVENTORY_CACHE_PLUGIN(/home/f5331870/digital-ansible/ansible.cfg) = redis
RETRY_FILES_ENABLED(/home/f5331870/digital-ansible/ansible.cfg) = True
RETRY_FILES_SAVE_PATH(/home/f5331870/digital-ansible/ansible.cfg) = /home/f5331870/.ansible-retry
OS / ENVIRONMENT
LSB Version:	:core-4.1-amd64:core-4.1-noarch
Distributor ID:	CentOS
Description:	CentOS Linux release 7.9.2009 (Core)
Release:	7.9.2009
Codename:	Core
STEPS TO REPRODUCE

Run any playbook.

EXPECTED RESULTS

NO deprecation warning.

ACTUAL RESULTS

Deprecation warning.

[DEPRECATION WARNING]: [defaults]callback_whitelist option, normalizing names to new standard, use callback_enabled instead. This feature will be removed from ansible-core in version 2.15. Deprecation warnings can be disabled by setting
deprecation_warnings=False in ansible.cfg.

Update alternatives failed when installation started from specific file

SUMMARY

Version of java cannot be taken from specified file to install and works as it was 8.181

ISSUE TYPE
  • Bug Report
COMPONENT NAME
ANSIBLE VERSION
2.5.5
CONFIGURATION
OS / ENVIRONMENT
STEPS TO REPRODUCE
- name: "Install java"
  hosts: all

  roles:
    - role: "ansible-role-java"
      transport: "web"
      transport_web: "https://somehost/somedirectory/jdk-7u191-linux-x64.tar.gz"
EXPECTED RESULTS
ACTUAL RESULTS

TASK [ansible-role-java : Install java 8.181] ******************************************************************************
ok: [127.0.0.1]

TASK [ansible-role-java : Update alternatives] *****************************************************************************
failed: [127.0.0.1] (item=java) => {"binary": "java", "changed": false, "msg": "Specified path /opt/jdk//jdk1.8.0_181/bin/java does not exist"}
failed: [127.0.0.1] (item=javac) => {"binary": "javac", "changed": false, "msg": "Specified path /opt/jdk//jdk1.8.0_181/bin/javac does not exist"}
failed: [127.0.0.1] (item=jar) => {"binary": "jar", "changed": false, "msg": "Specified path /opt/jdk//jdk1.8.0_181/bin/jar does not exist"}
to retry, use: --limit @/tmp/ansible/oracle-java.retry

PLAY RECAP *****************************************************************************************************************
127.0.0.1 : ok=9 changed=0 unreachable=0 failed=1


Perhaps the misuse of 'unarchive' module

SUMMARY

Java archive is downloaded to the remote host but unarchive attempt is from the Ansible host.
Seems like 'remote_src: true' is missing.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

ansible-role-java/tasks/fetch/web.yml:

- name: "Download artifact from web"
  get_url:
    url: "{{ transport_web }}"
    dest: "{{ download_path }}"
  until: "'OK' in FILE_DOWNLOADED.msg"
  retries: 3
  delay: 2
  register: FILE_DOWNLOADED

ansible-role-java/tasks/system/Linux.yml:

    - name: "Install java {{ java_major_version }}.{{ java_minor_version }}"
      unarchive:
        src: "{{ oracle_artifact }}"
        dest: "{{ java_path }}"
        owner: "root"
        group: "root"
        mode: "0755"
ANSIBLE VERSION

ansible 2.6.1

OS / ENVIRONMENT
STEPS TO REPRODUCE
# Java vars
    java_major_version: 8
    java_minor_version: 181
    transport: "web"
    transport_web : "http://{{ storage_address }}/jdk-8u181-linux-x64.tar.gz"
EXPECTED RESULTS

Java archive will be downloaded to the Ansible host or unarchive will occur on the remote host

ACTUAL RESULTS
TASK [lean_delivery.java : Install java 8.181] *****************************************************************************************************************
fatal: [aux1]: FAILED! => {"changed": false, "msg": "Could not find or access '/tmp/jdk-8u181-linux-x64.tar.gz' on the Ansible Controller.\nIf you are using a module and expect the file to exist on the remote, see the remote_src option"}

Rename 'platform' var to something else to avoid conflicts

SUMMARY

Ansible outputs the following WARNING:

[WARNING]: The loop variable 'platform' is already in use. You should set the `loop_var` value in the `loop_control` option for the task to something else to avoid variable collisions and unexpected behavior.

ISSUE TYPE
  • Feature Idea
COMPONENT NAME
ANSIBLE VERSION
ansible 2.9.6
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.17 (default, Nov  7 2019, 10:07:09) [GCC 7.4.0]
CONFIGURATION
ANSIBLE_NOCOWS(env: ANSIBLE_NOCOWS) = True
DEFAULT_CALLBACK_WHITELIST(/etc/ansible/ansible.cfg) = [u'profile_tasks']
DEFAULT_HASH_BEHAVIOUR(/etc/ansible/ansible.cfg) = merge
DEFAULT_LOG_PATH(/etc/ansible/ansible.cfg) = /var/log/ansible.log
DIFF_ALWAYS(/etc/ansible/ansible.cfg) = True
DIFF_CONTEXT(/etc/ansible/ansible.cfg) = 3
HOST_KEY_CHECKING(/etc/ansible/ansible.cfg) = False
OS / ENVIRONMENT

Ubuntu 18

STEPS TO REPRODUCE

Import the role from a playbook that has a platform var already set.

EXPECTED RESULTS

The role should work without any issues.

ACTUAL RESULTS

The role outputs a WARNING
[WARNING]: The loop variable 'platform' is already in use. You should set the `loop_var` value in the `loop_control` option for the task to something else to avoid variable collisions and unexpected behavior.

Fix the role for windows platform

SUMMARY

Failed to install java on windows 10 using default, local and chocolatey transports.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

task/main.yml

ANSIBLE VERSION
ansible 2.7.0
STEPS TO REPRODUCE

default

---
- name: install Oracle-Java
  hosts: slave
  roles:
    - role: "lean_delivery.java"

local

---
- name: install Oracle-Java
  hosts: slave
  roles:
    - role: "lean_delivery.java"
      transport: "local"
      transport_local: "/home/vagrant/jdk-8u191-windows-x64.exe"

chocolatey

---
- name: install Oracle-Java
  hosts: slave
  roles:
    - role: "lean_delivery.java"
      java_major_version: 8
      java_package: "jre"
      transport: "win-chocolatey"
ACTUAL RESULTS

default

TASK [lean_delivery.java : Fetch oracle artifact with oracle-fallback transport] ************************
included: /home/vagrant/epam/lean_delivery.java/tasks/fetch/oracle-fallback.yml for 10.7.11.142

TASK [lean_delivery.java : Detecting system options for fetching artifact] ******************************
ok: [10.7.11.142]

TASK [lean_delivery.java : Download artifact from Oracle OTN] *******************************************
fatal: [10.7.11.142]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'dict object' has no attribute u'win32nt'\n\nThe error appears to have been in '/home/vagrant/epam/lean_delivery.java/tasks/fetch/oracle-fallback.yml': line 7, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: \"Download artifact from Oracle OTN\"\n  ^ here\n"}
        to retry, use: --limit @/home/vagrant/epam/java.retry

chocolatey

TASK [lean_delivery.java : Fetch oracle artifact with win-chocolatey transport] *************************
included: /home/vagrant/epam/lean_delivery.java/tasks/fetch/win-chocolatey.yml for 10.7.11.142

TASK [lean_delivery.java : Chocolatay will download artifact itself] ************************************
ok: [10.7.11.142] => {
    "msg": "Chocolatay will download artifact itself"
}

TASK [lean_delivery.java : Choose platform based task] **************************************************
included: /home/vagrant/epam/lean_delivery.java/tasks/system/Win32NT.yml for 10.7.11.142

TASK [lean_delivery.java : Install jre from chocolatey] *************************************************
fatal: [10.7.11.142]: FAILED! => {"changed": false, "command": "C:\\ProgramData\\chocolatey\\bin\\choco.exe install jre8 --fail-on-unfound --yes --no-progress --limit-output --package-parameters \"/InstallationPath:C:?rogram Files\\Java /Force /Machine\" --timeout 2700", "msg": "Error installing package(s) 'jre8'", "rc": 1603, "stderr": "", "stderr_lines": [], "stdout": "Installing the following packages:\r\njre8\r\nBy installing you accept licenses for the packages.\r\n\r\njre8 v8.0.191.20181114 [Approved]\r\njre8 package files install completed. Performing other installation steps.\r\nChecking to see if local install is already up to date...\r\nDownloading 32-bit installer\r\nFile appears to be downloaded already. Verifying with package checksum to determine if it needs to be redownloaded.\r\nHashes match.\r\nHashes match.\r\nC:\\Users\\user\\AppData\\Local\\Temp\\chocolatey\\jre8\\8.0.1910.12\\JRE8x86.exe\r\nInstalling JRE 8.0.1910.12 32-bit\r\nInstalling JRE8...\r\nWARNING: Generic MSI Error. This is a local environment error, not an issue with a package or the MSI itself - it could mean a pending reboot is necessary prior to install or something else (like the same version is already installed). Please see MSI log if available. If not, try again adding '--install-arguments=\"'/l*v c:\\jre8_msi_install.log'\"'. Then search the MSI Log for \"Return Value 3\" and look above that for the error.\r\nERROR: Running [\"C:\\Users\\user\\AppData\\Local\\Temp\\chocolatey\\jre8\\8.0.1910.12\\JRE8x86.exe\" /s REBOOT=0 SPONSORS=0 AUTO_UPDATE=0  ] was not successful. Exit code was '1603'. Exit code indicates the following: Generic MSI Error. This is a local environment error, not an issue with a package or the MSI itself - it could mean a pending reboot is necessary prior to install or something else (like the same version is already installed). Please see MSI log if available. If not, try again adding '--install-arguments=\"'/l*v c:\\jre8_msi_install.log'\"'. Then search the MSI Log for \"Return Value 3\" and look above that for the error..\r\nThe install of jre8 was NOT successful.\r\nError while running 'C:\\ProgramData\\chocolatey\\lib\\jre8\\tools\\chocolateyInstall.ps1'.\r\n See log for details.\r\n\r\nChocolatey installed 0/1 packages. 1 packages failed.\r\n See the log for details (C:\\ProgramData\\chocolatey\\logs\\chocolatey.log).\r\n\r\nFailures\r\n - jre8 (exited 1603) - Error while running 'C:\\ProgramData\\chocolatey\\lib\\jre8\\tools\\chocolateyInstall.ps1'.\r\n See log for details.\r\n", "stdout_lines": ["Installing the following packages:", "jre8", "By installing you accept licenses for the packages.", "", "jre8 v8.0.191.20181114 [Approved]", "jre8 package files install completed. Performing other installation steps.", "Checking to see if local install is already up to date...", "Downloading 32-bit installer", "File appears to be downloaded already. Verifying with package checksum to determine if it needs to be redownloaded.", "Hashes match.", "Hashes match.", "C:\\Users\\user\\AppData\\Local\\Temp\\chocolatey\\jre8\\8.0.1910.12\\JRE8x86.exe", "Installing JRE 8.0.1910.12 32-bit", "Installing JRE8...", "WARNING: Generic MSI Error. This is a local environment error, not an issue with a package or the MSI itself - it could mean a pending reboot is necessary prior to install or something else (like the same version is already installed). Please see MSI log if available. If not, try again adding '--install-arguments=\"'/l*v c:\\jre8_msi_install.log'\"'. Then search the MSI Log for \"Return Value 3\" and look above that for the error.", "ERROR: Running [\"C:\\Users\\user\\AppData\\Local\\Temp\\chocolatey\\jre8\\8.0.1910.12\\JRE8x86.exe\" /s REBOOT=0 SPONSORS=0 AUTO_UPDATE=0  ] was not successful. Exit code was '1603'. Exit code indicates the following: Generic MSI Error. This is a local environment error, not an issue with a package or the MSI itself - it could mean a pending reboot is necessary prior to install or something else (like the same version is already installed). Please see MSI log if available. If not, try again adding '--install-arguments=\"'/l*v c:\\jre8_msi_install.log'\"'. Then search the MSI Log for \"Return Value 3\" and look above that for the error..", "The install of jre8 was NOT successful.", "Error while running 'C:\\ProgramData\\chocolatey\\lib\\jre8\\tools\\chocolateyInstall.ps1'.", " See log for details.", "", "Chocolatey installed 0/1 packages. 1 packages failed.", " See the log for details (C:\\ProgramData\\chocolatey\\logs\\chocolatey.log).", "", "Failures", " - jre8 (exited 1603) - Error while running 'C:\\ProgramData\\chocolatey\\lib\\jre8\\tools\\chocolateyInstall.ps1'.", " See log for details."]}

local

TASK [lean_delivery.java : Fetch oracle artifact with local transport] **********************************
included: /home/vagrant/epam/lean_delivery.java/tasks/fetch/local.yml for 10.7.11.142

TASK [lean_delivery.java : Artifact stored localy] ******************************************************
ok: [10.7.11.142]

TASK [lean_delivery.java : Getting java version variables] **********************************************
ok: [10.7.11.142]

TASK [lean_delivery.java : Choose platform based task] **************************************************
included: /home/vagrant/epam/lean_delivery.java/tasks/system/Win32NT.yml for 10.7.11.142

TASK [lean_delivery.java : Install jdk from chocolatey] *************************************************
skipping: [10.7.11.142]

TASK [lean_delivery.java : Install package from local source] *******************************************
fatal: [10.7.11.142]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'java_artifact' is undefined\n\nThe error appears to have been in '/home/vagrant/epam/lean_delivery.java/tasks/system/Win32NT.yml': line 8, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: \"Install package from local source\"\n  ^ here\n"}
        to retry, use: --limit @/home/vagrant/epam/java.retry

Error setting alternatives while JRE provisioning

SUMMARY

The role tries to set alternatives for modules that are in JDK but which are not JRE

ISSUE TYPE
  • Bug Report
COMPONENT NAME

TASK [lean_delivery.java : Update alternatives]

OS / ENVIRONMENT

CentOS 7.4

STEPS TO REPRODUCE

Set transport_web : "http://{{ storage_name }}/jre-8u181-linux-x64.tar.gz"

EXPECTED RESULTS

TASK [lean_delivery.java : Update alternatives]
ok: [aux1] => (item=java)
failed: [aux1] (item=javac) => {"binary": "javac", "changed": false, "msg": "Specified path /opt/jre/jre1.8.0_181/bin/javac does not exist"}
failed: [aux1] (item=jar) => {"binary": "jar", "changed": false, "msg": "Specified path /opt/jre/jre1.8.0_181/bin/jar does not exist"}

ACTUAL RESULTS

Add javac and jar existence validation

Error on Windows Server 2016

SUMMARY

Got an error:

TASK [lean_delivery.java : Set actual java directory] ****************************************************************************************************************************************************************************************************************************************
fatal: [win-iiq]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: No last item, sequence was empty.\n\nThe error appears to be in '/etc/ansible/roles/lean_delivery.java/tasks/Win32NT/finalize_paths.yml': line 12, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Set actual java directory\n ^ here\n"}

ISSUE TYPE
  • Bug Report
ANSIBLE VERSION
ansible 2.10.8
  config file = None
  configured module search path = ['/home/vagrant/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.9.6 (default, Jun 29 2021, 10:19:25) [GCC 10.3.0]

CONFIGURATION
OS / ENVIRONMENT

Windows Server 2016 obtained via vagrant box "jborean93/WindowsServer2016"

STEPS TO REPRODUCE
---

- name: Install openjdk java
  hosts: win-dev
  
  roles:
    - role: lean_delivery.java
      java_package: jdk
      transport: chocolatey
      java_major_version: 11
      java_minor_version: 0.2
  
EXPECTED RESULTS

Java SDK installed on the system

ACTUAL RESULTS
TASK [lean_delivery.java : Set actual java directory] ****************************************************************************************************************************************************************************************************************************************
fatal: [win-iiq]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: No last item, sequence was empty.\n\nThe error appears to be in '/etc/ansible/roles/lean_delivery.java/tasks/Win32NT/finalize_paths.yml': line 12, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Set actual java directory\n  ^ here\n"}

Folder c:\Program Files\Java doesn't get created
If I create it manually, same error happens.

Add RPM request

SUMMARY

RPM java installers are not supported
adding RPM option will improve supportability of systems - ops will have ability to run new version of RPM with no extra steps

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

ansible-role-java

Openjdk fallback transport for Windows isn't working with ansible 2.8

SUMMARY

Openjdk fallback transport for Windows isn't working with ansible 2.8.3, but it still works fine with ansible 2.7.12

ISSUE TYPE
  • Bug Report
COMPONENT NAME

openjdk-fallback.yml

ANSIBLE VERSION
2.8.3
STEPS TO REPRODUCE
In .gitlab-ci.yml use 

default:
  image:
    name: leandelivery/docker-ansible-ci:ansible-2.8
EXPECTED RESULTS
included: /builds/lean-delivery/ansible-role-java/tasks/Win32NT/fetch/openjdk-fallback.yml for test-aws-windows2016-openjdk-12, test-aws-windows2019-openjdk-12
ACTUAL RESULTS
fatal: [test-aws-windows2016-openjdk-12]: FAILED! => 
      reason: |-
        'retries' is not a valid attribute for a TaskInclude
        The error appears to be in '/builds/lean-delivery/ansible-role-java/tasks/Win32NT/fetch/openjdk-fallback.yml': line 44, column 3, but may
        be elsewhere in the file depending on the exact syntax problem.
        The offending line appears to be:
        - name: Download with checksum validation
          ^ here
    fatal: [test-aws-windows2019-openjdk-12]: FAILED! => 
      reason: |-
        'retries' is not a valid attribute for a TaskInclude
        The error appears to be in '/builds/lean-delivery/ansible-role-java/tasks/Win32NT/fetch/openjdk-fallback.yml': line 44, column 3, but may
        be elsewhere in the file depending on the exact syntax problem.
        The offending line appears to be:
        - name: Download with checksum validation
          ^ here

Switch from Oracle java to OpenJDK failed at first run

SUMMARY

Switch from Oracle java to OpenJDK failed at first run

ISSUE TYPE
  • Bug Report
ANSIBLE VERSION
ansible 2.8.0
OS / ENVIRONMENT

RHEL 7.6

STEPS TO REPRODUCE

Install Oracle Java:

---
- hosts: java
  become: True
  roles:
    - role: lean_delivery.java
      transport: local
      transport_local: /tmp/jdk-8u212-linux-x64.tar.gz

Then install OpenJDK:

---
- hosts: java
  become: True
  roles:
    - role: lean_delivery.java
      java_major_version: 8
      transport: repositories
EXPECTED RESULTS

no errors

ACTUAL RESULTS
failed: [[email protected]] (item={u'binary': u'jar', u'stat': {u'charset': u'binary', u'uid': 0, u'exists': True, u'attr_flags': u'', u'woth': False, u'device_type': 0, u'mtime': 1555003030.0, u'block_size': 4096, u'inode': 8448258, u'isgid': False, u'size': 7424, u'executable': True, u'roth': True, u'isuid': False, u'readable': True, u'isreg': True, u'version': u'18446744071577196010', u'pw_name': u'root', u'gid': 0, u'ischr': False, u'wusr': True, u'writeable': True, u'isdir': False, u'blocks': 16, u'xoth': True, u'rusr': True, u'nlink': 1, u'issock': False, u'rgrp': True, u'gr_name': u'root', u'path': u'/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.212.b04-0.el7_6.x86_64/bin/jar', u'xusr': True, u'atime': 1555003030.0, u'mimetype': u'application/x-executable', u'ctime': 1558527797.0821223, u'isblk': False, u'checksum': u'3df06ad1ab4ac13ea1e5a81069456a14821f118e', u'dev': 51714, u'wgrp': False, u'isfifo': False, u'mode': u'0755', u'xgrp': True, u'islnk': False, u'attributes': []}, 'ansible_loop_var': u'binary', 'failed': False, u'invocation': {u'module_args': {u'follow': False, u'get_checksum': True, u'path': u'/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.212.b04-0.el7_6.x86_64/bin/jar', u'checksum_algorithm': u'sha1', u'get_md5': None, u'get_mime': True, u'get_attributes': True}}, u'changed': False}) => {"ansible_loop_var": "java_item", "changed": false, "cmd": "/sbin/update-alternatives --set jar /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.212.b04-0.el7_6.x86_64/bin/jar", "java_item": {"ansible_loop_var": "binary", "binary": "jar", "changed": false, "failed": false, "invocation": {"module_args": {"checksum_algorithm": "sha1", "follow": false, "get_attributes": true, "get_checksum": true, "get_md5": null, "get_mime": true, "path": "/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.212.b04-0.el7_6.x86_64/bin/jar"}}, "stat": {"atime": 1555003030.0, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 16, "charset": "binary", "checksum": "3df06ad1ab4ac13ea1e5a81069456a14821f118e", "ctime": 1558527797.0821223, "dev": 51714, "device_type": 0, "executable": true, "exists": true, "gid": 0, "gr_name": "root", "inode": 8448258, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "mimetype": "application/x-executable", "mode": "0755", "mtime": 1555003030.0, "nlink": 1, "path": "/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.212.b04-0.el7_6.x86_64/bin/jar", "pw_name": "root", "readable": true, "rgrp": true, "roth": true, "rusr": true, "size": 7424, "uid": 0, "version": "18446744071577196010", "wgrp": false, "woth": false, "writeable": true, "wusr": true, "xgrp": true, "xoth": true, "xusr": true}}, "msg": "failed to read link /usr/bin/jar: No such file or directory", "rc": 2, "stderr": "failed to read link /usr/bin/jar: No such file or directory\n", "stderr_lines": ["failed to read link /usr/bin/jar: No such file or directory"], "stdout": "", "stdout_lines": []}
Workaround

Run OpenJDK playbook 2nd time

Add possibility to install SAP JVM

Need to have possibility to install SAP JVM
The possible transports are local, web and S3 cause need to download this JVM from site using creds

Need to check the Windows OS support

Sapmachine 13 chocolatey install failed

SUMMARY

Failed to install sapmachine 13 with chocolatey transport
Reference johanjanssen/ChocolateyPackages/issues/67

ISSUE TYPE
  • Bug Report
COMPONENT NAME
ANSIBLE VERSION
2.8.7
CONFIGURATION
OS / ENVIRONMENT

Windows

STEPS TO REPRODUCE
---
- name: Converge
  hosts: all
  roles:
    - role: ansible-role-java
      java_distribution: sapmachine
      java_major_version: 13
      transport: chocolatey
EXPECTED RESULTS
ACTUAL RESULTS
665     fatal: [test-azure-windows2019-sapmachine-chocolatey-13]: FAILED! => changed=false 
666       attempts: 15
667       command: C:\ProgramData\chocolatey\bin\choco.exe install sapmachine13 --fail-on-unfound --yes --no-progress --limit-output --timeout 2700
668       msg: Error installing package(s) 'sapmachine13'
669       rc: 4294967295
670       stderr: ''
671       stderr_lines: <omitted>
672       stdout: |-
673         Installing the following packages:
674         sapmachine13
675         By installing you accept licenses for the packages.
676       
677         sapmachine13 v13.0.1 [Approved]
678         sapmachine13 package files install completed. Performing other installation steps.
679         File appears to be downloaded already. Verifying with package checksum to determine if it needs to be redownloaded.
680         Error - hashes do not match. Actual value was '0E40036E3D227E12BB10720D83404E02AFEA37C8B55908B60D1F0CA384149B01'.
681         Downloading sapmachine13 64 bit
682           from 'https://github.com/SAP/SapMachine/releases/download/sapmachine-13.0.1/sapmachine-jdk-13.0.1_windows-x64_bin.msi'
683       
684         Download of sapmachine-jdk-13.0.1_windows-x64_bin.msi (184.8 MB) completed.
685         Error - hashes do not match. Actual value was '0E40036E3D227E12BB10720D83404E02AFEA37C8B55908B60D1F0CA384149B01'.
686         ERROR: Checksum for 'C:\Users\vm-admin\AppData\Local\Temp\chocolatey\sapmachine13\13.0.1\sapmachine-jdk-13.0.1_windows-x64_bin.msi' did not meet 'E6F4240B0D735313E81A04E42248BADA01469BF336F0311467ABE163F702A379' for checksum type 'sha256'. Consider passing the actual checksums through with --checksum --checksum64 once you validate the checksums are appropriate. A less secure option is to pass --ignore-checksums if necessary.
687         The install of sapmachine13 was NOT successful.
688         Error while running 'C:\ProgramData\chocolatey\lib\sapmachine13\tools\chocolateyinstall.ps1'.
689          See log for details.
690       
691         Chocolatey installed 0/1 packages. 1 packages failed.
692          See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
693       
694         Failures
695          - sapmachine13 (exited -1) - Error while running 'C:\ProgramData\chocolatey\lib\sapmachine13\tools\chocolateyinstall.ps1'.
696          See log for details.
697       stdout_lines: <omitted>

Testinfra test fails for package install on Ubuntu 18

SUMMARY

Testinfra test reports failure after installation of Java 11 deb package on Ubuntu 18

ISSUE TYPE
  • Bug Report
COMPONENT NAME

testinfra test

ANSIBLE VERSION
ansible 2.5.14
  config file = None
  configured module search path = [u'/home/gitlab-runner/.local/lib/python2.7/site-packages/epam_ansible']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.15 (default, Aug 16 2018, 14:17:09) [GCC 6.4.0]
CONFIGURATION

$ ansible --version
ansible 2.5.14
config file = None
configured module search path = [u'/home/gitlab-runner/.local/lib/python2.7/site-packages/epam_ansible']
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.15 (default, Aug 16 2018, 14:17:09) [GCC 6.4.0]
$ molecule --version
molecule, version 2.19.1.dev120

OS / ENVIRONMENT

Ubuntu 18.04

STEPS TO REPRODUCE

See the following job:
https://gitlab.com/lean-delivery/ansible-role-java/-/jobs/165557410

EXPECTED RESULTS

Like this one:
https://gitlab.com/lean-delivery/ansible-role-java/-/jobs/165557408

ACTUAL RESULTS
    =================================== FAILURES ===================================
    _ test_java_version[ansible://test-aws-ubuntu18-ansible-role-java-11-otn-deb] __
    
    host = <testinfra.host.Host object at 0x7f2a88853bd0>
    
        def test_java_version(host):
            command = host.run('java -version')
    >       assert command.rc == 0
    E       AssertionError: assert 127 == 0
    E        +  where 127 = CommandResult(command='java -version', exit_status=127, stdout=u'', stderr=u'/bin/sh: 1: java: not found').rc
    
    ../resources/tests/test_default.py:19: AssertionError
    ====================== 1 failed, 7 passed in 7.70 seconds ======================

Windows package installation failed

SUMMARY

Failed to install java package to custom path on Windows

ISSUE TYPE
  • Bug Report
COMPONENT NAME

lean_delivery.java/tasks/Windows/package.yml

ANSIBLE VERSION
2.7.10
CONFIGURATION
OS / ENVIRONMENT

Windows Server 2012 R2

STEPS TO REPRODUCE
---
- name: Install Java
  hosts: windows
  gather_facts: True

  roles:
    - role: "lean_delivery.java"
      java_major_version: 8
      java_package: jdk
      java_tarball_install: False
      java_path: C:\Temp\Java
EXPECTED RESULTS
ACTUAL RESULTS

TASK [lean_delivery.java : Install java packages] ******************************************************************************************************
changed: [windows.server.com]

TASK [lean_delivery.java : Find java_folder] ******************************************************************************************************
fatal: [windows.server.com]: FAILED! => {
"changed": false,
"examined": 0,
"files": [],
"matched": 0
}

MSG:

Argument path C:\Temp\Java does not exist cannot get information on

PLAY RECAP ******************************************************************************************************
windows.server.com : ok=23 changed=2 unreachable=0 failed=1


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.