Giter Club home page Giter Club logo

webpi's Introduction

webpi Cookbook

Build status Cookbook Version

Microsoft Web Platform Installer (WebPI) automates the installation of Microsoft's entire Web Platform. This cookbook makes it easy to get WebpiCmdLine.exe the lightweight CLI version of WebPI onto a Windows node. It also exposes a resource for installing WebPI products idempotently.

Requirements

Platforms

  • Windows 7
  • Windows Server 2008 R2
  • Windows 8, 8.1
  • Windows Server 2012 (R1, R2)

Chef

  • Chef 12.6+

Cookbooks

  • windows 2.0+

Attributes

  • node['webpi']['home'] - location to install WebPI files to. Default is %SYSTEMDRIVE%\webpi
  • node['webpi']['url'] - Path to download webpi zip.
  • node['webpi']['xmlpath'] - Optional path to custom xml file.
  • node['webpi']['install_method'] - Method of installing webpi via msi or zip. Default is msi.
  • node['webpi']['msi'] - Location of msi file to use.
  • node['webpi']['msi_package_name'] - Windows package name, found in registry, for msi. Defaults to "Microsoft Web Platform Installer 4.5"

Resources

webpi_product

Actions

  • :install: install a product using WebpiCmdLine

Properties

  • product_id: name property. Specifies the ID of a product to install.
  • accept_eula: specifies that WebpiCmdline should auto-accept EULAs. Default is false.
  • returns: specifies the return value(s) expected for a successful installation. Can be a single integer or array of integers. Default is [0, 42]

Examples

Install IIS 7 Recommended Configuration (will install IIS 8 on Windows 2012 despite the name)

webpi_product 'IIS7' do
  accept_eula true
  action :install
end

Install Windows PowerShell 2.0

webpi_product 'PowerShell2' do
  accept_eula true
  action :install
end

Install Windows Azure Powershell 1.0 (will return a 3010 exit code to signify a successful installation that requires a reboot)

webpi_product 'WindowsAzurePowerShellGet' do
  accept_eula true
  action :install
  returns 3010
end

webpi_application

Actions

  • :install: install an application using WebpiCmdLine

Properties

  • app_id: name property. Specifies the ID of an application to install.
  • accept_eula: specifies that WebpiCmdline should auto-accept EULAs. Default is false.
  • suppress_reboot: specifies if we need to stop or suppress the reboot. Default is True.
  • iis_express: used only with applications that intergrate with IIS. Default value is False.
  • mysql_password: Used to give a mysql password for application which requires it.
  • sql_password: Used to give a sql password for application which requires it.
  • other_options: Any other options related to applications needed to be appended. Default value is empty string.
  • returns: specifies the return value(s) expected for a successful installation. Can be a single integer or array of integers. Default is [0, 42]

Examples

Installing WebMatrix while Accepting the EULA and also install app to IISExpress Ex: >WebPICMD.exe /Install /Products:WebMatrix /AcceptEula /IISExpress

webpi_application 'WebMatrix' do
  accept_eula true
  iis_express true
  action  :install
end

Installing an application to MicrosoftAzure ServiceFabric CoreSDK Ex: >WebPICMD.exe /Install /Applications:MicrosoftAzure-ServiceFabric-CoreSDK /AcceptEula

webpi_application 'MicrosoftAzure-ServiceFabric-CoreSDK' do
  accept_eula true
  action :install
end
password = data_bag_item('secrets','mysqlpassword')['password'] # Should be a encrypted data bag
webpi_application 'AcquiaDrupal' do
  accept_eula    true
  mysql_password password # To be set from encrypted databag
  action         :install
end

Usage

default

Downloads and unzips WebpiCmdLine.exe to the location specified by node['webpi']['home']. WebpiCmdLine.exe is used required by the webpi_product LWRP for taking all actions.

License & Authors

Author: Cookbook Engineering Team ([email protected])

Copyright: 2011-2019, Chef Software, Inc.

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.

webpi's People

Contributors

damacus avatar glasschef avatar guilhem avatar kitchen-porter avatar madankapoor avatar madankapoor10 avatar mwrock avatar nathenharvey avatar purrbiscuit avatar ramereth avatar renovate[bot] avatar schisamo avatar sethvargo avatar smurawski avatar sneal avatar tas50 avatar xorima avatar xorimabot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

webpi's Issues

`webpi_cmd_path` doesn't utilize `node.default['webpi']['home']` or just `node.default['webpi']['bin']`

This cookbook needs to utilize the attribute variables to allow for easier setting, unless i'm misunderstanding this.

