StackStorm / showcase-ansible-chatops

Vagrant Demo showing ChatOps with Ansible
https://stackstorm.com/2015/06/24/ansible-chatops-get-started-%f0%9f%9a%80/
Apache License 2.0
77 stars 22 forks source link

HUBOT_SLACK_TOKEN should be requested only for `vagrant up/provision` commands #8

Closed arm4b closed 8 years ago

arm4b commented 8 years ago

For everything else it shouldn't be a requirement, ex:

$ vagrant ssh chatops
Error! HUBOT_SLACK_TOKEN is required.
Please specify it in Vagrantfile.

Vagrantfile needs a small touch

LindsayHill commented 8 years ago

Heh. Yeah. I saw that one too. Will make a few small changes

LindsayHill commented 8 years ago

I couldn't find a good way to do this in the Vagrantfile only if provisioning is being run.

I had thought I could get away with moving that section inside the Vagrant.configure(2) do |config| section, underneath this line: if name == :chatops Doesn't seem to work though - it always executes the check. So I moved the check into chatops.sh. Not great, since it means a lot of stuff gets executed before crashing out, but it does mean it only gets checked when that provisioning step is run, and doing something like vagrant ssh chatops doesn't need the token set.

Pushed in https://github.com/StackStorm/showcase-ansible-chatops/pull/7/commits/935d4c3bcb088d3311673bc637b597ea6f11781b. WDYT?

arm4b commented 8 years ago

Yeah, same thinking: It's not ideal, but works so far.

I'll try to play later with ruby/Vagrant stuff and see If I could hack something interesting.