diff --git a/README.md b/README.md index 0f28b7d..6b2bbe2 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ Ansible Playbooks ================= + +**The following only applies to some of these playbooks. The majority have been created to provision Mac development machines. Eventually they will be transformed to handle different operating systems and other variables, such as versions.** + Configure servers in a snap with these concise Ansible playbooks! Current Playbooks: diff --git a/alfred/alfred.yaml b/alfred/alfred.yaml new file mode 100644 index 0000000..e69de29 diff --git a/appcleaner/appcleaner.yaml b/appcleaner/appcleaner.yaml new file mode 100644 index 0000000..e69de29 diff --git a/applications.yaml b/applications.yaml new file mode 100644 index 0000000..3a13e1b --- /dev/null +++ b/applications.yaml @@ -0,0 +1,4 @@ +--- +- include: vlc/vlc.yaml +- include: transmission/transmission.yaml +- include: iterm/iterm.yaml diff --git a/brackets/brackets.yaml b/brackets/brackets.yaml new file mode 100644 index 0000000..e69de29 diff --git a/chrome/chrome.yaml b/chrome/chrome.yaml new file mode 100644 index 0000000..e69de29 diff --git a/coda/coda.yaml b/coda/coda.yaml new file mode 100644 index 0000000..e69de29 diff --git a/codekit/codekit.yaml b/codekit/codekit.yaml new file mode 100644 index 0000000..e69de29 diff --git a/espresso/espresso.yaml b/espresso/espresso.yaml new file mode 100644 index 0000000..e69de29 diff --git a/file/app.yaml b/file/app.yaml new file mode 100644 index 0000000..3dda181 --- /dev/null +++ b/file/app.yaml @@ -0,0 +1,3 @@ +--- +- name: Copy $app_name_pretty app to Applications directory + command: cp -R $app_name.app /Applications chdir=$downloads \ No newline at end of file diff --git a/file/dmg.yaml b/file/dmg.yaml new file mode 100644 index 0000000..88f2a1e --- /dev/null +++ b/file/dmg.yaml @@ -0,0 +1,13 @@ +--- +- name: Download $app_name_pretty + get_url: url=$app_url dest=$downloads/$app_name.dmg +- name: Mount $app_name_pretty image + command: hdiutil mount $app_name.dmg chdir=$downloads +- name: Copy $app_name_pretty app to Applications directory + command: cp -R ${mount_path}$app_name.app /Applications + when_string: $install_type == 'app' +- name: Install $app_name pkg + command: sudo installer -package ${mount_path}$app_name.pkg -target $install_target + when_string: $install_type == 'pkg' +- name: Unmount $app_name_pretty image + command: hdiutil unmount $mount_path \ No newline at end of file diff --git a/file/lzma.yaml b/file/lzma.yaml new file mode 100644 index 0000000..e69de29 diff --git a/file/pkg.yaml b/file/pkg.yaml new file mode 100644 index 0000000..b0420d8 --- /dev/null +++ b/file/pkg.yaml @@ -0,0 +1,2 @@ +- name: Install $app_name pkg + command: sudo installer -package $app_name.pkg -target $install_target \ No newline at end of file diff --git a/file/tar.yaml b/file/tar.yaml new file mode 100644 index 0000000..20e5124 --- /dev/null +++ b/file/tar.yaml @@ -0,0 +1,15 @@ +--- +- name: Download $app_name_pretty + get_url: url=$app_url dest=${downloads}/$app_name.tar +- name: Create an extraction 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: Copy $app_name_pretty app to Applications directory + command: cp -R $app_name/$app_name.app /Applications chdir=$downloads + when_string: $install_type == 'app' +- name: Install $app_name pkg + command: sudo installer -package $app_name/$app_name.pkg -target $install_target chdir=$downloads + when_string: $install_type == 'pkg' +- name: Remove extraction directory + file: path=${downloads}${app_name}/ state=absent \ No newline at end of file diff --git a/file/zip.yaml b/file/zip.yaml new file mode 100644 index 0000000..b847fca --- /dev/null +++ b/file/zip.yaml @@ -0,0 +1,15 @@ +--- +- name: Download $app_name_pretty + get_url: url=$app_url dest=${downloads}/$app_name.zip +- 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: Copy $app_name_pretty app to Applications directory + command: cp -R $app_name/$app_name.app /Applications chdir=$downloads + when_string: $install_type == 'app' +- name: Install $app_name pkg + command: sudo installer -package $app_name/$app_name.pkg -target $install_target chdir=$downloads + when_string: $install_type == 'pkg' +- name: Remove extraction directory + file: path=${downloads}${app_name}/ state=absent \ No newline at end of file diff --git a/firefox/firefox.yaml b/firefox/firefox.yaml new file mode 100644 index 0000000..e69de29 diff --git a/iterm/iterm.yaml b/iterm/iterm.yaml new file mode 100644 index 0000000..e1bf0ea --- /dev/null +++ b/iterm/iterm.yaml @@ -0,0 +1,15 @@ +--- +- include: ../local-setup.yaml + +- hosts: $hosts + user: $user + gather_facts: false + vars: + install_type: app + app_name: iTerm + app_name_pretty: iTerm + app_url: https://copy.com/HTIIPAwoiKVY + vars_files: + - ../local-setup-vars.yaml + tasks: + - include: ../file/zip.yaml \ No newline at end of file diff --git a/kaleidoscope/kaleidoscope.yaml b/kaleidoscope/kaleidoscope.yaml new file mode 100644 index 0000000..e69de29 diff --git a/keka/keka.yaml b/keka/keka.yaml new file mode 100644 index 0000000..e69de29 diff --git a/limechat/limechat.yaml b/limechat/limechat.yaml index 8089990..2874be4 100644 --- a/limechat/limechat.yaml +++ b/limechat/limechat.yaml @@ -5,17 +5,11 @@ user: $user gather_facts: false vars: - tar_url: https://downloads.sourceforge.net/project/limechat/limechat/LimeChat_2.34.tbz?use_mirror=master + install_type: app + app_name: LimeChat + app_name_pretty: LimeChat + app_url: https://downloads.sourceforge.net/project/limechat/limechat/LimeChat_2.34.tbz?use_mirror=master vars_files: - ../local-setup-vars.yaml tasks: - - name: Download LimeChat - get_url: url=$tar_url dest=${downloads}/limechat.tar - - name: Create an extraction directory - file: path=${downloads}limechat/ state=directory - - name: Extract LimeChat tarball - command: tar xf limechat.tar -C limechat/ chdir=$downloads - - name: Copy LimeChat app to Applications directory - command: cp -R limechat/LimeChat.app /Applications chdir=$downloads - - name: Remove extraction directory - file: path=${downloads}limechat/ state=absent \ No newline at end of file + - include: ../file/tar.yaml \ No newline at end of file diff --git a/opera/opera.yaml b/opera/opera.yaml new file mode 100644 index 0000000..e69de29 diff --git a/sequel-pro/sequel-pro.yaml b/sequel-pro/sequel-pro.yaml new file mode 100644 index 0000000..e69de29 diff --git a/slicy/slicy.yaml b/slicy/slicy.yaml new file mode 100644 index 0000000..e69de29 diff --git a/sourcetree/sourcetree.yaml b/sourcetree/sourcetree.yaml new file mode 100644 index 0000000..cfa2df4 --- /dev/null +++ b/sourcetree/sourcetree.yaml @@ -0,0 +1,16 @@ +--- +- include: ../local-setup.yaml + +- hosts: $hosts + user: $user + gather_facts: false + vars: + install_type: app + app_name: SourceTree + app_name_pretty: SourceTree + app_url: https://copy.com/RDxUBW9uhWiQ/SourceTree-1.5.8.dmg?download=1 + mount_path: /Volumes/SourceTree/ + vars_files: + - ../local-setup-vars.yaml + tasks: + - include: ../file/dmg.yaml \ No newline at end of file diff --git a/sublime-text/sublime-text.yaml b/sublime-text/sublime-text.yaml index 18bcd8c..a836fce 100644 --- a/sublime-text/sublime-text.yaml +++ b/sublime-text/sublime-text.yaml @@ -5,19 +5,15 @@ user: $user gather_facts: false vars: - dmg_url: http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%20Build%203021.dmg + install_type: app + app_name: Sublime\ Text + app_name_pretty: Sublime\ Text + app_url: http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%20Build%203021.dmg mount_path: /Volumes/Sublime\ Text/ vars_files: - ../local-setup-vars.yaml tasks: - - name: Download Sublime Text - get_url: url=$dmg_url dest=${downloads}sublime.dmg - - name: Mount Sublime Text image - command: hdiutil mount sublime.dmg chdir=$downloads - - name: Copy Sublime Text app to Applications directory - command: cp -R ${mount_path}Sublime\ Text.app /Applications - - name: Unmount Sublime Text image - command: hdiutil unmount $mount_path + - include: ../file/dmg.yaml - name: Create symlink subl for Sublime Text's subl command file: src=/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl dest=/usr/bin/subl state=link - name: Create symlink sublime for Sublime Text's subl command diff --git a/transmission/transmission.yaml b/transmission/transmission.yaml index 025be79..d087a21 100644 --- a/transmission/transmission.yaml +++ b/transmission/transmission.yaml @@ -5,17 +5,12 @@ user: $user gather_facts: false vars: - dmg_url: http://download.transmissionbt.com/files/Transmission-2.77.dmg + install_type: app + app_name: Transmission + app_name_pretty: Transmission + app_url: https://copy.com/jTqaA0JWmTmn/Transmission-2.77.dmg?download=1 mount_path: /Volumes/Transmission/ - application: Transmission vars_files: - ../local-setup-vars.yaml tasks: - - name: Download $application - get_url: url=$dmg_url dest=${downloads}/$application.dmg - - name: Mount $application image - command: hdiutil mount $application.dmg chdir=$downloads - - name: Copy $application app to Applications directory - command: cp -R ${mount_path}$application.app /Applications - - name: Unmount $application image - command: hdiutil unmount $mount_path \ No newline at end of file + - include: ../file/dmg.yaml \ No newline at end of file diff --git a/transmit/transmit.yaml b/transmit/transmit.yaml new file mode 100644 index 0000000..e69de29 diff --git a/tree/tree.yaml b/tree/tree.yaml new file mode 100644 index 0000000..e69de29 diff --git a/trimenabler/trimenabler.yaml b/trimenabler/trimenabler.yaml new file mode 100644 index 0000000..e69de29 diff --git a/vagrant/vagrant.yaml b/vagrant/vagrant.yaml index 36b9643..471aef8 100644 --- a/vagrant/vagrant.yaml +++ b/vagrant/vagrant.yaml @@ -5,17 +5,13 @@ user: $user gather_facts: false vars: - dmg_url: http://files.vagrantup.com/packages/64e360814c3ad960d810456add977fd4c7d47ce6/Vagrant.dmg - mount_path: /Volumes/Vagrant/ + install_type: pkg install_target: /Volumes/OSX + app_name: Vagrant + app_name_pretty: Vagrant + app_url: http://files.vagrantup.com/packages/64e360814c3ad960d810456add977fd4c7d47ce6/Vagrant.dmg + mount_path: /Volumes/Vagrant/ vars_files: - ../local-setup-vars.yaml tasks: - - name: Download Vagrant - get_url: url=$dmg_url dest=${downloads}/vagrant.dmg - - name: Mount Vagrant image - command: hdiutil mount vagrant.dmg chdir=$downloads - - name: Install Vagrant pkg - command: sudo installer -package ${mount_path}vagrant.pkg -target $install_target - - name: Unmount Vagrant image - command: hdiutil unmount $mount_path \ No newline at end of file + - include: ../file/dmg.pkg \ No newline at end of file diff --git a/virtualbox/virtualbox.yaml b/virtualbox/virtualbox.yaml index 879f9d3..45db253 100644 --- a/virtualbox/virtualbox.yaml +++ b/virtualbox/virtualbox.yaml @@ -5,17 +5,13 @@ user: $user gather_facts: false vars: - dmg_url: http://download.virtualbox.org/virtualbox/4.2.12/VirtualBox-4.2.12-84980-OSX.dmg - mount_path: /Volumes/VirtualBox/ + install_type: pkg install_target: /Volumes/OSX + app_name: VirtualBox + app_name_pretty: VirtualBox + app_url: http://download.virtualbox.org/virtualbox/4.2.12/VirtualBox-4.2.12-84980-OSX.dmg + mount_path: /Volumes/VirtualBox/ vars_files: - ../local-setup-vars.yaml tasks: - - name: Download VirtualBox - get_url: url=$dmg_url dest=${downloads}/virtualbox.dmg - - name: Mount VirtualBox image - command: hdiutil mount virtualbox.dmg chdir=$downloads - - name: Install VirtualBox pkg - command: sudo installer -package ${mount_path}VirtualBox.pkg -target $install_target - - name: Unmount VirtualBox image - command: hdiutil unmount $mount_path \ No newline at end of file + - include: ../file/dmg.yaml \ No newline at end of file diff --git a/vlc/vlc.yaml b/vlc/vlc.yaml index 4db65c7..677f19c 100644 --- a/vlc/vlc.yaml +++ b/vlc/vlc.yaml @@ -5,16 +5,12 @@ user: $user gather_facts: false vars: - dmg_url: http://get.videolan.org/vlc/2.0.6/macosx/vlc-2.0.6.dmg + install_type: app + app_name: VLC + app_name_pretty: VLC + app_url: https://copy.com/8WKZ3x1ZWOIC/VLC-2.0.6.dmg?download=1 mount_path: /Volumes/vlc-2.0.6/ vars_files: - ../local-setup-vars.yaml tasks: - - name: Download VLC - get_url: url=$dmg_url dest=${downloads}/vlc.dmg - - name: Mount VLC image - command: hdiutil mount vlc.dmg chdir=$downloads - - name: Copy VLC app to Applications directory - command: cp -R ${mount_path}VLC.app /Applications - - name: Unmount VLC image - command: hdiutil unmount $mount_path \ No newline at end of file + - include: ../file/dmg.yaml \ No newline at end of file