Hi,
I am trying, for the first time, to install some applications with Ansible and are stuck. If I try to install a jar file it either failes or it complains about permissions on files/dirs.
When I try to install weblogic I get this errors:
TASK [weblogic : Execute weblogic installer] ************************************************************ fatal: [weblogic-01]: FAILED! => {"changed": true, "cmd": "java -Xms1024m -Xmx1024m -Djava.io.tmpdir=/u01/app/tmp/ -d64 -jar /u01/packages/fmw_12.1.3.0.0_wls.jar -silent -responseFile /u01/packages/response_file -invPtrLoc /u01/app/oracle/products/oraInst.loc", "delta": "0:00:00.750399", "end": "2018-01-29 04:26:07.152478", "msg": "non-zero return code", "rc": 1, "start": "2018-01-29 04:26:06.402079", "stderr": "", "stderr_lines": [], "stdout": "Unable to change access permissions on the temporary directory /u01/app/tmp/OraInstall2018-01-29_04-26-06AM.\nUnable to locate or create a temporary directory for the Oracle Universal Installer.", "stdout_lines": ["Unable to change access permissions on the temporary directory /u01/app/tmp/OraInstall2018-01-29_04-26-06AM.", "Unable to locate or create a temporary directory for the Oracle Universal Installer."]}
I I try to install the Dynatrace java agent I get this warnings:
`
TASK [dynatrace-java-agent : Execute dynatrace java agent installer] ************************************
[WARNING]: Using world-readable permissions for temporary files Ansible needs to create when becoming
an unprivileged user. This may be insecure. For information on securing this, see
https://docs.ansible.com/ansible/become.html#becoming-an-unprivileged-user
fatal: [default]: FAILED! => {“changed”: true, “cmd”: “java -jar /opt/dynatrace/dynatrace-agent-6.5.0.1289-unix.jar -y”, “delta”: “0:00:00.252464”, “end”: “2018-01-29 12:32:30.197585”, “msg”: “non-zero return code”, “rc”: 1, “start”: “2018-01-29 12:32:29.945121”, “stderr”: “”, “stderr_lines”: , “stdout”: “Running installer /opt/dynatrace/dynatrace-agent-6.5.0.1289-unix.jar\n-----------------------------------------------------------------------------\ndynaTrace 6.5 Installer\n-----------------------------------------------------------------------------\nplatform: Linux 3.2.0-23-generic, amd64\n-----------------------------------------------------------------------------\nInstaller is running with JVM version 1.8.0_121\n-----------------------------------------------------------------------------\nDetected OS/Arch: linux\n-----------------------------------------------------------------------------\nThe product will be installed to /opt/dynatrace/dynatrace-6.5.\nExtracting: dynatrace-6.5/agent/downloads/\nExtracting: dynatrace-6.5/agent/conf/\nExtracting: dynatrace-6.5/agent/lib/\nExtracting: dynatrace-6.5/agent/conf/\nExtracting: dynatrace-6.5/agent/lib64/\nExtracting: dynatrace-6.5/log/\nExtracting: dynatrace-6.5/agent/conf/dthostagent.ini\nExtracting: dynatrace-6.5/agent/lib/dthostagent\nExtracting: dynatrace-6.5/agent/lib/libdtagent.so\nExtracting: dynatrace-6.5/agent/lib/libdtagentcore.so\nExtracting: dynatrace-6.5/agent/conf/dthostagent.ini\nExtracting: dynatrace-6.5/agent/lib64/dthostagent\nExtracting: dynatrace-6.5/agent/lib64/dtzagent\nExtracting: dynatrace-6.5/agent/lib64/dtzagentlauncher\nExtracting: dynatrace-6.5/agent/lib64/dtzagentlauncher.ini\nExtracting: dynatrace-6.5/agent/lib64/libdtagent.lel\nExtracting: dynatrace-6.5/agent/lib64/libdtagent.so\nExtracting: dynatrace-6.5/agent/lib64/libdtagentcore.so\nExtracting: dynatrace-6.5/agent/lib64/libdtwsmbagent.so\nExtracting: dynatrace-6.5/init.d/\nExtracting: dynatrace-6.5/init.d/dynaTraceHostagent\nExtracting: dynatrace-6.5/init.d/dynaTraceWebServerAgent\nExtracting: dynatrace-6.5/init.d/dynaTracezRemoteAgent\nMaking file ‘/opt/dynatrace/dynatrace-6.5/init.d/dynaTraceHostagent’ executable…\nMaking file ‘/opt/dynatrace/dynatrace-6.5/init.d/dynaTracezRemoteAgent’ executable…\nMaking file ‘/opt/dynatrace/dynatrace-6.5/init.d/dynaTraceWebServerAgent’ executable…\nMaking file ‘/opt/dynatrace/dynatrace-6.5/agent/lib/dthostagent’ executable…\nMaking file ‘/opt/dynatrace/dynatrace-6.5/agent/lib64/dthostagent’ executable…\nMaking file ‘/opt/dynatrace/dynatrace-6.5/agent/lib64/dtzagent’ executable…\nMaking file ‘/opt/dynatrace/dynatrace-6.5/agent/lib64/dtzagentlauncher’ executable…\nSet read and write permissions on file ‘/opt/dynatrace/dynatrace-6.5/agent/lib’ …\nWARNING: Wasn’t able to set permissions for file ‘/opt/dynatrace/dynatrace-6.5/agent/lib’ !\nSet read and write permissions on file ‘/opt/dynatrace/dynatrace-6.5/agent/lib64’ …\nWARNING: Wasn’t able to set permissions for file ‘/opt/dynatrace/dynatrace-6.5/agent/lib64’ !\nSet read and write permissions on file ‘/opt/dynatrace/dynatrace-6.5/agent/downloads’ …\nWARNING: Wasn’t able to set permissions for file ‘/opt/dynatrace/dynatrace-6.5/agent/downloads’ !\nSet read and write permissions on file ‘/opt/dynatrace/dynatrace-6.5/log’ …\nWARNING: Wasn’t able to set permissions for file ‘/opt/dynatrace/dynatrace-6.5/log’ !\nSet read and write permissions on file ‘/opt/dynatrace/dynatrace-6.5/agent/conf’ …\nWARNING: Wasn’t able to set permissions for file ‘/opt/dynatrace/dynatrace-6.5/agent/conf’ !\nSet read and write permissions on file ‘/opt/dynatrace/dynatrace-6.5/agent/conf/dthostagent.ini’ …\nWARNING: Wasn’t able to set permissions for file ‘/opt/dynatrace/dynatrace-6.5/agent/conf/dthostagent.ini’ !\nInstallation finished successfully in 0s”, “stdout_lines”: [“Running installer /opt/dynatrace/dynatrace-agent-6.5.0.1289-unix.jar”, “-----------------------------------------------------------------------------”, “dynaTrace 6.5 Installer”, “-----------------------------------------------------------------------------”, “platform: Linux 3.2.0-23-generic, amd64”, “-----------------------------------------------------------------------------”, “Installer is running with JVM version 1.8.0_121”, “-----------------------------------------------------------------------------”, “Detected OS/Arch: linux”, “-----------------------------------------------------------------------------”, “The product will be installed to /opt/dynatrace/dynatrace-6.5.”, “Extracting: dynatrace-6.5/agent/downloads/”, “Extracting: dynatrace-6.5/agent/conf/”, “Extracting: dynatrace-6.5/agent/lib/”, “Extracting: dynatrace-6.5/agent/conf/”, “Extracting: dynatrace-6.5/agent/lib64/”, “Extracting: dynatrace-6.5/log/”, “Extracting: dynatrace-6.5/agent/conf/dthostagent.ini”, “Extracting: dynatrace-6.5/agent/lib/dthostagent”, “Extracting: dynatrace-6.5/agent/lib/libdtagent.so”, “Extracting: dynatrace-6.5/agent/lib/libdtagentcore.so”, “Extracting: dynatrace-6.5/agent/conf/dthostagent.ini”, “Extracting: dynatrace-6.5/agent/lib64/dthostagent”, “Extracting: dynatrace-6.5/agent/lib64/dtzagent”, “Extracting: dynatrace-6.5/agent/lib64/dtzagentlauncher”, “Extracting: dynatrace-6.5/agent/lib64/dtzagentlauncher.ini”, “Extracting: dynatrace-6.5/agent/lib64/libdtagent.lel”, “Extracting: dynatrace-6.5/agent/lib64/libdtagent.so”, “Extracting: dynatrace-6.5/agent/lib64/libdtagentcore.so”, “Extracting: dynatrace-6.5/agent/lib64/libdtwsmbagent.so”, “Extracting: dynatrace-6.5/init.d/”, “Extracting: dynatrace-6.5/init.d/dynaTraceHostagent”, “Extracting: dynatrace-6.5/init.d/dynaTraceWebServerAgent”, “Extracting: dynatrace-6.5/init.d/dynaTracezRemoteAgent”, “Making file ‘/opt/dynatrace/dynatrace-6.5/init.d/dynaTraceHostagent’ executable…”, “Making file ‘/opt/dynatrace/dynatrace-6.5/init.d/dynaTracezRemoteAgent’ executable…”, “Making file ‘/opt/dynatrace/dynatrace-6.5/init.d/dynaTraceWebServerAgent’ executable…”, “Making file ‘/opt/dynatrace/dynatrace-6.5/agent/lib/dthostagent’ executable…”, “Making file ‘/opt/dynatrace/dynatrace-6.5/agent/lib64/dthostagent’ executable…”, “Making file ‘/opt/dynatrace/dynatrace-6.5/agent/lib64/dtzagent’ executable…”, “Making file ‘/opt/dynatrace/dynatrace-6.5/agent/lib64/dtzagentlauncher’ executable…”, “Set read and write permissions on file ‘/opt/dynatrace/dynatrace-6.5/agent/lib’ …”, “WARNING: Wasn’t able to set permissions for file ‘/opt/dynatrace/dynatrace-6.5/agent/lib’ !”, “Set read and write permissions on file ‘/opt/dynatrace/dynatrace-6.5/agent/lib64’ …”, “WARNING: Wasn’t able to set permissions for file ‘/opt/dynatrace/dynatrace-6.5/agent/lib64’ !”, “Set read and write permissions on file ‘/opt/dynatrace/dynatrace-6.5/agent/downloads’ …”, “WARNING: Wasn’t able to set permissions for file ‘/opt/dynatrace/dynatrace-6.5/agent/downloads’ !”, “Set read and write permissions on file ‘/opt/dynatrace/dynatrace-6.5/log’ …”, “WARNING: Wasn’t able to set permissions for file ‘/opt/dynatrace/dynatrace-6.5/log’ !”, “Set read and write permissions on file ‘/opt/dynatrace/dynatrace-6.5/agent/conf’ …”, “WARNING: Wasn’t able to set permissions for file ‘/opt/dynatrace/dynatrace-6.5/agent/conf’ !”, “Set read and write permissions on file ‘/opt/dynatrace/dynatrace-6.5/agent/conf/dthostagent.ini’ …”, “WARNING: Wasn’t able to set permissions for file ‘/opt/dynatrace/dynatrace-6.5/agent/conf/dthostagent.ini’ !”, “Installation finished successfully in 0s”]}
`
I have tried it with the vagrant user, with the root user, on different boxes (RHEL, Fedora and Ubuntu), from another host, different configs (allow_world_readable_tmpfiles, pipelining), with a different Ansible but no luck. It produced every time the same result.
There are two ways of getting it to work properly
- If I execute the commands on the remote server itself then it does what is should do without errors or warnings.
- It also works if I install the jdk from the repository but that is not an option because we want to keep the jdk seperate from the OS.
I don’t see what I am doing wrong. Can somebody help me?
I have a craeted a Gitlab repository with a small project that generates the warning : https://gitlab.com/atstam/DebugAnsibleAndJava
I also put the debug and verbose output in there.
Ansible version:
ansible 2.4.2.0 config file = /etc/ansible/ansible.cfg configured module search path = [u'/home/arend/.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.14+ (default, Dec 5 2017, 15:17:02) [GCC 7.2.1 20171205]
Ansible config:
[defaults] host_key_checking = False allow_world_readable_tmpfiles = True