Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create scheduled task in "local" mode? #2

Open
ghost opened this issue Apr 21, 2015 · 1 comment
Open

Create scheduled task in "local" mode? #2

ghost opened this issue Apr 21, 2015 · 1 comment

Comments

@ghost
Copy link

ghost commented Apr 21, 2015

I guess this is more of a general Boxstarter question, but it came up while I was trying to use this cookbook with Test Kitchen so bear with me...
Basically the problem is this:

  1. I'm trying to install wix toolset in my cookbook
  2. The installer tries to disable Windows Update, resulting in the infamous "access denied" error since Test Kitchen uses WinRM to communicate with test machine and Windows Update doesn't work over WinRM for whatever reason.
  3. After reading up on Boxstarter I realized I could use its task scheduler trick to invoke the Windows Update locally, i.e. run chocolatey via the boxstarter wrapper.

So I did something like:

include_recipe 'boxstarter::default'
boxstarter 'boxstarter run' do
  code <<-EOH
    cinst wixtoolset -v 3.7.1224.0 -y
  EOH
end

After getting a weird error and digging through the boxstarter/chocolatey log I realized that the problem was that boxstarter was trying to run a scheduled task that hadn't been created.
Which ultimately made me realize that this cookbook doesn't really work nicely with the scheduled task feature because the way it invokes Install-BoxstarterPackage is always in "local" mode - in other words, when used in chef, boxstarter is always running via chef-solo/chef-client on the local machine. The implication is that the task mechanism is never actually used.

I was wondering if you think it would make sense to have boxstarter recognize whether or not it is being run via WinRM (assuming that's easy to do in powershell), and decide whether to "Invoke-FromTask" based on that information - regardless of how Install-BoxstarterPackage was invoked.

Let me know if that makes sense - thanks!

-Omer

@mwrock
Copy link
Owner

mwrock commented Apr 23, 2015

It makes perfect sense. In fact Boxstarter can do that but I think there is something else at play here. To be honest, I have not looked at this cookbook in a while and this weirdness does not surprise me. I'm hoping to find time to invest in this soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant