Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 99e151c
Showing
6 changed files
with
161 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,62 @@ | |||
Description | |||
=========== | |||
|
|||
Manage an htpasswd file. | |||
If htpasswd exe isn't found, we install a python implementation. | |||
|
|||
Requirements | |||
============ | |||
|
|||
Work on Windows | |||
|
|||
Resource/Provider | |||
================= | |||
|
|||
This cookbook includes LWRPs for managing: | |||
* chocolatey | |||
|
|||
htpasswd | |||
-------- | |||
|
|||
# Actions | |||
|
|||
- :install: Install a chocolatey package (default) | |||
- :upgrade: Update a chocolatey package | |||
- :remove: Uninstall a chocolatey package | |||
|
|||
# Attribute Parameters | |||
|
|||
- package_name: string or package to manage | |||
- package: package to manage (default package_name) | |||
- version | |||
- source | |||
- args: arguments to the installation | |||
|
|||
|
|||
# Example | |||
|
|||
chocolatey "sysinternals" | |||
|
|||
chocolatey "7zip" | |||
|
|||
chocolatey "notepadplusplus" | |||
|
|||
chocolatey "GoogleChrome" | |||
|
|||
chocolatey "Console2" | |||
|
|||
chocolatey "bash" do | |||
source "cygwin" | |||
end | |||
|
|||
chocolatey "openssh" do | |||
source "cygwin" | |||
end | |||
|
|||
chocolatey "grep" do | |||
source "cygwin" | |||
end | |||
|
|||
chocolatey "DotNet4.5" | |||
|
|||
chocolatey "PowerShell" |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,9 @@ | |||
maintainer "Guilhem Lettron" | |||
maintainer_email "guilhem.lettron@youscribe.com" | |||
license "Apache 2.0" | |||
description "Install chocolatey and packages on Windows" | |||
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) | |||
version "0.0.1" | |||
|
|||
depends "powershell" | |||
supports "windows" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,56 @@ | |||
# | |||
# Cookbook Name:: htpasswd | |||
# Provider:: htpasswd | |||
# Author:: Guilhem Lettron <guilhem.lettron@youscribe.com> | |||
# | |||
# Copyright 20012, Societe Publica. | |||
# | |||
# Licensed under the Apache License, Version 2.0 (the "License"); | |||
# you may not use this file except in compliance with the License. | |||
# You may obtain a copy of the License at | |||
# | |||
# http://www.apache.org/licenses/LICENSE-2.0 | |||
# | |||
# Unless required by applicable law or agreed to in writing, software | |||
# distributed under the License is distributed on an "AS IS" BASIS, | |||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
# See the License for the specific language governing permissions and | |||
# limitations under the License. | |||
# | |||
|
|||
def initialize(*args) | |||
super | |||
@action = :install | |||
end | |||
|
|||
def cmd_build | |||
output = "" | |||
if new_resource.version | |||
output << " -version #{new_resource.version}" | |||
end | |||
if new_resource.source | |||
output << " -source #{new_resource.source}" | |||
end | |||
if new_resource.args | |||
output << " -installArgs #{new_resource.args}" | |||
end | |||
return output | |||
end | |||
|
|||
action :install do | |||
execute "install package" do | |||
command "cinst " + new_resource.package + cmd_build | |||
end | |||
end | |||
|
|||
action :upgrade do | |||
execute "update package" do | |||
command "chocolatey update " + new_resource.package + cmd_build | |||
end | |||
end | |||
|
|||
action :remove do | |||
execute "uninstall package" do | |||
command "chocolatey uninstall " + new_resource.package + cmd_build | |||
end | |||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,23 @@ | |||
# | |||
# Cookbook Name:: chocolatey | |||
# recipe:: default | |||
# Author:: Guilhem Lettron <guilhem.lettron@youscribe.com> | |||
# | |||
# Copyright 2012, Societe Publica. | |||
# | |||
# Licensed under the Apache License, Version 2.0 (the "License"); | |||
# you may not use this file except in compliance with the License. | |||
# You may obtain a copy of the License at | |||
# | |||
# http://www.apache.org/licenses/LICENSE-2.0 | |||
# | |||
# Unless required by applicable law or agreed to in writing, software | |||
# distributed under the License is distributed on an "AS IS" BASIS, | |||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
# See the License for the specific language governing permissions and | |||
# limitations under the License. | |||
# | |||
|
|||
powershell "install chocolatey" do | |||
code 'iex ((new-object net.webclient).DownloadString("http://bit.ly/psChocInstall"))' | |||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,11 @@ | |||
actions :install, :remove, :upgrade | |||
|
|||
attribute :package, :kind_of => String, :name_attribute => true | |||
attribute :source, :kind_of => String | |||
attribute :version, :kind_of => String | |||
attribute :args, :kind_of => String | |||
|
|||
def initialize(*args) | |||
super | |||
@action = :install | |||
end |