From 4adb679c0a604277263b86619e7952533589f76d Mon Sep 17 00:00:00 2001 From: Michael Griffin Date: Mon, 15 Apr 2013 15:21:40 -0700 Subject: [PATCH] Reorganized some things, added relevant REAME files to some of the the tools, and fleshed out future plans. --- PLANS.md | 4 +++- README.md | 6 +++--- {file => install-type}/app.yaml | 0 {file => install-type}/dmg.yaml | 0 install-type/homebrew.yaml | 3 +++ {file => install-type}/lzma.yaml | 0 {file => install-type}/pkg.yaml | 0 {file => install-type}/tar.yaml | 0 {file => install-type}/zip.yaml | 0 iterm/README.md | 4 ++++ iterm/iterm.yaml | 7 +++---- limechat/README.md | 4 ++++ limechat/limechat.yaml | 6 +++--- nginx/handlers/handlers.yaml | 0 nginx/nginx.yaml | 0 nginx/tasks/tasks.yaml | 0 nginx/templates/nginx.conf.j2 | 0 php/handlers/handlers.yaml | 0 php/php.yaml | 0 php/tasks/tasks.yaml | 0 php/templates/php.ini.j2 | 0 local-setup-vars.yaml => setup-vars.yaml | 0 local-setup.yaml => setup.yaml | 3 +-- sourcetree/README.md | 4 ++++ sourcetree/sourcetree.yaml | 6 +++--- sublime-text/README.md | 4 ++++ sublime-text/sublime-text.yaml | 7 +++---- transmission/README.md | 4 ++++ transmission/transmission.yaml | 7 +++---- tree/tree.yaml | 12 ++++++++++++ vagrant/README.md | 4 ++++ vagrant/vagrant.yaml | 7 +++---- virtualbox/README.md | 4 ++++ virtualbox/virtualbox.yaml | 7 +++---- vlc/README.md | 4 ++++ vlc/vlc.yaml | 7 +++---- 36 files changed, 78 insertions(+), 36 deletions(-) rename {file => install-type}/app.yaml (100%) rename {file => install-type}/dmg.yaml (100%) create mode 100644 install-type/homebrew.yaml rename {file => install-type}/lzma.yaml (100%) rename {file => install-type}/pkg.yaml (100%) rename {file => install-type}/tar.yaml (100%) rename {file => install-type}/zip.yaml (100%) create mode 100644 iterm/README.md create mode 100644 limechat/README.md create mode 100644 nginx/handlers/handlers.yaml create mode 100644 nginx/nginx.yaml create mode 100644 nginx/tasks/tasks.yaml create mode 100644 nginx/templates/nginx.conf.j2 create mode 100644 php/handlers/handlers.yaml create mode 100644 php/php.yaml create mode 100644 php/tasks/tasks.yaml create mode 100644 php/templates/php.ini.j2 rename local-setup-vars.yaml => setup-vars.yaml (100%) rename local-setup.yaml => setup.yaml (76%) create mode 100644 sourcetree/README.md create mode 100644 transmission/README.md create mode 100644 vagrant/README.md create mode 100644 virtualbox/README.md diff --git a/PLANS.md b/PLANS.md index 8a62624..5c705e7 100644 --- a/PLANS.md +++ b/PLANS.md @@ -3,4 +3,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 +* Ensure generalization of playbooks and assist distribution by replacing hosts and usernames with code that will allow them to be set on run time. +* Consider streamlining playbook creation by specifying the install-type (app, homebrew, pkg, apt, yum) and letting conditional execution pick the correct playbook to run based on that variable. This would allow tools that can be manually installed, or installed through a package management service like homebrew or apt, to have the ability to be installed different ways. +* Ensure that the tool created on top of Ansible has the abiltiy to check the version of installed mac applications, and not reinstall them if they match, unless a user forces an reinstall. Also provide the abiltiy to manipulate default file type handlers. \ No newline at end of file diff --git a/README.md b/README.md index 6b2bbe2..a193877 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ 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.** +**The majority of these playbooks have been created to provision Mac development machines. I am going to separate these playbooks into their own separate git repos, or not, depending on how I decide I want them accessable to the configuration managament tool I'll be buiiling on top of Ansible. 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! @@ -21,10 +21,10 @@ Future Playbooks: * **PHP** - open source highlevel interprited programming language * **RVM** - open source Ruby version and environment manager -Before running these Ansible playbooks, or any Ansible commands for that matter, it is essential that you have your publick SSH keys copied to your server's `~/.ssh/authorized_keys` file. The following command will copy your public key from your management computer, to the server: +Before running these Ansible playbooks, or any Ansible commands for that matter, it is essential that you have your publick SSH keys copied to your server's `~/.ssh/authorized_keys` file. If you decide that this will make life too easy for you, feel free to use the `-k` flag when running `ansible-playbook` (or `ansible` for that matter too), which will tell Ansible to prompt you for your SSH password. The following command will copy your public key from your management computer, to the server: # Don't space out and forget to ensure that you replace the username and ip/host address with your specific credentials. - $ scp ~/.ssh/id_rsa.pub username@111.222.333.444:~/.ssh/authorized_keys + $ scp ~/.ssh/id_rsa.pub username@111.222.333.444:~/.ssh/authorized_keys # You could also perform the same action against your Ansible hosts using the copy module and the **-k** flag to promp you for your SSH password. Then all you have to do, as long as you have properly installed Ansible, and have added it's location to your $PATH, is run the following command to confirm that everything is hunky-dory: diff --git a/file/app.yaml b/install-type/app.yaml similarity index 100% rename from file/app.yaml rename to install-type/app.yaml diff --git a/file/dmg.yaml b/install-type/dmg.yaml similarity index 100% rename from file/dmg.yaml rename to install-type/dmg.yaml diff --git a/install-type/homebrew.yaml b/install-type/homebrew.yaml new file mode 100644 index 0000000..34f129f --- /dev/null +++ b/install-type/homebrew.yaml @@ -0,0 +1,3 @@ +--- +- name: Installing $app_name_pretty + homebrew: name=$app_name state=installed update_homebrew=yes \ No newline at end of file diff --git a/file/lzma.yaml b/install-type/lzma.yaml similarity index 100% rename from file/lzma.yaml rename to install-type/lzma.yaml diff --git a/file/pkg.yaml b/install-type/pkg.yaml similarity index 100% rename from file/pkg.yaml rename to install-type/pkg.yaml diff --git a/file/tar.yaml b/install-type/tar.yaml similarity index 100% rename from file/tar.yaml rename to install-type/tar.yaml diff --git a/file/zip.yaml b/install-type/zip.yaml similarity index 100% rename from file/zip.yaml rename to install-type/zip.yaml diff --git a/iterm/README.md b/iterm/README.md new file mode 100644 index 0000000..082dbf0 --- /dev/null +++ b/iterm/README.md @@ -0,0 +1,4 @@ +iTerm +===== + +This Ansible playbook installs iTerm (2), a powerfull and highly customizable, feature-rich, command line interface replacement for Terminal. \ No newline at end of file diff --git a/iterm/iterm.yaml b/iterm/iterm.yaml index e1bf0ea..ac04284 100644 --- a/iterm/iterm.yaml +++ b/iterm/iterm.yaml @@ -1,15 +1,14 @@ --- -- include: ../local-setup.yaml +- include: ../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 + - ../setup-vars.yaml tasks: - - include: ../file/zip.yaml \ No newline at end of file + - include: ../install-type/zip.yaml \ No newline at end of file diff --git a/limechat/README.md b/limechat/README.md new file mode 100644 index 0000000..60abff5 --- /dev/null +++ b/limechat/README.md @@ -0,0 +1,4 @@ +LimeChat +======== + +This Ansible playbook installs LimeChat, a lightweight and feature rich IRC client for Mac. \ No newline at end of file diff --git a/limechat/limechat.yaml b/limechat/limechat.yaml index 2874be4..3c9a913 100644 --- a/limechat/limechat.yaml +++ b/limechat/limechat.yaml @@ -1,5 +1,5 @@ --- -- include: ../local-setup.yaml +- include: ../setup.yaml - hosts: $hosts user: $user @@ -10,6 +10,6 @@ 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 + - ../setup-vars.yaml tasks: - - include: ../file/tar.yaml \ No newline at end of file + - include: ../install-type/tar.yaml \ No newline at end of file diff --git a/nginx/handlers/handlers.yaml b/nginx/handlers/handlers.yaml new file mode 100644 index 0000000..e69de29 diff --git a/nginx/nginx.yaml b/nginx/nginx.yaml new file mode 100644 index 0000000..e69de29 diff --git a/nginx/tasks/tasks.yaml b/nginx/tasks/tasks.yaml new file mode 100644 index 0000000..e69de29 diff --git a/nginx/templates/nginx.conf.j2 b/nginx/templates/nginx.conf.j2 new file mode 100644 index 0000000..e69de29 diff --git a/php/handlers/handlers.yaml b/php/handlers/handlers.yaml new file mode 100644 index 0000000..e69de29 diff --git a/php/php.yaml b/php/php.yaml new file mode 100644 index 0000000..e69de29 diff --git a/php/tasks/tasks.yaml b/php/tasks/tasks.yaml new file mode 100644 index 0000000..e69de29 diff --git a/php/templates/php.ini.j2 b/php/templates/php.ini.j2 new file mode 100644 index 0000000..e69de29 diff --git a/local-setup-vars.yaml b/setup-vars.yaml similarity index 100% rename from local-setup-vars.yaml rename to setup-vars.yaml diff --git a/local-setup.yaml b/setup.yaml similarity index 76% rename from local-setup.yaml rename to setup.yaml index 4bfcfb3..5d57a23 100644 --- a/local-setup.yaml +++ b/setup.yaml @@ -2,9 +2,8 @@ - hosts: $hosts user: $user sudo: yes - gather_facts: false vars_files: - - local-setup-vars.yaml + - setup-vars.yaml tasks: - name: Create Ansible downloads directory file: path=$downloads state=directory \ No newline at end of file diff --git a/sourcetree/README.md b/sourcetree/README.md new file mode 100644 index 0000000..bcd5a7d --- /dev/null +++ b/sourcetree/README.md @@ -0,0 +1,4 @@ +SourceTree +========== + +This Ansible playbook installs SourceTree, a rock solid Git client for Mac and Windows. \ No newline at end of file diff --git a/sourcetree/sourcetree.yaml b/sourcetree/sourcetree.yaml index cfa2df4..cdd2409 100644 --- a/sourcetree/sourcetree.yaml +++ b/sourcetree/sourcetree.yaml @@ -1,5 +1,5 @@ --- -- include: ../local-setup.yaml +- include: ../setup.yaml - hosts: $hosts user: $user @@ -11,6 +11,6 @@ app_url: https://copy.com/RDxUBW9uhWiQ/SourceTree-1.5.8.dmg?download=1 mount_path: /Volumes/SourceTree/ vars_files: - - ../local-setup-vars.yaml + - ../setup-vars.yaml tasks: - - include: ../file/dmg.yaml \ No newline at end of file + - include: ../install-type/dmg.yaml \ No newline at end of file diff --git a/sublime-text/README.md b/sublime-text/README.md index e69de29..676a2c1 100644 --- a/sublime-text/README.md +++ b/sublime-text/README.md @@ -0,0 +1,4 @@ +Sublime Text +============ + +This Ansible playbook installs Sublime Text, a powerfull, performant, extensable, and versitile code editor. It also sets up `subl` and `sublime` symlinks in your `/usr/bin/` directory for the highly useful Sublime Text `subl` command. \ No newline at end of file diff --git a/sublime-text/sublime-text.yaml b/sublime-text/sublime-text.yaml index a836fce..6f704c9 100644 --- a/sublime-text/sublime-text.yaml +++ b/sublime-text/sublime-text.yaml @@ -1,9 +1,8 @@ --- -- include: ../local-setup.yaml +- include: ../setup.yaml - hosts: $hosts user: $user - gather_facts: false vars: install_type: app app_name: Sublime\ Text @@ -11,9 +10,9 @@ app_url: http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%20Build%203021.dmg mount_path: /Volumes/Sublime\ Text/ vars_files: - - ../local-setup-vars.yaml + - ../setup-vars.yaml tasks: - - include: ../file/dmg.yaml + - include: ../install-type/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/README.md b/transmission/README.md new file mode 100644 index 0000000..fd76d32 --- /dev/null +++ b/transmission/README.md @@ -0,0 +1,4 @@ +Transmission +============ + +This Ansible playbook installs Transmission, a lightwieght bittorrent client for Mac and Linux. \ No newline at end of file diff --git a/transmission/transmission.yaml b/transmission/transmission.yaml index d087a21..d019f9e 100644 --- a/transmission/transmission.yaml +++ b/transmission/transmission.yaml @@ -1,9 +1,8 @@ --- -- include: ../local-setup.yaml +- include: ../setup.yaml - hosts: $hosts user: $user - gather_facts: false vars: install_type: app app_name: Transmission @@ -11,6 +10,6 @@ app_url: https://copy.com/jTqaA0JWmTmn/Transmission-2.77.dmg?download=1 mount_path: /Volumes/Transmission/ vars_files: - - ../local-setup-vars.yaml + - ../setup-vars.yaml tasks: - - include: ../file/dmg.yaml \ No newline at end of file + - include: ../install-type/dmg.yaml \ No newline at end of file diff --git a/tree/tree.yaml b/tree/tree.yaml index e69de29..082299d 100644 --- a/tree/tree.yaml +++ b/tree/tree.yaml @@ -0,0 +1,12 @@ +--- +- include: ../setup.yaml + +- hosts: $hosts + user: $user + vars: + app_name: tree + app_name_pretty: tree + vars_files: + - ../setup-vars.yaml + tasks: + - include: ../install-type/homebrew.yaml \ No newline at end of file diff --git a/vagrant/README.md b/vagrant/README.md new file mode 100644 index 0000000..f3d4ebb --- /dev/null +++ b/vagrant/README.md @@ -0,0 +1,4 @@ +Vagrant +======= + +This Ansible playbook installs Vagrant, an powerful tool which automates virtualization and provisionment. \ No newline at end of file diff --git a/vagrant/vagrant.yaml b/vagrant/vagrant.yaml index 471aef8..7475b3c 100644 --- a/vagrant/vagrant.yaml +++ b/vagrant/vagrant.yaml @@ -1,9 +1,8 @@ --- -- include: ../local-setup.yaml +- include: ../setup.yaml - hosts: $hosts user: $user - gather_facts: false vars: install_type: pkg install_target: /Volumes/OSX @@ -12,6 +11,6 @@ app_url: http://files.vagrantup.com/packages/64e360814c3ad960d810456add977fd4c7d47ce6/Vagrant.dmg mount_path: /Volumes/Vagrant/ vars_files: - - ../local-setup-vars.yaml + - ../setup-vars.yaml tasks: - - include: ../file/dmg.pkg \ No newline at end of file + - include: ../install-type/dmg.pkg \ No newline at end of file diff --git a/virtualbox/README.md b/virtualbox/README.md new file mode 100644 index 0000000..11c22a9 --- /dev/null +++ b/virtualbox/README.md @@ -0,0 +1,4 @@ +VirtualBox +========== + +This Ansible playbook installs VirtualBox, a home and enterprise virtualization software package. \ No newline at end of file diff --git a/virtualbox/virtualbox.yaml b/virtualbox/virtualbox.yaml index 45db253..48e2c3f 100644 --- a/virtualbox/virtualbox.yaml +++ b/virtualbox/virtualbox.yaml @@ -1,9 +1,8 @@ --- -- include: ../local-setup.yaml +- include: ../setup.yaml - hosts: $hosts user: $user - gather_facts: false vars: install_type: pkg install_target: /Volumes/OSX @@ -12,6 +11,6 @@ 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 + - ../setup-vars.yaml tasks: - - include: ../file/dmg.yaml \ No newline at end of file + - include: ../install-type/dmg.yaml \ No newline at end of file diff --git a/vlc/README.md b/vlc/README.md index e69de29..9d45d2c 100644 --- a/vlc/README.md +++ b/vlc/README.md @@ -0,0 +1,4 @@ +VLC +=== + +This Ansible playbook installs VLC, a lightweigt and versitile media player for Mac, Linux, and Windows, and will eventually have the ability to make it the default file handler for specified file types. \ No newline at end of file diff --git a/vlc/vlc.yaml b/vlc/vlc.yaml index 677f19c..43ab73f 100644 --- a/vlc/vlc.yaml +++ b/vlc/vlc.yaml @@ -1,9 +1,8 @@ --- -- include: ../local-setup.yaml +- include: ../setup.yaml - hosts: $hosts user: $user - gather_facts: false vars: install_type: app app_name: VLC @@ -11,6 +10,6 @@ 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 + - ../setup-vars.yaml tasks: - - include: ../file/dmg.yaml \ No newline at end of file + - include: ../install-type/dmg.yaml \ No newline at end of file