0
我有一個安裝tomcat的網站的jar文件。所以我有以下任務download jar file
,install jar
文件和delete jar file
。但是我想知道它已經安裝,而不是下載並嘗試再次安裝。我怎麼能實現這樣的?安裝jar檢查是否已安裝
- name: Downloading installer
get_url:
url: http://[URl]/installfile.jar
dest: "/opt"
- name: Installing jar file
shell: java -jar "/opt/installfile.jar"
- name: Removing installer
file:
state: absent
path: "/opt/installfile.jar"
您需要決定要如何檢查安裝的軟件包。無論您是要檢查某個文件的存在,還是運行可執行文件並檢查輸出,或者手動在目標服務器上的文件中設置標誌,我不確定任何人,但你可以做到。當你決定你想要什麼,並有一個特定的問題,然後尋求幫助。 – techraf