add possibility to install chocolatey also

Module should install chocolatey also:
- added init class
- added the ps1 file as a template
- depends on joshcooper/powershell

Can use either "windows" or 7zip as methods to extract the software
On Thu, Jun 26, 2014 at 9:17 PM, habitullence <notifications@github.com>
wrote:

> In manifests/init.pp:
>
> > +class chocolatey (
> > +  $url           = 'http://chocolatey.org/api/v2/package/chocolatey/',
> > +  $unzip         = '7za',
> > +  $download_path = 'c:\\Windows\\Temp\\',) {
> > +  validate_re($unzip, '^(7za|windows)$')
> > +
> > +  file { 'chocolatey script':
> > +    path   => "${download_path}\\InstallChocolatey.ps1",
> > +    source => 'puppet:///modules/chocolatey/InstallChocolatey.ps1',
> > +  }
> > +
> > +  exec { 'install chocolatey':
> > +    command   => "& '${download_path}\\InstallChocolatey.ps1' $url $unzip",
> > +    provider  => powershell,
> > +    subscribe => File['chocolatey script'],
> > +    creates   => 'c:\\Chocolatey\\',
>
> Sure, sorry that was bit vague. I just noticed that the Exec['install
> chocolatey'] resource is declaring it creates c:\Chocolatey.
>
> I was wondering whether it would be a good idea to change this to respect
> the 'ChocolateyInstall' env var so that it can be installed in an alternate
> location, if it doesn't already, as per
> https://github.com/chocolatey/chocolatey/wiki/Installation#before-you-install
> .
>
> How you would do this I'm not to sure, whether it's best practice to
> reference env vars inline - generally bad from an OOP point of view - or
> pass the env var to the chocolatey class - my personal preference.
>
> Does that clarify things?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/chocolatey/puppet-chocolatey/pull/24/files#r14256581>.
>

I think I understood. I will investigate if I can access the environment
variable from a fact.