AI智能
改变未来

centos批量部署Java环境

Java安装脚本

more /opt/shell/soft/java/install_java.sh

#!/bin/bash. /root/.bash_profileset -myum -y remove javaecho \"开始安装java---------------\"cd /usr/local/src/javatar -zxvf jdk-8u144-linux-x64.tar.gz -C /optchown -R root:root /opt/jdk1.8.0_144cat >/etc/profile.d/java.sh << EOFexport PATH=$PATH:/opt/jdk1.8.0_144/binEOF

ll /opt/shell/soft/java/

total 181356-rwxr-xr-x 1 root root       283 Jun 21  2019 install_java.sh-rw-r--r-- 1 root root 185515842 Mar  4  2019 jdk-8u144-linux-x64.tar.gz

ansible-playbook批量安装Java剧本
more /opt/shell/yaml/install_java.yaml

- hosts: \"{{ host }}\"tasks:- name: cpoy javacopy: src=/opt/shell/soft/java dest=/usr/local/src/- name: install javashell: /bin/bash /usr/local/src/java/install_java.sh
赞(0) 打赏
未经允许不得转载:爱站程序员基地 » centos批量部署Java环境