https://github.com/chef-cookbooks/webpi/blob/master/resources/application.rb#L29
https://github.com/chef-cookbooks/webpi/blob/master/resources/product.rb#L26

both of the above resources should utilize the node.default['webpi']['home'] or node.default['webpi']['bin'] attributes

Installing packages that require parameters

Hi,

Disclaimer: I'm not sure if I'm missing something as I'm relatively new to chef.

I'm trying to install MySQL_5_5 and webpi seems to prompt for a mysql password, then throws an exception.

Any ideas?

[2014-10-28T03:35:45+00:00] FATAL: Mixlib::ShellOut::ShellCommandFailed: webpi_product[MySQL_5_5](frg_iis::default line
19) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0, 42], but received '-1'
---- Begin output of "WebpiCmd.exe" /Install /products:MySQL_5_5 /suppressreboot /accepteula /Log:C:/Users/Administrator
.chef\local-mode-cache\cache/WebPI.log ----
STDOUT: The software that you obtain using the Web Plaform Installer Command Line Tool is licensed to you by its owner.
Microsoft grants you no rights for third party software.
Successfully loaded primary feed: https://go.microsoft.com/?linkid=9824573
Please enter MySQL password: Unexpected exception occurred
Object reference not set to an instance of an object.

Support Web Platform Installer 5.0

I used webpi on a server that already had Web Platform Installer 5.0 on it, but it failed because webpi cannot install 4.5.
Can you fix this so that

  1. I can specify which version to install (4.5 or 5.0 or x.x)
  2. I can specify whether or not to ignore "1603" success code which says "a newer version is already installed"

Code to set the PATH in `install-msi.rb` causes chefspec to fail on non-Windows platforms

Cookbook version

4.2.0

Platform Details

MacOS
ChefDK 1.2.22

Scenario:

Attempting to include the default recipe from this cookbook in another cookbook, and then run default chefspec tests on that cookbook.

Steps to Reproduce:

  1. create new cookbook with chef generate cookbook
  2. depend on webpi.
  3. add include_recipe 'webpi::install-msi' to default.rb.
  4. run standard chefspec test.

Expected Result:

I expect no errors from chefspec

Actual Result:

[2017-04-24T18:31:10-05:00] ERROR: Unable to find Webpi executable
F

Failures:

  1) pi_test::default converges successfully
     Failure/Error: expect { chef_run }.to_not raise_error

       expected no Exception, got #<RuntimeError: WebpiCmd.exe can't be found> with backtrace:
         # /var/folders/v1/dp0988lj1tv15nmv63fby85c0000gn/T/d20170424-29440-1taq1qa/cookbooks/webpi/recipes/install-msi.rb:38:in `from_file'
         # /var/folders/v1/dp0988lj1tv15nmv63fby85c0000gn/T/d20170424-29440-1taq1qa/cookbooks/pi_test/recipes/default.rb:7:in `from_file'
         # ./spec/unit/recipes/default_spec.rb:23:in `block (2 levels) in <top (required)>'
         # ./spec/unit/recipes/default_spec.rb:26:in `block (3 levels) in <top (required)>'
         # ./spec/unit/recipes/default_spec.rb:26:in `block (2 levels) in <top (required)>'
     # ./spec/unit/recipes/default_spec.rb:26:in `block (2 levels) in <top (required)>'

Finished in 0.35951 seconds (files took 3.03 seconds to load)
1 example, 1 failure

No resource or method named 'cached_file' error

Cookbook version

4.1.0

Chef-client version

12.19.36

Platform Details

Windows 2012 R2

Scenario:

Attempting to run webpi::install-msi recipe and have the webpi bits downloaded and installed in preparation for installation of Service Bus 1.1

Steps to Reproduce:

