Skip to content
This repository has been archived by the owner on Dec 12, 2019. It is now read-only.

Commit

Permalink
Updates now that host.ini is specified in ansible.cfg
Browse files Browse the repository at this point in the history
hashbangcode/vlad#151

Also fixed some <h1>s and some missing/incorrect tags etc.

Signed-off-by: Dan Bohea <git@bohea.co.uk>
  • Loading branch information
dixhuit committed Mar 7, 2015
1 parent a7bf7f8 commit ee49bd0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion contributing/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ These tests were added partly to give confidence that the box has been setup cor

It is possible to run the tests manually by using the 'test' tag like this:

ansible-playbook -i vlad/host.ini -t test vlad/playbooks/site.yml
ansible-playbook vlad/playbooks/site.yml -t test
13 changes: 8 additions & 5 deletions usage/ansible.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,41 @@
# Ansible
<h1>Ansible</h1>

Ansible is an automation and provisioning tool that makes it easy to configure systems with the needed software, configuration options and even content. It is a command line tool, written in Python, that uses SSH connections to run these actions. This means that all you need to do is have a viable SSH connection to a machine and Ansible will run any actions you want to run. Ansible can either run single commands or use what is called a playbook to run several commands. Ansible playbooks are written in YAML, which makes understanding them quite easy.

## Running Ansible separately from Vagrant

During the setup process a file called host.ini will be created in the main Vlad directory. This file contains all the information Ansible needs to interact with the Vagrant box. If you want to run the Ansible playbook outside of Vagrant you can run the following command.

ansible-playbook -i vlad/host.ini vlad/playbooks/site.yml
ansible-playbook vlad/playbooks/site.yml

Tags have been included in the playbooks to allow different parts to be run individually. For example to (re)run the varnish playbook use the following command.

ansible-playbook -i vlad/host.ini -t varnish vlad/playbooks/site.yml
ansible-playbook vlad/playbooks/site.yml -t varnish

To run multiple tags just use a comma separated list of tags like this:

ansible-playbook -i vlad/host.ini -t varnish,apache2 vlad/playbooks/site.yml
ansible-playbook vlad/playbooks/site.yml -t varnish,apache

Possible tags are:

- adminer
- apache2
- apache
- aptget
- drupalinstall
- drush
- imagemagick
- local
- mailcatcher
- memcached
- munin
- mysql
- node
- pear
- phing
- pimpmylog
- php
- redis
- ruby
- sendmail
- solr
- test
Expand Down
6 changes: 3 additions & 3 deletions usage/custom_roles.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Custom Roles
<h1>Custom Roles</h1>

Vlad can run tasks specified within an additional "custom" role defined by you. This can be used to add additional provisioning steps that are unique to a project and/or too opinionated to be contributed back upstream to the Vlad project.

Expand Down Expand Up @@ -88,8 +88,8 @@ The custom role will be run as part of `vlad/playbooks/site_custom.yml`, _after_

You can run the tasks in your custom role without Vagrant in the same way that you can with Vlad's main Ansible playbook. Just make sure you call the correct playbook (this command presumes that you're currently in the same directory as Vlad's Vagrantfile):

ansible-playbook -i vlad/host.ini vlad/playbooks/site_custom.yml
ansible-playbook vlad/playbooks/site_custom.yml

Similarly, you can narrow the focus of this command to run only specific tags that you've defined within your custom role:

ansible-playbook -i vlad/host.ini vlad/playbooks/site_custom.yml -t tag_1,tag_2
ansible-playbook vlad/playbooks/site_custom.yml -t tag_1,tag_2
2 changes: 1 addition & 1 deletion usage/example_vlad_output.md
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ vlad : ok=142 changed=122 unreachable=0 failed=0
==> vlad: Configuring cache buckets...
==> vlad: Running triggers after up...
==> vlad: Executing 'up' services trigger
==> vlad: Executing command "ansible-playbook -i /Users/user/Development/vlad/vlad/host.ini /Users/user/Development/vlad/vlad/playbooks/local_up_services.yml"...
==> vlad: Executing command "ansible-playbook /Users/user/Development/vlad/vlad/playbooks/local_up_services.yml"...
==> vlad: Command output:
==> vlad: ---------------
==> vlad:
Expand Down

0 comments on commit ee49bd0

Please sign in to comment.