Ensured removal of extraction directories or existing apps to avoid writing errors when extracting/copying.
This commit is contained in:
parent
19d7978969
commit
43b2fb0f32
@ -1,3 +1,5 @@
|
||||
---
|
||||
- name: Remove existing app if present
|
||||
file: path=/Applications/$app_name.app state=absent
|
||||
- name: Copy $app_name_pretty app to Applications directory
|
||||
command: cp -R $app_name.app /Applications chdir=$downloads
|
||||
@ -3,11 +3,14 @@
|
||||
get_url: url=$app_url dest=$downloads/$app_name.dmg
|
||||
- name: Mount $app_name_pretty image
|
||||
command: hdiutil attach $app_name.dmg chdir=$downloads
|
||||
- name: Remove existing app if present
|
||||
file: path=/Applications/$app_name.app state=absent
|
||||
when_string: $installer_type == 'app'
|
||||
- name: Copy $app_name_pretty app to Applications directory
|
||||
command: cp -R ${mount_path}$app_name.app /Applications
|
||||
command: cp -R $mount_path$app_name.app /Applications
|
||||
when_string: $installer_type == 'app'
|
||||
- name: Install $app_name pkg
|
||||
command: sudo installer -package ${mount_path}$app_name.pkg -target $install_target
|
||||
command: sudo installer -package $mount_path$app_name.pkg -target $install_target
|
||||
when_string: $installer_type == 'pkg'
|
||||
- name: Unmount $app_name_pretty image
|
||||
command: hdiutil detach $mount_path
|
||||
@ -1,2 +1,3 @@
|
||||
---
|
||||
- name: Install $app_name pkg
|
||||
command: sudo installer -package $app_name.pkg -target $install_target
|
||||
@ -1,10 +1,15 @@
|
||||
---
|
||||
- name: Download $app_name_pretty
|
||||
get_url: url=$app_url dest=${downloads}/$app_name.tar
|
||||
get_url: url=$app_url dest=$downloads/$app_name.tar
|
||||
- name: Remove existing extraction directory if present
|
||||
file: path=$downloads$app_name/ state=absent
|
||||
- name: Create an extraction directory
|
||||
file: path=${downloads}${app_name}/ state=directory
|
||||
file: path=$downloads$app_name/ state=directory
|
||||
- name: Extract $app_name_pretty tarball
|
||||
command: tar xf $app_name.tar -C $app_name/ chdir=$downloads
|
||||
- name: Remove existing app if present
|
||||
file: path=/Applications/$app_name.app state=absent
|
||||
when_string: $installer_type == 'app'
|
||||
- name: Copy $app_name_pretty app to Applications directory
|
||||
command: cp -R $app_name/$app_name.app /Applications chdir=$downloads
|
||||
when_string: $installer_type == 'app'
|
||||
@ -12,4 +17,4 @@
|
||||
command: sudo installer -package $app_name/$app_name.pkg -target $install_target chdir=$downloads
|
||||
when_string: $installer_type == 'pkg'
|
||||
- name: Remove extraction directory
|
||||
file: path=${downloads}${app_name}/ state=absent
|
||||
file: path=$downloads$app_name/ state=absent
|
||||
@ -1,10 +1,15 @@
|
||||
---
|
||||
- name: Download $app_name_pretty
|
||||
get_url: url=$app_url dest=${downloads}/$app_name.zip
|
||||
get_url: url=$app_url dest=$downloads/$app_name.zip
|
||||
- name: Remove existing extraction directory if present
|
||||
file: path=$downloads$app_name/ state=absent
|
||||
- name: Create an extraction directory
|
||||
file: path=${downloads}${app_name}/ state=directory
|
||||
file: path=$downloads$app_name/ state=directory
|
||||
- name: Extract $app_name_pretty zip archive
|
||||
command: unzip $app_name.zip -d $app_name/ chdir=$downloads
|
||||
- name: Remove existing app if present
|
||||
file: path=/Applications/$app_name.app state=absent
|
||||
when_string: $installer_type == 'app'
|
||||
- name: Copy $app_name_pretty app to Applications directory
|
||||
command: cp -R $app_name/$app_name.app /Applications chdir=$downloads
|
||||
when_string: $installer_type == 'app'
|
||||
@ -12,4 +17,4 @@
|
||||
command: sudo installer -package $app_name/$app_name.pkg -target $install_target chdir=$downloads
|
||||
when_string: $installer_type == 'pkg'
|
||||
- name: Remove extraction directory
|
||||
file: path=${downloads}${app_name}/ state=absent
|
||||
file: path=$downloads$app_name/ state=absent
|
||||
Loading…
x
Reference in New Issue
Block a user