Skip to content

Commit

Permalink
Merge pull request #389 from Kitware/ansible-update
Browse files Browse the repository at this point in the history
Update Ansible/Vagrant process
  • Loading branch information
Roni Choudhury committed Sep 19, 2016
2 parents cc89bdc + eed3ad2 commit c794cff
Show file tree
Hide file tree
Showing 9 changed files with 1,419 additions and 70 deletions.
2 changes: 1 addition & 1 deletion app/resonant-laboratory/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ web_client/lib/
*.ai
*.pdf
.vagrant
ansible/playbook.retry
ansible/playbook*.retry
35 changes: 35 additions & 0 deletions app/resonant-laboratory/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,41 @@ you can use the `RESLAB_HOST_PORT` environment variable to set a different one:
RESLAB_HOST_PORT=9090 vagrant up
```

You can also supply some Ansible ["extra
variables"](http://docs.ansible.com/ansible/playbooks_variables.html#passing-variables-on-the-command-line)
to Vagrant via the `ANSIBLE_EXTRA_VARS` environment variable:

```shell
ANSIBLE_EXTRA_VARS="adminuser_login=root adminuser_password=hunter2" vagrant up
```

in case you want to change the default values of the following variables used
during the provisioning process:

- `adminuser_firstname` - administrator account's first name (default:
**Admin**)
- `adminuser_lastname` - administrator account's last name (default: **User**)
- `adminuser_login` - administrator account's username (default: **admin**)
- `adminuser_password` - administrator account's password (default:
**adminadmin**)
- `adminuser_email` - administrator account's email address (default:
**admin@example.com**)
- `storage` - the path on disk in which to store the build inputs such as Git
clones and Girder resources (default: **/home/vagrant**)
- `girder_revision` - the git checkout hash to use to build Girder (default:
**6bda1a7b65bea1c11187cdeb136877739693f466**)
- `girder_client_revision` - the git checkout hash to use to install Girder
Client (default: **6bda1a7b65bea1c11187cdeb136877739693f466**)
- `database_assetstore_revision` - the git checkout hash to use for the database
assetstore Girder plugin (default:
**a530c9546d3ac4f50ec4519ef6c7bb348e2b4bc7**)
- `candela_revision` - the git checkout hash to use to build Candela and
Resonant Laboratory (default: **5c17f10d754778e7ea291f1f24c290d997e4dec8**)

The most important of these may be `adminuser_password`; changing this option at
provisioning time allows you to keep administrator access to the underlying
Girder instance secure.

## Guide to the server-side code

### Endpoints
Expand Down
16 changes: 13 additions & 3 deletions app/resonant-laboratory/Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/trusty64"
box = ENV['ANSIBLE_BOX']
if box.nil? || box.empty?
box = "trusty"
end

config.vm.box = "ubuntu/#{box}64"

config.vm.provider "virtualbox" do |vb|
vb.memory = 8192
Expand All @@ -13,11 +18,16 @@ Vagrant.configure("2") do |config|

# Run Ansible from the Vagrant Host
config.vm.provision "ansible" do |ansible|
ansible.verbose = "vvvv"
ansible.verbose = ""
ansible.groups = {
"all" => ['reslab']
}

ansible.playbook = "ansible/playbook.yml"
ansible.playbook = "ansible/playbook-#{box}.yml"

Extra_vars = ENV['ANSIBLE_EXTRA_VARS']
if !Extra_vars.nil? && !Extra_vars.empty?
ansible.extra_vars = Hash[ENV['ANSIBLE_EXTRA_VARS'].split(/\s+/).map{|w| w.split("=")}]
end
end
end

0 comments on commit c794cff

Please sign in to comment.