Create a cookbook/recipe that depends on 'webpi' and 'windows'. Create default recipe that includes webpi::install-msi. Converge the default recipe (which should download and install the webpi .msi.

Expected Result:

Expect that Web Platform Installer is installed to the system and can be called via the webpi_product resource to install Service Bus.

Actual Result:

Compilation of the cookbook fails - error is:

NoMethodError ------------- No resource or method named cached_file' for Chef::Recipe "install-msi"'

Research shows that the latest version of the windows cookbook (3.0.2) made a change that breaks current webpi cookbook which calls the cached_file method. This method appears to have been deleted from the windows_helper.rb via this commit:

https://github.com/chef-cookbooks/windows/commit/bae551985ee9cd3fe5431f283ee7487a522dfc65

Current resolution is to add depends 'windows', '= 3.0.1'
This version of the windows cookbook works.

Url 'https://www.microsoft.com/en-us/web/webpi/4.6/webproductlist.xml' returned HTTP status code: 404

Cookbook version

1.2.9

Chef-client version

12

Platform Details

windows 2012r2

Scenario:

I am getting the following error: Url 'https://www.microsoft.com/en-us/web/webpi/4.6/webproductlist.xml' returned HTTP status code: 404

When I try to browse to that URL it is indeed invalid.

Steps to Reproduce:

1517935130,,ui,message, amazon-ebs: [2018-02-06T11:38:49-05:00] INFO: Processing webpi_product[WDeployNoSMO] action install (webdeploymenttoolkit::default line 8)
1517935136,,ui,message, amazon-ebs:
1517935136,,ui,message, amazon-ebs: ================================================================================
1517935136,,ui,message, amazon-ebs: Error executing action install on resource 'webpi_product[WDeployNoSMO]'
1517935136,,ui,message, amazon-ebs: ================================================================================
1517935136,,ui,message, amazon-ebs:
1517935136,,ui,message, amazon-ebs: Mixlib::ShellOut::ShellCommandFailed
1517935136,,ui,message, amazon-ebs: ------------------------------------
1517935136,,ui,message, amazon-ebs: Expected process to exit with [0%!(PACKER_COMMA) 42]%!(PACKER_COMMA) but received '-1'
1517935136,,ui,message, amazon-ebs: ---- Begin output of "C:\Program Files/Microsoft/Web Platform Installer/WebpiCmd.exe" /Install /products:WDeployNoSMO /suppressreboot /accepteula /Log:c:\chef\cache/WebPI.log ----
1517935136,,ui,message, amazon-ebs: STDOUT: The software that you obtain using the Web Plaform Installer Command Line Tool is licensed to you by its owner. Microsoft grants you no rights for third party software.
1517935136,,ui,message, amazon-ebs: . \r .. \r ...\r \r \rUnexpected exception occurred
1517935136,,ui,message, amazon-ebs: Url 'https://www.microsoft.com/en-us/web/webpi/4.6/webproductlist.xml' returned HTTP status code: 404
1517935136,,ui,message, amazon-ebs: STDERR:
1517935136,,ui,message, amazon-ebs: ---- End output of "C:\Program Files/Microsoft/Web Platform Installer/WebpiCmd.exe" /Install /products:WDeployNoSMO /suppressreboot /accepteula /Log:c:\chef\cache/WebPI.log ----
1517935136,,ui,message, amazon-ebs: Ran "C:\Program Files/Microsoft/Web Platform Installer/WebpiCmd.exe" /Install /products:WDeployNoSMO /suppressreboot /accepteula /Log:c:\chef\cache/WebPI.log returned -1
1517935136,,ui,message, amazon-ebs:

Expected Result:

It should install

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/ci.yml
  • sous-chefs/.github 3.1.1
  • actions/checkout v4
  • actionshub/chef-install 3.0.0
  • actionshub/test-kitchen 3.0.0
  • macos 14
.github/workflows/stale.yml
  • actions/stale v9

  • Check this box to trigger a request for Renovate to run again on this repository

Product install fails when run under System account

Cookbook version

4.2.1

Chef-client version

13.2.20

Platform Details

Windows Server 2008 R2

Scenario:

Trying to install 'WDeploy36' package with webpi cookbook.

Steps to Reproduce:

Add webpi_product resource with install action to cookbook and update on Chef Server. Next scheduled run of chef-client will pickup new resource and attempt to run under System account.

Expected Result:

Product is installed successfully.

Actual Result:

Product install fails with errors:

Chef Log:

Install completed (Failure): 'Web Deploy 3.6'
WDeploy_Only_3_6 : Failed.
Error opening installation log file. Verify that the specified log file location exists and is writable
...
Web Deploy 3.6 False
Log Location: C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft\Web Platform Installer\logs\install\2017-08-02T12.46.29\WebDeploy_amd64_en-US.txt
...
Web Deploy 3.6 False
Install of Products: FAILURE
STDERR:
---- End output of "WebpiCmd.exe" /Install /products:WDeploy36 /suppressreboot /accepteula /Log:c:/chef/cache/WebPI.log ----
Ran "WebpiCmd.exe" /Install /products:WDeploy36 /suppressreboot /accepteula /Log:c:/chef/cache/WebPI.log returned -1

Event Log:

Failed to end a Windows Installer transaction C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft\Web Platform Installer\installers\WDeploy_Only_3_6\7CB7AFE101DE1CDB1A723F6CA3CB554F7D427661\WebDeploy_amd64_en-US.msi. Error 1622 occurred while ending the transaction.

Further notes:

If I run chef-client as my user the install completes successfully. I expect it has something to do with permissions to the System temp directory.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.