ansible-playbook для установки Java
Я использую этот код для установки Java с помощью Linux(Centos).. получаю эту ошибку..
FAILED! => {"changed": true, "cmd": ["tar", "-zxf", "/opt/jdk-8u171-linux-x64.tar.gz", "-C", "/opt"], "delta": "0:00:00.005366", "end": "2019-02-08 08:12:22.193308", "msg": "non-zero return code", "rc": 2, "start": "2019-02-08 08:12:22.187942", "stderr": "\ngzip: stdin: unexpected end of file\ntar: Child returned status 1\ntar: Error is not recoverable: exiting now", "stderr_lines": ["", "gzip: stdin: unexpected end of file", "tar: Child returned status 1", "tar: Error is not recoverable: exiting now"], "stdout": "", "stdout_lines": []}
to retry, use: --limit @/root/opt/java1.retry
попытался разархивировать модуль тоже, но он также выдает ошибку, что не может найти обработчик...
---
- hosts: localhost
#remote_user: oracle
become: true
vars:
download_url: http://download.oracle.com/otn-pub/java/jdk/8u171-b11/512cd62ec5174c3487ac17c61aaa89e8/jdk-8u171-linux-x64.tar.gz
download_folder: /opt
java_name: "{{download_folder}}/jdk1.8.0_171"
java_archive: "{{download_folder}}/jdk-8u171-linux-x64.tar.gz"
tasks:
- debconf:
name: oracle-java8-installer
question: shared/accepted-oracle-license-v1-1
value: true
vtype: select
tasks:
- name: Download Java
command: "wget -q -O {{java_archive}} --no-check-certificate --no-cookies --header 'Cookie: oraclelicense=accept-securebackup-cookie' {{download_url}} creates={{java_archive}}"
- name: Unpack archive
command: "tar -zxf {{java_archive}} -C {{download_folder}} creates={{java_name}}"
- name: Fix ownership
file: state=directory path="{{java_name}}" owner=root group=root recurse=yes
- name: Make Java available for system
command: 'alternatives --install "/usr/bin/java" "java" "{{java_name}}/bin/java" 2000'
- name: Clean up
file: state=absent path="{{java_archive}}"