cloudbau/vagrant-openstack-plugin — pull request #29 by hawknewton (2013-11-10 07:01:31+00:00)
Title: Add setup_user action to provision config.ssh_username

**This PR is a WORK IN PROGRESS and is NOT ready to be merged!**

We've got OpenStack configured to provision machines and enable root access via the specified keypair. I don't know if this is a normal implementation, but it doesn't seem totally nuts to me.

When the boxes land, they've got
```
Defaults requiretty
```
set in the /etc/sudoers, so using this plugin as-is is a no-go. I could taylor my OS images to `vagrant-openstack-plugin`, (removing `Defaults requiretty`, creating a vagrant user, etc) but that seems like something of an operational snafu.

I took a page out of [vagrant-digitalocean](https://github.com/smdahlen/vagrant-digitalocean)'s book (as well as some of their code) and created a `SetupUser` step that creates the user specified in your Vagrantfile under `config.ssh_username` before we do any more work. It doesn't seem like a completely horrible idea.

Oh, and if you set `config.ssh_username` to `root` the old behavior is still available.

There's still plenty of work to do:
* `ssh_info[:username]` is still being used in some places
* Need more/better spec coverage
* Code cleanup, refactor, logging
* Might want to pull the `Guardfile` and `.rspec` as they're artifacts of my personal development process

My intention in opening this pull request is to see if this approach is totally insane and/or is something people are interested in.

Feedback welcome.

Thanks.