diff --git a/PLANS.md b/PLANS.md new file mode 100644 index 0000000..8a62624 --- /dev/null +++ b/PLANS.md @@ -0,0 +1,6 @@ +Plans +===== + +* Look into using Jinja2 to adhere with DRY principles. If an app comes in a tar archive, have a workflow for extracting apps from those archives, same thing if it comes in a dmg, or a zip. +* Look into the ability to change directories for multiple commands as upposed to having to change directories on each command. +* Ensure generalization of playbooks and assist distribution by replacing hosts and usernames with code that will allow them to be set on run time. \ No newline at end of file diff --git a/bottle-mongodb/bottle-mongodb.yaml b/bottle-mongodb/bottle-mongodb.yaml index e72d3a0..fdee901 100644 --- a/bottle-mongodb/bottle-mongodb.yaml +++ b/bottle-mongodb/bottle-mongodb.yaml @@ -1,6 +1,6 @@ --- -- hosts: 192.168.33.10 - user: vagrant +- hosts: $hosts + user: $user sudo: yes vars: mongodb_path: /mongodb/ diff --git a/homebrew/homebrew.yaml b/homebrew/homebrew.yaml new file mode 100644 index 0000000..a953f59 --- /dev/null +++ b/homebrew/homebrew.yaml @@ -0,0 +1,11 @@ +--- +- include: ../local-setup.yaml + +- hosts: $hosts + user: $user + gather_facts: false + vars_files: + - ../local-setup-vars.yaml + tasks: + - name: Run Homebrew install script + command: ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)" \ No newline at end of file diff --git a/limechat/limechat.yaml b/limechat/limechat.yaml new file mode 100644 index 0000000..8089990 --- /dev/null +++ b/limechat/limechat.yaml @@ -0,0 +1,21 @@ +--- +- include: ../local-setup.yaml + +- hosts: $hosts + user: $user + gather_facts: false + vars: + tar_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 diff --git a/local-setup-vars.yaml b/local-setup-vars.yaml new file mode 100644 index 0000000..88587e9 --- /dev/null +++ b/local-setup-vars.yaml @@ -0,0 +1,2 @@ +--- +downloads: /.ansible-downloads/ \ No newline at end of file diff --git a/local-setup.yaml b/local-setup.yaml new file mode 100644 index 0000000..4bfcfb3 --- /dev/null +++ b/local-setup.yaml @@ -0,0 +1,10 @@ +--- +- hosts: $hosts + user: $user + sudo: yes + gather_facts: false + vars_files: + - local-setup-vars.yaml + tasks: + - name: Create Ansible downloads directory + file: path=$downloads state=directory \ No newline at end of file diff --git a/sublime-text/README.md b/sublime-text/README.md new file mode 100644 index 0000000..e69de29 diff --git a/sublime-text/sublime-text.yaml b/sublime-text/sublime-text.yaml new file mode 100644 index 0000000..18bcd8c --- /dev/null +++ b/sublime-text/sublime-text.yaml @@ -0,0 +1,24 @@ +--- +- include: ../local-setup.yaml + +- hosts: $hosts + user: $user + gather_facts: false + vars: + dmg_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 + - 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 + file: src=/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl dest=/usr/bin/sublime state=link \ No newline at end of file diff --git a/vagrant/vagrant.yaml b/vagrant/vagrant.yaml new file mode 100644 index 0000000..36b9643 --- /dev/null +++ b/vagrant/vagrant.yaml @@ -0,0 +1,21 @@ +--- +- include: ../local-setup.yaml + +- hosts: $hosts + user: $user + gather_facts: false + vars: + dmg_url: http://files.vagrantup.com/packages/64e360814c3ad960d810456add977fd4c7d47ce6/Vagrant.dmg + mount_path: /Volumes/Vagrant/ + install_target: /Volumes/OSX + 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 diff --git a/virtualbox/virtualbox.yaml b/virtualbox/virtualbox.yaml new file mode 100644 index 0000000..879f9d3 --- /dev/null +++ b/virtualbox/virtualbox.yaml @@ -0,0 +1,21 @@ +--- +- include: ../local-setup.yaml + +- hosts: $hosts + 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_target: /Volumes/OSX + 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 diff --git a/vlc/README.md b/vlc/README.md new file mode 100644 index 0000000..e69de29 diff --git a/vlc/vlc.yaml b/vlc/vlc.yaml new file mode 100644 index 0000000..4db65c7 --- /dev/null +++ b/vlc/vlc.yaml @@ -0,0 +1,20 @@ +--- +- include: ../local-setup.yaml + +- hosts: $hosts + user: $user + gather_facts: false + vars: + dmg_url: http://get.videolan.org/vlc/2.0.6/macosx/vlc-2.0.6.dmg + 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 diff --git a/zeromq/zeromq.yaml b/zeromq/zeromq.yaml index d209e6c..936ca99 100644 --- a/zeromq/zeromq.yaml +++ b/zeromq/zeromq.yaml @@ -1,6 +1,6 @@ --- -- hosts: virtual_machines - user: vagrant +- hosts: $hosts + user: $user sudo: yes # Is it possible to only run certain actions as sudo ansible? tasks: - name: Install zeroMQ dependancies