Made a lot of progress on automation. Created quite a few playbooks and thought about how to implement them most effectively! I'm going to work on installation scripts for ansible (so you could easily install it on a local or remote workstation), documentation, abstraction, and DRY principles etc.

This commit is contained in:
Michael Griffin 2013-04-14 01:42:22 -07:00
parent 925c1291be
commit 09dd09e154
13 changed files with 140 additions and 4 deletions

6
PLANS.md Normal file
View file

@ -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.

View file

@ -1,6 +1,6 @@
---
- hosts: 192.168.33.10
user: vagrant
- hosts: $hosts
user: $user
sudo: yes
vars:
mongodb_path: /mongodb/

11
homebrew/homebrew.yaml Normal file
View file

@ -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)"

21
limechat/limechat.yaml Normal file
View file

@ -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

2
local-setup-vars.yaml Normal file
View file

@ -0,0 +1,2 @@
---
downloads: /.ansible-downloads/

10
local-setup.yaml Normal file
View file

@ -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

0
sublime-text/README.md Normal file
View file

View file

@ -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

21
vagrant/vagrant.yaml Normal file
View file

@ -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

View file

@ -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

0
vlc/README.md Normal file
View file

20
vlc/vlc.yaml Normal file
View file

@ -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

View file

@ -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