更新设备管理一键部署安装包
This commit is contained in:
BIN
roles/jdk1.8.0_73/files/jdk-8u73-linux-x64.tar.gz
Normal file
BIN
roles/jdk1.8.0_73/files/jdk-8u73-linux-x64.tar.gz
Normal file
Binary file not shown.
5
roles/jdk1.8.0_73/files/set_java_enviroment
Normal file
5
roles/jdk1.8.0_73/files/set_java_enviroment
Normal file
@@ -0,0 +1,5 @@
|
||||
#set java enviroment
|
||||
export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_73
|
||||
export JRE_HOME=$JAVA_HOME/jre
|
||||
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib
|
||||
export PATH=$PATH:$JAVA_HOME/bin
|
||||
28
roles/jdk1.8.0_73/tasks/main.yml
Normal file
28
roles/jdk1.8.0_73/tasks/main.yml
Normal file
@@ -0,0 +1,28 @@
|
||||
- name: "copy JDK install files to destination server"
|
||||
copy:
|
||||
src: "{{ role_path }}/files/"
|
||||
dest: /tmp
|
||||
mode: 0755
|
||||
|
||||
- name: "remove old java"
|
||||
shell: rpm -qa | grep openjdk | xargs rpm -e --nodeps warn=false
|
||||
ignore_errors: true
|
||||
|
||||
- name: "install JDK1.8.0_73"
|
||||
unarchive:
|
||||
src: "/tmp/jdk-8u73-linux-x64.tar.gz"
|
||||
dest: /usr/lib/jvm/
|
||||
copy: no
|
||||
mode: 0755
|
||||
|
||||
- name: "judge java enviroment"
|
||||
shell: grep "/usr/lib/jvm/jdk1.8.0_73" /etc/profile
|
||||
register: return
|
||||
ignore_errors: true
|
||||
|
||||
- name: "set java enviroment"
|
||||
shell: cat /tmp/set_java_enviroment >> /etc/profile
|
||||
when: return.rc != 0
|
||||
|
||||
- name: "source /etc/profile"
|
||||
shell: source /etc/profile
|
||||
Reference in New Issue
Block a user