mac-dev-playbook/install/zip.yml
2014-02-12 21:47:18 -06:00

20 lines
No EOL
1.1 KiB
YAML

---
- name: Download {{ app_name_pretty }}
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
- 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'
- name: Install {{ app_name_pretty }} pkg
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