我正在尝试通过 Ansible 在 Ubuntu 20 上安装 Java 1.7。
剧本:
- hosts: all
tasks:
- name: Get the JDK installer
become: true
get_url:
url: https://download.java.net/java/GA/jdk17/0d483333a00540d886896bac774ff48b/35/GPL/openjdk-17_linux-x64_bin.tar.gz
dest: /usr/lib/jvm/
java_home: "{{ dest }}/jdk-{{ java_version }}"
- name: Unarchive Java distribution file.
unarchive:
src: /usr/lib/jvm/openjdk-17_linux-x64_bin.tar.gz
dest: /usr/lib/jvm/
remote_src: yes
list_files: yes
- name
它在第一个块上引发错误。
ERROR! conflicting action statements: get_url, url
The error appears to be in '/home/ubuntu/ansible01/install_jdk17.yml': line 5, column 7, but may
be elsewhere in the file depending on the exact syntax problem.
违规行似乎是
tasks:
- name: Get the JDK installer
^ here
如果有人给我建议或方向来解决这个问题,我将不胜感激。