GithubHelp home page GithubHelp logo

voxpupuli / puppet-iis Goto Github PK

View Code? Open in Web Editor NEW
46.0 60.0 79.0 366 KB

Module to mange IIS with Puppet

Home Page: https://forge.puppet.com/puppet/iis

License: MIT License

Puppet 28.35% Ruby 68.02% HTML 3.63%
puppet windows-puppet-module hacktoberfest

puppet-iis's Introduction

Deprecation notice

This module has been moved to the care of Puppet, where it is now being maintained and updated. Find new versions at https://forge.puppet.com/puppetlabs/iis .

Details for migrating can be found at: https://github.com/puppetlabs/puppetlabs-iis/blob/master/MIGRATION.md

IIS module for Puppet

Build Status Code Coverage Puppet Forge Puppet Forge - downloads Puppet Forge - endorsement Puppet Forge - scores

Module for puppet that can be used to create sites, application pools and virtual applications with IIS 7 and above.

Table of Contents

  1. Overview
  2. Requirements
  3. Types

Overview

Create and manage IIS websites, application pools, and virtual applications.

Requirements

  • = Windows 2012

  • IIS installed

Types

iis_site

Enumerate all IIS websites:

  • puppet resource iis_site

Example output for puppet resource iis_site 'Default Web Site'

iis_site { 'Default Web Site':
  ensure   => 'started',
  app_pool => 'DefaultAppPool',
  ip       => '*',
  path     => 'C:\InetPub\WWWRoot',
  port     => '80',
  protocol => 'http',
  ssl      => 'false',
}

iis_site attributes

  • ensure Denotes the presence and state of site. { present, absent, started, stopped } Default: started

  • name (namevar) Web site's name.

  • path Web root for the site. This can be left blank, although IIS won't be able to start the site.

  • app_pool The application pool which should contain the site. Default: DefaultAppPool

  • host_header A host header that should apply to the site. Set to false to maintain no host header.

  • protocol The protocol for the site. Default http

  • ip The IP address for the site to listen on. Default: $::ipaddress

  • port The port for the site to listen on. Default: 80

  • ssl If SSL should be enabled. Default: false

  • state Whether the site should be Started or Stopped. Default: Started

Refresh event

Sending a refresh event to an iis_site type will recycle the web site.

iis_pool

Enumerate all IIS application pools:

  • puppet resource iis_pool

Example output for puppet resource iis_site 'DefaultAppPool'

iis_pool { 'DefaultAppPool':
  ensure        => 'started',
  enable_32_bit => 'false',
  pipeline      => 'Integrated',
  runtime       => 'v4.0',
}

iis_pool attributes

  • ensure Denotes the presence and state of pool. { present, absent, started, stopped } Default: started

  • name (namevar) Application pool's name.

  • enable_32_bit Enable 32-bit applications (boolean). Default: false

  • pipeline The managed pipeline mode for the pool {'Classic', 'Integrated'}.

  • runtime Version of .NET runtime for the pool (float).

  • state Whether the site should be Started or Stopped. Default: Started

Refresh event

Sending a refresh event to an iis_pool type will recycle the application pool.

iis_virtualdirectory

Enumerate all IIS virtual directories:

  • puppet resource iis_virtualdirectory

Example output for puppet resource iis_virtualdirectory 'default'

iis_virtualdirectory { 'default':
  ensure => 'present',
  path   => 'C:\inetpub\wwwroot',
  site   => 'Default Web Site',
}

iis_virtualdirectory attributes

  • path Target directory for the virtual directory.

  • site (Read-only) Web site in which the virtual directory resides. To change sites, remove and re-create virtual directory.

iis_application

Enumerate all IIS applications:

  • puppet resource iis_application

Example output for puppet resource iis_site 'test_app'

iis_application { 'test_app':
  ensure   => 'present',
  app_pool => 'DefaultAppPool',
  path     => 'C:\Temp',
  site     => 'Default Web Site',
}

iis_application attributes

  • app_pool The application pool which should contain the application. Default: DefaultAppPool

  • path Root for the application. This can be left blank, although IIS won't be able to use it.

  • site (Read-only) Web site in which the application resides. To change sites, remove and re-create application.

puppet-iis's People

Contributors

adastidar avatar alexjfisher avatar bastelfreak avatar bbriggs avatar bcatlin avatar brushwood24 avatar calebfornari avatar cyberious avatar dhoppe avatar hunner avatar igalic avatar jdelgado-dtlabs avatar juniorsysadmin avatar jyaworski avatar lcoulson avatar liamjbennett avatar lquantz avatar mansong1 avatar nibalizer avatar ninja-2 avatar oneingan avatar petems avatar rdev5 avatar rismoney avatar sigv avatar stack72 avatar stephenbawks avatar tahoward avatar whatsaranjit avatar wmuizelaar avatar

Stargazers

 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

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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

puppet-iis's Issues

SSL Certificate binding doesn't work unless C:/Temp directory is present

Provisioning an IIS site with a binding against a VM that does not have a directory called C:\temp\ throws errors when creating an SSL binding using this module. Module should use the standard Windows Temp directory ($env:TEMP) instead of an arbitrary C:\temp directory.

Here are the errors thrown when you try to run this manifest:

  iis::manage_app_pool {"${applicationName}": ensure => present }

  iis::manage_site { $applicationName:
    ensure      => present,
    site_path   => "${webPath}", #Must be \\'s for IIS to work correctly
    app_pool    => "${applicationName}",
    host_header => "${hostHeader}",
    require     => File['application-root'],
  }

  acl { 'iis_root':
    target => "${webPath}",
    inherit_parent_permissions => true,
    permissions => [
      { identity => 'IIS_IUSRS', rights => ['full'] },
      { identity => 'IUSR', rights => ['read'] },
      { identity => 'vagrant', rights => ['full'] }
    ],
    require => File['application-root'],
  }

  iis::manage_binding { "${applicationName}-https":
    ensure => present,
    site_name => $applicationName,
    protocol => 'https',
    port => 443,
    host_header => $hostHeader,
    certificate_thumbprint => '‎########',
  }

Error:

==> default: Error: Could not set 'present' on ensure: No such file or directory - C:/temp/create-mysite.local-https.ps120140812-1688-4j4xak.lock at 42:C:/tmp/vagrant-puppet-4/modules-0/iis/manifests/manage_binding.pp
==> default: 
==> default: Error: Could not set 'present' on ensure: No such file or directory - C:/temp/create-mysite.local-https.ps120140812-1688-4j4xak.lock at 42:C:/tmp/vagrant-puppet-4/modules-0/iis/manifests/manage_binding.pp
==> default: Wrapped exception:
==> default: No such file or directory - C:/temp/create-mysite.local-https.ps120140812-1688-4j4xak.lock
==> default: Error: /Stage[main]/Application_server/Iis::Manage_binding[mysite.local-https]/File[create-mysite.local-https-certificate.ps1]/ensure: change from absent to present failed: Could not set 'present' on ensure: No such file or directory - C:/temp/create-mysite.local-https.ps120140812-1688-4j4xak.lock at 42:C:/tmp/vagrant-puppet-4/modules-0/iis/manifests/manage_binding.pp
==> default: Error: Could not set 'present' on ensure: No such file or directory - C:/temp/inspect-mysite.local-https.ps120140812-1688-1vnygg2.lock at 36:C:/tmp/vagrant-puppet-4/modules-0/iis/manifests/manage_binding.pp
==> default: 
==> default: Error: Could not set 'present' on ensure: No such file or directory - C:/temp/inspect-mysite.local-https.ps120140812-1688-1vnygg2.lock at 36:C:/tmp/vagrant-puppet-4/modules-0/iis/manifests/manage_binding.pp
==> default: Wrapped exception:
==> default: No such file or directory - C:/temp/inspect-mysite.local-https.ps120140812-1688-1vnygg2.lock
==> default: Error: /Stage[main]/Application_server/Iis::Manage_binding[mysite.local-https]/File[inspect-mysite.local-https-certificate.ps1]/ensure: change from absent to present failed: Could not set 'present' on ensure: No such file or directory - C:/temp/inspect-mysite.local-https.ps120140812-1688-1vnygg2.lock at 36:C:/tmp/vagrant-puppet-4/modules-0/iis/manifests/manage_binding.pp

Manage authentication in iis_site

Add ability to manage the authentication section of an iis site (see image). I would like the ability to ensure the 'anonymous authentication' is set to 'application pool identity'. Note: this is a different setting than that of configuring the identity in the application pool.

Missing site_id in iis_site

Missing site_id in version (proposed) 3.0.0 iis_site. Not sure if it's just missing from the readme, or from the module's functionality.

Error thrown if trying to create sub-application second time

having this configuration

class iis {
$adminSiteName = hiera('sites::admin::name')

iis::manage_app_pool { 'admin':
enable_32_bit => false,
managed_runtime_version => 'v4.0',
}

iis::manage_app_pool { 'position':
enable_32_bit => false,
managed_runtime_version => 'v4.0',
}

iis::manage_site { $adminSiteName:
site_path => 'D:\sites\admin\current',
port => '80',
ip_address => '*',
host_header => $adminSiteName,
app_pool => 'admin'
}

iis::manage_virtual_application { 'position':
site_name => $adminSiteName,
site_path => 'D:\sites\position\current',
app_pool => 'position'
}

iis::manage_virtual_application { 'position/api':
site_name => $adminSiteName,
site_path => 'D:\sites\position-api\current',
app_pool => 'position'
}
}

and running the script two times:
First time the app is created correctly,

-site
--position
---api

The second time it throws an error "Destination element already exist, please use force."
Seems like in this case the sub-aps onlyif script does not work correctly.

image

Dependency problem

When trying to install opentable's puppet-iis I get the following error. Also below is a list of related modules that are already installed.

[root@puppet modules]# puppet module install opentable-iis
Notice: Preparing to install into /etc/puppet/modules ...
Notice: Downloading from https://forge.puppetlabs.com ...
Error: Could not install module 'opentable-iis' (latest: v1.2.0)
No version of 'joshcooper-powershell' will satisfy dependencies
'liamjbennett-dotnet' (v0.0.2) requires 'joshcooper-powershell' (v0.0.4)
'liamjbennett-windows_firewall' (v0.0.3) requires 'joshcooper-powershell' (>= 0.0.4)
'opentable-iis' (v1.2.0) requires 'joshcooper-powershell' (>=0.0.6)
Use puppet module install --ignore-dependencies to install only this module

[root@puppet modules]# clear; puppet module list
/etc/puppet/modules
├── joshcooper-powershell (v0.0.4)
├── liamjbennett-dotnet (v0.0.2)
├── liamjbennett-win_facts (v0.0.2)
├── liamjbennett-windows_firewall (v0.0.3)

The problem is joshcooper-powershell (v0.0.6) seems to have been replaced with puppetlabs-powershell (v1.0.2) so it's not compatible with opentable-iis.

MIME Types

Is there a mechanism for setting MIME types? I can't seem to find one.

iis_application

I am getting the following error when trying to create an iis_application:

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Syntax error at 'site' at /etc/puppetlabs/code/environments/ql_nonprod/site/profile/manifests/windows/iis/modulename.pp:62:5 on node nodename

I am passing the site name correctly but it just keeps blowing up on me here. I am honestly not sure what I am doing wrong here.

Issue managing net.tcp , net.pipe, netmsmq, and msmq.formatname bindings.

The manage_binding.pp file defers to managing iis bindings by using the New-Webbinding cmdlet. However if you attempt to manage the binding types referenced above using this cmdlets you will not get the desired results.

For example if you have a net.tcp binding With Binding Information of 808:* You could create a resource definition like this :

iis::manage_binding { 'webapi_site_binding2': 
    ensure       => 'present',
    site_name    => "webapi",
    protocol     => "net.tcp",
    port         => "808",
    ip_address   => '*',
    require      => true,
  }

However this would produce a binding of net.tcp *:808, rather than net.tcp 808:* . Mitigation would be to use the New-ItemProperty cmdlet for these binding types.

New-ItemProperty -Path "IIS:\sites\sitename" \
  -Name Bindings -value @{protocol="net.tcp"; bindingInformation="808:*"}

Going to create some logic in the existing manage_binding.pp file to do this, unless there is already work underway, OR if there is a way to resolve this difference in binding using the New-Webbinding cmdlet.

manage_app_pool.pp SPECIFICUSER identity unless not executing properly

The SPECIFICUSER user section does not properly enclose the username and password in quotes and results in no change if the application pool identity is changed. This includes the current master and the v2.0.2 branch which downloads via "puppet module install puppet-iis"

Debug output results include, among a whole lot of other parsing errors,

"You must provide a value expression following the '-ne' operator."

The exec section properly uses escaped double-quotes. The unless section does not.

Current code:
if(\$pool.processModel.userName -ne ${apppool_username}){exit 1;}if(\$pool.processModel.password -ne ${apppool_userpw}){exit 1;}exit 0;",

The following changes resolve the issue:
if(\$pool.processModel.userName -ne \"${apppool_username}\"){exit 1;}if(\$pool.processModel.password -ne \"${apppool_userpw}\"){exit 1;}exit 0;",

Version bump

If you, like we do, rely on getting the module from the forge, you get stuck with some really old code. Can it really be true that a version bump haven't been appropriate for 6-7 months?

Error: Failed to apply catalog: Parameter provider failed on Exec

i'm new with puppet. I'm trying to install opentable-iis module on my puppet slave's nodes, but I'm getting the following error:

Error: Failed to apply catalog: Parameter provider failed on Exec[CreateVirtualApplication-www.internalapi.co.uk-reviews]: Invalid exec provider 'powershell' at /etc/puppetlabs/puppet/modules/iis/manifests/manage_virtual_application.pp:18
Wrapped exception:
Invalid exec provider 'powershell'

Questions:

1-) It won't install IIS, will it? It only will create application pool and virtual directory, right?

Is there a way to install IIS through this module?

manage_app_pool can't find type

I'm trying to manage the default app pool and puppet throws a bunch of notice messages every run, although it 'seems' to work (I think).

    # from the puppet profile
    iis::manage_app_pool { 'DefaultAppPool':
        apppool_identitytype => '3',
        apppool_username     => 'mydomain\user',
        apppool_userpw       => 'pass_here',
        require  => Windowsfeature['Web-Webserver'],
      }

Here's what puppet agent runs report and log - every puppet run shows 'changed' as well with just this item being run. Any ideas ? Am I perhaps missing a windows feature or role ? Running server 2012R2 if that matters, and current (as of today) puppet-iis module.

New-Object : Cannot find type [Microsoft.Web.Administration.ServerManager]: verify that the assembly containing this type is loaded.
At line:1 char:40
Import-Module WebAdministration;$iis = New-Object Microsoft.Web.Administration.S ...
                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CategoryInfo          : InvalidType: (:) [New-Object], PSArgumentException
FullyQualifiedErrorId : TypeNotFound,Microsoft.PowerShell.Commands.NewObjectCommand

enable_32_bit is not enabled when specified to be true

I've noticed that the 32bit option is not enabled in the default app pool (or any other pool) when I specify a value of true. What am I doing wrong?

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 4.5.2
  • Ruby: 2.1.8
  • Distribution: windows server 2008 r2 enterprise
  • Module version: 1.4.1 (tried upgrading to the latest, but this broke dependencies on other modules)

How to reproduce (e.g Puppet code you use)

Here is the puppet code I tested. I have rebooted and also performed an 'iisreset' command but the 32bit application options is still false.

class iisdefaultpool {
      iis::manage_app_pool {'DefaultAppPool':
        ensure => 'present',
        enable_32_bit => true,
        managed_runtime_version => 'v2.0',
    }
}
include iisdefaultpool

What are you seeing

When I check the "application pool defaults" the option for "enable 32-bit applications" is still false. Rebooting or running an 'iisreset' command did not have any effect.

What behaviour did you expect instead

I expected the option for "enable 32-bit applications" to be set to true.

Output log

`C:\Users\Desktop>puppet parser validate iispooldefaults.pp

C:\Users\Desktop>puppet apply --debug iispooldefaults.pp
Debug: Runtime environment: puppet_version=4.5.2, ruby_version=2.1.8, run_mode=user, default_encodin
g=IBM437
Debug: Evicting cache entry for environment 'staging'
Debug: Caching environment 'staging' (ttl = 0 sec)
Debug: Evicting cache entry for environment 'staging'
Debug: Caching environment 'staging' (ttl = 0 sec)
Debug: Loading external facts from C:/ProgramData/PuppetLabs/puppet/cache/facts.d
Info: Loading facts
Debug: Loading facts from C:/ProgramData/PuppetLabs/code/environments/staging/modules/chocolatey/lib
/facter/chocolateyversion.rb
Debug: Loading facts from C:/ProgramData/PuppetLabs/code/environments/staging/modules/chocolatey/lib
/facter/choco_install_path.rb
Info: Loading facts
Debug: Loading facts from C:/ProgramData/PuppetLabs/code/environments/staging/modules/dsc/lib/facter
/powershell_version.rb
Debug: Loading facts from C:/ProgramData/PuppetLabs/code/environments/staging/modules/dsc/lib/facter
/uses_win32console.rb
Info: Loading facts
Debug: Loading facts from C:/ProgramData/PuppetLabs/code/environments/staging/modules/iis/lib/facter
/iis_version.rb
Info: Loading facts
Debug: Loading facts from C:/ProgramData/PuppetLabs/code/environments/staging/modules/stdlib/lib/fac
ter/facter_dot_d.rb
Debug: Loading facts from C:/ProgramData/PuppetLabs/code/environments/staging/modules/stdlib/lib/fac
ter/package_provider.rb
Debug: Loading facts from C:/ProgramData/PuppetLabs/code/environments/staging/modules/stdlib/lib/fac
ter/pe_version.rb
Debug: Loading facts from C:/ProgramData/PuppetLabs/code/environments/staging/modules/stdlib/lib/fac
ter/puppet_vardir.rb
Debug: Loading facts from C:/ProgramData/PuppetLabs/code/environments/staging/modules/stdlib/lib/fac
ter/root_home.rb
Debug: Loading facts from C:/ProgramData/PuppetLabs/code/environments/staging/modules/stdlib/lib/fac
ter/service_provider.rb
Debug: Facter: fact "facterversion" has resolved to "3.2.0".
Debug: Facter: initializing WMI
Debug: Facter: searching "C:\ProgramData\PuppetLabs\facter\facts.d" for external facts.
Debug: Facter: searching "C:/ProgramData/PuppetLabs/puppet/cache/facts.d" for external facts.
Debug: Facter: no external facts were found.
Debug: Facter: setting fact "env_windows_installdir" based on the value of environment variable "FAC
TER_env_windows_installdir".
Debug: Facter: fact "env_windows_installdir" has resolved to "C:\Program Files\Puppet Labs\Puppet".
Debug: Facter: loading all custom facts.
Debug: Facter: searching for custom facts in C:/ProgramData\PuppetLabs\code\environments\staging\mod
ules\chocolatey\lib\facter.
Info: Facter: loading custom facts from C:/ProgramData\PuppetLabs\code\environments\staging\modules
chocolatey\lib\facter\chocolateyversion.rb.
Info: Facter: loading custom facts from C:/ProgramData\PuppetLabs\code\environments\staging\modules
chocolatey\lib\facter\choco_install_path.rb.
Debug: Facter: searching for custom facts in C:/ProgramData\PuppetLabs\code\environments\staging\mod
ules\dsc\lib\facter.
Info: Facter: loading custom facts from C:/ProgramData\PuppetLabs\code\environments\staging\modules
dsc\lib\facter\powershell_version.rb.
Info: Facter: loading custom facts from C:/ProgramData\PuppetLabs\code\environments\staging\modules
dsc\lib\facter\uses_win32console.rb.
Debug: Facter: searching for custom facts in C:/ProgramData\PuppetLabs\code\environments\staging\mod
ules\iis\lib\facter.
Info: Facter: loading custom facts from C:/ProgramData\PuppetLabs\code\environments\staging\modules
iis\lib\facter\iis_version.rb.
Debug: Facter: searching for custom facts in C:/ProgramData\PuppetLabs\code\environments\staging\mod
ules\stdlib\lib\facter.
Info: Facter: loading custom facts from C:/ProgramData\PuppetLabs\code\environments\staging\modules
stdlib\lib\facter\facter_dot_d.rb.
Info: Facter: loading custom facts from C:/ProgramData\PuppetLabs\code\environments\staging\modules
stdlib\lib\facter\package_provider.rb.
Debug: Failed to load library 'cfpropertylist' for feature 'cfpropertylist'
Debug: Evicting cache entry for environment 'staging'
Debug: Caching environment 'staging' (ttl = 0 sec)
Debug: Evicting cache entry for environment 'staging'
Debug: Caching environment 'staging' (ttl = 0 sec)
Debug: Evicting cache entry for environment 'staging'
Debug: Caching environment 'staging' (ttl = 0 sec)
Debug: Evicting cache entry for environment 'staging'
Debug: Caching environment 'staging' (ttl = 0 sec)
Debug: Evicting cache entry for environment 'staging'
Debug: Caching environment 'staging' (ttl = 0 sec)
Debug: Failed to load library 'cfpropertylist' for feature 'cfpropertylist'
Info: Facter: loading custom facts from C:/ProgramData\PuppetLabs\code\environments\staging\modules
stdlib\lib\facter\pe_version.rb.
Info: Facter: loading custom facts from C:/ProgramData\PuppetLabs\code\environments\staging\modules
stdlib\lib\facter\puppet_vardir.rb.
Info: Facter: loading custom facts from C:/ProgramData\PuppetLabs\code\environments\staging\modules
stdlib\lib\facter\root_home.rb.
Info: Facter: loading custom facts from C:/ProgramData\PuppetLabs\code\environments\staging\modules
stdlib\lib\facter\service_provider.rb.
Debug: Evicting cache entry for environment 'staging'
Debug: Caching environment 'staging' (ttl = 0 sec)
Debug: Evicting cache entry for environment 'staging'
Debug: Caching environment 'staging' (ttl = 0 sec)
Debug: Facter: searching for custom fact "operatingsystem".
Debug: Facter: searching for operatingsystem.rb in C:/ProgramData\PuppetLabs\code\environments\stagi
ng\modules\chocolatey\lib\facter.
Debug: Facter: searching for operatingsystem.rb in C:/ProgramData\PuppetLabs\code\environments\stagi
ng\modules\dsc\lib\facter.
Debug: Facter: searching for operatingsystem.rb in C:/ProgramData\PuppetLabs\code\environments\stagi
ng\modules\iis\lib\facter.
Debug: Facter: searching for operatingsystem.rb in C:/ProgramData\PuppetLabs\code\environments\stagi
ng\modules\stdlib\lib\facter.
Debug: Facter: searching for operatingsystem.rb in C:/ProgramData\PuppetLabs\code\environments\stagi
ng\modules\chocolatey\lib\facter.
Debug: Facter: searching for operatingsystem.rb in C:/ProgramData\PuppetLabs\code\environments\stagi
ng\modules\dsc\lib\facter.
Debug: Facter: searching for operatingsystem.rb in C:/ProgramData\PuppetLabs\code\environments\stagi
ng\modules\iis\lib\facter.
Debug: Facter: searching for operatingsystem.rb in C:/ProgramData\PuppetLabs\code\environments\stagi
ng\modules\stdlib\lib\facter.
Debug: Facter: resolving operating system facts.
Debug: Facter: resolving kernel facts.
Debug: Facter: fact "kernel" has resolved to "windows".
Debug: Facter: fact "kernelrelease" has resolved to "6.1.7601".
Debug: Facter: fact "kernelmajversion" has resolved to "6.1".
Debug: Facter: fact "kernelversion" has resolved to "6.1.7601".
Debug: Facter: fact "osfamily" has resolved to "windows".
Debug: Facter: fact "operatingsystemmajrelease" has resolved to "2008 R2".
Debug: Facter: fact "operatingsystemrelease" has resolved to "2008 R2".
Debug: Facter: fact "hardwaremodel" has resolved to "x86_64".
Debug: Facter: fact "architecture" has resolved to "x64".
Debug: Facter: fact "operatingsystem" has resolved to "windows".
Debug: Facter: fact "system32" has resolved to "C:\Windows\system32".
Debug: Facter: fact "os" has resolved to {
architecture => "x64",
family => "windows",
hardware => "x86_64",
name => "windows",
release => {
full => "2008 R2",
major => "2008 R2"
},
windows => {
system32 => "C:\Windows\system32"
}
}.
Debug: Facter: searching for custom fact "osfamily".
Debug: Facter: searching for osfamily.rb in C:/ProgramData\PuppetLabs\code\environments\staging\modu
les\chocolatey\lib\facter.
Debug: Facter: searching for osfamily.rb in C:/ProgramData\PuppetLabs\code\environments\staging\modu
les\dsc\lib\facter.
Debug: Facter: searching for osfamily.rb in C:/ProgramData\PuppetLabs\code\environments\staging\modu
les\iis\lib\facter.
Debug: Facter: searching for osfamily.rb in C:/ProgramData\PuppetLabs\code\environments\staging\modu
les\stdlib\lib\facter.
Debug: Facter: searching for osfamily.rb in C:/ProgramData\PuppetLabs\code\environments\staging\modu
les\chocolatey\lib\facter.
Debug: Facter: searching for osfamily.rb in C:/ProgramData\PuppetLabs\code\environments\staging\modu
les\dsc\lib\facter.
Debug: Facter: searching for osfamily.rb in C:/ProgramData\PuppetLabs\code\environments\staging\modu
les\iis\lib\facter.
Debug: Facter: searching for osfamily.rb in C:/ProgramData\PuppetLabs\code\environments\staging\modu
les\stdlib\lib\facter.
Debug: Failed to load library 'cfpropertylist' for feature 'cfpropertylist'
Debug: Facter: searching for custom facts in C:/ProgramData\PuppetLabs\code\environments\staging\mod
ules\chocolatey\lib\facter.
Debug: Facter: searching for custom facts in C:/ProgramData\PuppetLabs\code\environments\staging\mod
ules\dsc\lib\facter.
Debug: Facter: searching for custom facts in C:/ProgramData\PuppetLabs\code\environments\staging\mod
ules\iis\lib\facter.
Debug: Facter: searching for custom facts in C:/ProgramData\PuppetLabs\code\environments\staging\mod
ules\stdlib\lib\facter.
Debug: Facter: fact "agent_specified_environment" has resolved to "staging".
Debug: Facter: fact "choco_install_path" has resolved to "C:\ProgramData\chocolatey".
Debug: Facter: fact "chocolateyversion" has resolved to "0".
Debug: Facter: fact "iis_version" has resolved to "7.5
".
Debug: Facter: fact "puppetversion" has resolved to "4.5.2".
Debug: Facter: fact "pe_version" resolved to null and will not be added.
Debug: Facter: fact "is_pe" has resolved to false.
Debug: Puppet::Type::Package::ProviderChocolatey: file C:\ProgramData\chocolatey\bin\choco.exe does
not exist
Debug: Puppet::Type::Package::ProviderAix: file /usr/bin/lslpp does not exist
Debug: Puppet::Type::Package::ProviderDpkg: file /usr/bin/dpkg does not exist
Debug: Puppet::Type::Package::ProviderApt: file /usr/bin/apt-get does not exist
Debug: Puppet::Type::Package::ProviderAptitude: file /usr/bin/aptitude does not exist
Debug: Puppet::Type::Package::ProviderRpm: file rpm does not exist
Debug: Puppet::Type::Package::ProviderAptrpm: file apt-get does not exist
Debug: Puppet::Type::Package::ProviderSun: file /usr/bin/pkginfo does not exist
Debug: Puppet::Type::Package::ProviderYum: file yum does not exist
Debug: Puppet::Type::Package::ProviderDnf: file dnf does not exist
Debug: Puppet::Type::Package::ProviderFink: file /sw/bin/fink does not exist
Debug: Puppet::Type::Package::ProviderOpenbsd: file pkg_info does not exist
Debug: Puppet::Type::Package::ProviderFreebsd: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderHpux: file /usr/sbin/swinstall does not exist
Debug: Puppet::Type::Package::ProviderNim: file /usr/sbin/nimclient does not exist
Debug: Puppet::Type::Package::ProviderOpkg: file opkg does not exist
Debug: Puppet::Type::Package::ProviderPacman: file /usr/bin/pacman does not exist
Debug: Puppet::Type::Package::ProviderPkg: file /usr/bin/pkg does not exist
Debug: Puppet::Type::Package::ProviderPkgin: file pkgin does not exist
Debug: Puppet::Type::Package::ProviderPkgng: file /usr/local/sbin/pkg does not exist
Debug: Puppet::Type::Package::ProviderPortage: file /usr/bin/emerge does not exist
Debug: Puppet::Type::Package::ProviderPorts: file /usr/local/sbin/portupgrade does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/local/sbin/portupgrade does not exist
Debug: Puppet::Type::Package::ProviderRug: file /usr/bin/rug does not exist
Debug: Puppet::Type::Package::ProviderSunfreeware: file pkg-get does not exist
Debug: Puppet::Type::Package::ProviderUp2date: file /usr/sbin/up2date-nox does not exist
Debug: Puppet::Type::Package::ProviderUrpmi: file urpmi does not exist
Debug: Puppet::Type::Package::ProviderZypper: file /usr/bin/zypper does not exist
Debug: /Package[dummy]: Provider windows does not support features virtual_packages; not managing at
tribute allow_virtual
Debug: Facter: fact "package_provider" has resolved to "windows".
Debug: Facter: fact "pe_major_version" resolved to null and will not be added.
Debug: Facter: fact "pe_minor_version" resolved to null and will not be added.
Debug: Facter: fact "pe_patch_version" resolved to null and will not be added.
Debug: Facter: fact "powershell_version" has resolved to "3.0".
Debug: Facter: fact "puppet_vardir" has resolved to "C:/ProgramData/PuppetLabs/puppet/cache".
Debug: Facter: fact "root_home" resolved to null and will not be added.
Debug: Puppet::Type::Service::ProviderBase: file kill does not exist
Debug: Puppet::Type::Service::ProviderDaemontools: file /usr/bin/svc does not exist
Debug: Puppet::Type::Service::ProviderDebian: file /usr/sbin/update-rc.d does not exist
Debug: Puppet::Type::Service::ProviderGentoo: file /sbin/rc-update does not exist
Debug: Puppet::Type::Service::ProviderLaunchd: file /bin/launchctl does not exist
Debug: Puppet::Type::Service::ProviderOpenbsd: file /usr/sbin/rcctl does not exist
Debug: Puppet::Type::Service::ProviderOpenrc: file /bin/rc-status does not exist
Debug: Puppet::Type::Service::ProviderRedhat: file /sbin/chkconfig does not exist
Debug: Puppet::Type::Service::ProviderRunit: file /usr/bin/sv does not exist
Debug: Puppet::Type::Service::ProviderSystemd: file systemctl does not exist
Debug: Puppet::Type::Service::ProviderUpstart: 0 confines (of 4) were true
Debug: Facter: fact "service_provider" has resolved to "windows".
Debug: Facter: fact "uses_win32console" resolved to null and will not be added.
Debug: Facter: resolving ruby facts.
Debug: Facter: fact "rubyplatform" has resolved to "x64-mingw32".
Debug: Facter: fact "rubysitedir" has resolved to "C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/
ruby/site_ruby/2.1.0".
Debug: Facter: fact "rubyversion" has resolved to "2.1.8".
Debug: Facter: fact "ruby" has resolved to {
platform => "x64-mingw32",
sitedir => "C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/site_ruby/2.1.0",
version => "2.1.8"
}.
Debug: Facter: resolving path facts.
Debug: Facter: fact "path" has resolved to "C:\Program Files\Puppet Labs\Puppet\facter/bin;C:\Progra
m Files\Puppet Labs\Puppet\puppet\bin;C:\Program Files\Puppet Labs\Puppet\facter\bin;C:\Program File
s\Puppet Labs\Puppet\hiera\bin;C:\Program Files\Puppet Labs\Puppet\mcollective\bin;C:\Program Files
Puppet Labs\Puppet\bin;C:\Program Files\Puppet Labs\Puppet\sys\ruby\bin;C:\Program Files\Puppet Labs
\Puppet\sys\tools\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files\Puppe
t Labs\Puppet\bin;C:\Windows\System32\WindowsPowerShell\v1.0".
Debug: Facter: resolving EC2 facts.
Debug: Facter: resolving virtualization facts.
Debug: Facter: fact "is_virtual" has resolved to true.
Debug: Facter: fact "virtual" has resolved to "vmware".
Debug: Facter: EC2 facts are unavailable: not running under an EC2 instance.
Debug: Facter: resolving GCE facts.
Debug: Facter: not running under a GCE instance.
Debug: Facter: resolving augeas facts.
Debug: Facter: executing command: augparse --version
Debug: Facter: augparse was not found on the PATH.
Debug: Facter: resolving id facts.
Debug: Facter: fact "id" has resolved to "".
Debug: Facter: fact "identity" has resolved to {
user => ""
}.
Debug: Facter: resolving memory facts.
Debug: Facter: fact "memoryfree" has resolved to "6.91 GiB".
Debug: Facter: fact "memoryfree_mb" has resolved to 7080.14.
Debug: Facter: fact "memorysize" has resolved to "8.00 GiB".
Debug: Facter: fact "memorysize_mb" has resolved to 8191.49.
Debug: Facter: fact "memory" has resolved to {
system => {
available => "6.91 GiB",
available_bytes => 7424065536,
capacity => "13.57%",
total => "8.00 GiB",
total_bytes => 8589402112,
used => "1.09 GiB",
used_bytes => 1165336576
}
}.
Debug: Facter: resolving networking facts.
Debug: Facter: initializing Winsock
Debug: Facter: fact "ipaddress_Local Area Connection" has resolved to "10.64.8.155".
Debug: Facter: fact "ipaddress" has resolved to "10.64.8.155".
Debug: Facter: fact "netmask_Local Area Connection" has resolved to "255.255.254.0".
Debug: Facter: fact "netmask" has resolved to "255.255.254.0".
Debug: Facter: fact "network_Local Area Connection" has resolved to "10.64.8.0".
Debug: Facter: fact "network" has resolved to "10.64.8.0".
Debug: Facter: fact "ipaddress6_Local Area Connection" has resolved to "fe80::8c1d:f408:661f:196b%11
".
Debug: Facter: fact "ipaddress6" has resolved to "fe80::8c1d:f408:661f:196b%11".
Debug: Facter: fact "netmask6_Local Area Connection" has resolved to "ffff:ffff:ffff:ffff::".
Debug: Facter: fact "netmask6" has resolved to "ffff:ffff:ffff:ffff::".
Debug: Facter: fact "network6_Local Area Connection" has resolved to "fe80::%11".
Debug: Facter: fact "network6" has resolved to "fe80::%11".
Debug: Facter: fact "macaddress_Local Area Connection" has resolved to "00:50:56:AC:11:D2".
Debug: Facter: fact "macaddress" has resolved to "00:50:56:AC:11:D2".
Debug: Facter: fact "mtu_Local Area Connection" has resolved to 1500.
Debug: Facter: fact "hostname" has resolved to "".
Debug: Facter: fact "domain" has resolved to "".
Debug: Facter: fact "fqdn" has resolved to ".".
Debug: Facter: fact "interfaces" has resolved to "Local Area Connection".
Debug: Facter: fact "networking" has resolved to {
domain => "",
fqdn => ".",
hostname => "",
interfaces => {
Local Area Connection => {
bindings => [
{
address => "<ip_address>",
netmask => "255.255.254.0",
network => ""
}
],
bindings6 => [
{
address => "fe80::8c1d:f408:661f:196b%11",
netmask => "ffff:ffff:ffff:ffff::",
network => "fe80::%11"
}
],
ip => "<ip_address>",
ip6 => "fe80::8c1d:f408:661f:196b%11",
mac => "00:50:56:AC:11:D2",
mtu => 1500,
netmask => "255.255.254.0",
netmask6 => "ffff:ffff:ffff:ffff::",
network => "",
network6 => "fe80::%11"
}
},
ip => "<ip_address>",
ip6 => "fe80::8c1d:f408:661f:196b%11",
mac => "00:50:56:AC:11:D2",
mtu => 1500,
netmask => "255.255.254.0",
netmask6 => "ffff:ffff:ffff:ffff::",
network => "",
network6 => "fe80::%11",
primary => "Local Area Connection"
}.
Debug: Facter: resolving timezone facts.
Debug: Facter: fact "timezone" has resolved to "Pacific Daylight Time".
Debug: Facter: resolving desktop management interface facts.
Debug: Facter: fact "productname" has resolved to "VMware Virtual Platform".
Debug: Facter: fact "serialnumber" has resolved to "VMware-42 2c c2 8b f4 1c c6 6a-c6 22 24 9b 20 70
e4 d9".
Debug: Facter: fact "manufacturer" has resolved to "Phoenix Technologies LTD".
Debug: Facter: fact "dmi" has resolved to {
manufacturer => "Phoenix Technologies LTD",
product => {
name => "VMware Virtual Platform",
serial_number => "VMware-42 2c c2 8b f4 1c c6 6a-c6 22 24 9b 20 70 e4 d9"
}
}.
Debug: Facter: resolving processor facts.
Debug: Facter: fact "hardwareisa" has resolved to "x64".
Debug: Facter: fact "processorcount" has resolved to 2.
Debug: Facter: fact "physicalprocessorcount" has resolved to 2.
Debug: Facter: fact "processor0" has resolved to "Intel(R) Xeon(R) CPU X7560 @ 2.27GHz".
Debug: Facter: fact "processor1" has resolved to "Intel(R) Xeon(R) CPU X7560 @ 2.27GHz".
Debug: Facter: fact "processors" has resolved to {
count => 2,
isa => "x64",
models => [
"Intel(R) Xeon(R) CPU X7560 @ 2.27GHz",
"Intel(R) Xeon(R) CPU X7560 @ 2.27GHz"
],
physicalcount => 2
}.
Debug: Facter: resolving uptime facts.
Debug: Facter: fact "uptime_seconds" has resolved to 8243.
Debug: Facter: fact "uptime_hours" has resolved to 2.
Debug: Facter: fact "uptime_days" has resolved to 0.
Debug: Facter: fact "uptime" has resolved to "2:17 hours".
Debug: Facter: fact "system_uptime" has resolved to {
days => 0,
hours => 2,
seconds => 8243,
uptime => "2:17 hours"
}.
Debug: Evicting cache entry for environment 'staging'
Debug: Caching environment 'staging' (ttl = 0 sec)
Debug: importing 'C:/ProgramData/PuppetLabs/code/environments/staging/modules/iis/manifests/init.pp'
in environment staging
Debug: importing 'C:/ProgramData/PuppetLabs/code/environments/staging/modules/iis/manifests/manage_a
pp_pool.pp' in environment staging
Debug: Automatically imported iis::manage_app_pool from iis/manage_app_pool into staging
Notice: Compiled catalog for . in environment staging in 0.39 seconds
Debug: Puppet::Type::Exec::ProviderPosix: feature posix is missing
Debug: Puppet::Type::Exec::ProviderShell: feature posix is missing
Debug: Creating default schedules
Debug: Loaded state in 0.02 seconds
Debug: Loaded state in 0.03 seconds
Info: Applying configuration version '1471897139'
Debug: /Stage[main]/Iispooldefaults/Iis::Manage_app_pool[DefaultAppPool]/Exec[Framework-DefaultAppPo
ol]/require: subscribes to Exec[Create-DefaultAppPool]
Debug: /Stage[main]/Iispooldefaults/Iis::Manage_app_pool[DefaultAppPool]/Exec[32bit-DefaultAppPool]/
require: subscribes to Exec[Create-DefaultAppPool]
Debug: /Stage[main]/Iispooldefaults/Iis::Manage_app_pool[DefaultAppPool]/Exec[ManagedPipelineMode-De
faultAppPool]/require: subscribes to Exec[Create-DefaultAppPool]
Debug: ExecCreate-DefaultAppPool: Executing check 'cmd.exe /c ""C:\Windows\sy
stem32\WindowsPowershell\v1.0\powershell.exe" -NoProfile -NonInteractive -NoLogo -ExecutionPolicy By
pass -Command - < "C:\Users\AppData\Local\Temp\puppet-powershell20160822-2412-c1gjqh.ps1""'

Debug: Executing: 'cmd.exe /c ""C:\Windows\system32\WindowsPowershell\v1.0\powershell.exe" -NoProfil
e -NonInteractive -NoLogo -ExecutionPolicy Bypass -Command - < "C:\Users\AppData\Local\Temp
\puppet-powershell20160822-2412-c1gjqh.ps1""'
Debug: ExecFramework-DefaultAppPool: Executing check 'cmd.exe /c ""C:\Windows
\system32\WindowsPowershell\v1.0\powershell.exe" -NoProfile -NonInteractive -NoLogo -ExecutionPolicy
Bypass -Command - < "C:\Users\AppData\Local\Temp\puppet-powershell20160822-2412-1q6y35s.ps
1""'
Debug: Executing: 'cmd.exe /c ""C:\Windows\system32\WindowsPowershell\v1.0\powershell.exe" -NoProfil
e -NonInteractive -NoLogo -ExecutionPolicy Bypass -Command - < "C:\Users\AppData\Local\Temp
\puppet-powershell20160822-2412-1q6y35s.ps1""'
Debug: Exec32bit-DefaultAppPool: Executing check 'cmd.exe /c ""C:\Windows\sys
tem32\WindowsPowershell\v1.0\powershell.exe" -NoProfile -NonInteractive -NoLogo -ExecutionPolicy Byp
ass -Command - < "C:\Users\AppData\Local\Temp\puppet-powershell20160822-2412-j6ok3u.ps1""'
Debug: Executing: 'cmd.exe /c ""C:\Windows\system32\WindowsPowershell\v1.0\powershell.exe" -NoProfil
e -NonInteractive -NoLogo -ExecutionPolicy Bypass -Command - < "C:\Users\AppData\Local\Temp
\puppet-powershell20160822-2412-j6ok3u.ps1""'
Debug: ExecManagedPipelineMode-DefaultAppPool: Executing check 'cmd.exe /c ""
C:\Windows\system32\WindowsPowershell\v1.0\powershell.exe" -NoProfile -NonInteractive -NoLogo -Execu
tionPolicy Bypass -Command - < "C:\Users\AppData\Local\Temp\puppet-powershell20160822-2412-
im3e2q.ps1""'
Debug: Executing: 'cmd.exe /c ""C:\Windows\system32\WindowsPowershell\v1.0\powershell.exe" -NoProfil
e -NonInteractive -NoLogo -ExecutionPolicy Bypass -Command - < "C:\Users\AppData\Local\Temp
\puppet-powershell20160822-2412-im3e2q.ps1""'
Debug: Finishing transaction 55092360
Debug: Storing state
Debug: Stored state in 0.02 seconds
Notice: Applied catalog in 5.27 seconds
Debug: Applying settings catalog for sections reporting, metrics
Debug: Finishing transaction 51942960
Debug: Received report to process from .
Debug: Evicting cache entry for environment 'staging'
Debug: Caching environment 'staging' (ttl = 0 sec)
Debug: Processing report from . with processor Puppet::Reports::Store`

Any additional information you'd like to impart

No.

Changing Site Directory

I updated the site and virtual site to point to new directories, after the puppet run, a new folder was created with the correct value, however looking at IIS the site and virtual directory were still pointing to the old folder. I deleted the site and virtual directory from IIS and it correctly recreated them pointing to the new directory.

iis_version fact runs profile code

If your Desktop/WindowsPowerShell/profile.ps1 outputs any text, it will be included in the iis_version fact.

PS C:\Users\Administrator> facter -p iis_version
 _________
| boogers |
 ---------
\                             .       .
 \                           / `.   .' "
  \                  .---.  <    > <    >  .---.
   \                 |    \  \ - ~ ~ - /  /    |
         _____          ..-~             ~-..-~
        |     |   \~~~\.'                    `./~~~/
       ---------   \__/                        \__/
      .'  O    \     /               /       \  "
     (_____,    `._.'               |         }  \/~~~/
      `----.          /       }     |        /    \__/
            `-.      |       /      |       /      `. ,~~|
                ~-.__|      /_ - ~ ^|      /- _      `..-'
                     |     /        |     /     ~-.     `-. _  _  _
                     |_____|        |_____|         ~ - . _ _ _ _ _>
8.5

Failed to generate additional resources using 'generate': A JSON text must at least contain two octets!

Affected Puppet, Ruby, OS and module versions/distributions

PE 2016.1.2
mod 'iis',
  :git    => 'https://github.com/voxpupuli/puppet-iis.git',
  :commit => '35c41af1c6eb4d1f26009c184924e74f7660e482'

What are you seeing

Failed to generate additional resources using 'generate': A JSON text must at least contain two octets!

What behaviour did you expect instead

Resource purge without errors.

How did this behaviour get triggered

resources { 'iis_site':
  purge   => true,
}

Output log

Failed to generate additional resources using 'generate': A JSON text must at least contain two octets!

Any additional information you'd like to impart

This occurs when no sites are configured in IIS. A JSON error is returned because the underlying Powershell converted to JSON appears to return non-JSON string data. A catch should be put into all areas that are reading JSON from Powershell cmdlets using the JSON conversion method to check for improper results.

When I get time, I will attempt to send a PR on this issue myself.

facter fact rescue not functional

iis_version facter fact yields-

fyi - @cyberious

iis_version => Get-ItemProperty : Cannot find path 'HKLM:\SOFTWARE\Microsoft\InetStp\' because it does not exist.
At line:1 char:2
+ (Get-ItemProperty HKLM:\SOFTWARE\Microsoft\InetStp\ -Name VersionString).Version ...
+  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (HKLM:\SOFTWARE\Microsoft\InetStp\:String) [Get-ItemProperty], ItemNotFo
   undException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetItemPropertyCommand

You cannot call a method on a null-valued expression.
At line:1 char:1
+ (Get-ItemProperty HKLM:\SOFTWARE\Microsoft\InetStp\ -Name VersionString).Version ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull�

I think this is because the rescue is not being invoked. you may need to use something like -erroraction -silentlycontinue for the key not found handling.

idleTimeoutAction

Was adding some code to the manage_app_pool.pp file and I was just looking to see if someone might be able to double check my work here. Working on a Windows box and I don't have the tools available to do a lot of the unit testing.

commit number: 397bff6

Adding a new value to control the idleActionTimeout so that we can change it to Suspend or Terminate.

$apppool_idle_Timeout_action      = 'Terminate'

validate_re($apppool_idle_Timeout_action, '^(Suspend|Terminate)$')

exec { "IdleTimeoutAction-${app_pool_name}":
  command   => "Import-Module WebAdministration; Set-ItemProperty \"IIS:\\AppPools\\${app_pool_name}\" startMode ${apppool_idle_Timeout_action}",
  provider  => powershell,
  onlyif    => "Import-Module WebAdministration; if((Get-ItemProperty \"IIS:\\AppPools\\${app_pool_name}\" startMode).CompareTo('${apppool_idle_Timeout_action}') -eq 0) { exit 1 } else { exit 0 }",
  require   => Exec["Create-${app_pool_name}"],
  logoutput => true,
}

Module depends on role IIS-WebServerRole to be enabled

After installing opentable-iis with dependencies on a vanilla Windows 2012 R2 server, I got:

Import-Module : The specified module 'WebAdministration' was not loaded because no valid module file was found in any module directory.

I needed to do

dism { 'IIS-WebServerRole':
     ensure => present,
   }

to be able to use the module.

Is it an idea to either document or enforce this?

manage_binding not working on Windows Server 2008 R2

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 3.7.2
  • Ruby: 2.0.0p481
  • Distribution: Puppet Forge
  • Module version: 2.0.2
  • OS: Windows Server 2008 R2 SP1

How to reproduce (e.g Puppet code you use)

class profiles::test_web {
  $website_name = 'test'
  $website_path = 'C:\Temp\TestWeb'
  $host_headers = ['first.test.net', 'second.test.net']

  iis::manage_app_pool { $website_name:
    enable_32_bit           => false,
    managed_runtime_version => 'v4.0',
    managed_pipeline_mode   => 'Integrated'
  }

  iis::manage_site { $website_name:
    site_path   => $website_path,
    port        => 80,
    ip_address  => '*',
    host_header => $host_headers[0],
    app_pool    => $website_name
  }

  iis::manage_binding { "${website_name} second binding":
    site_name   => $website_name,
    port        => 80,
    ip_address  => '*',
    host_header => $host_headers[1],
    protocol    => 'http',
    require     => Iis::Manage_site[$website_name]
  }
}

What are you seeing

The second binding "second.test.net" fails to be created.

Maybe the underlying -SslFlags argument is only supported on Windows Server 2012 and not Windows Server 2008 R2?

What behaviour did you expect instead

I expected the second binding "second.test.net" to be created.

Output log

Notice: /Stage[main]/Profiles::Test_web/Iis::Manage_binding[test second binding]/Exec[CreateBinding-test second binding]/returns: New-WebBinding : A parameter cannot be found that matches parameter name 'SslFlags'.
Notice: /Stage[main]/Profiles::Test_web/Iis::Manage_binding[test second binding]/Exec[CreateBinding-test second binding]/returns: At line:1 char:133
Notice: /Stage[main]/Profiles::Test_web/Iis::Manage_binding[test second binding]/Exec[CreateBinding-test second binding]/returns: + ... -IPAddress "*" -SslFlags "0"
Notice: /Stage[main]/Profiles::Test_web/Iis::Manage_binding[test second binding]/Exec[CreateBinding-test second binding]/returns: +                    ~~~~~~~~~
Notice: /Stage[main]/Profiles::Test_web/Iis::Manage_binding[test second binding]/Exec[CreateBinding-test second binding]/returns:     + CategoryInfo          : InvalidArgument: (:) [New-WebBinding], ParameterBindingException
Notice: /Stage[main]/Profiles::Test_web/Iis::Manage_binding[test second binding]/Exec[CreateBinding-test second binding]/returns:     + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.IIs.PowerShell.Provider.NewWebBindingCommand
Notice: /Stage[main]/Profiles::Test_web/Iis::Manage_binding[test second binding]/Exec[CreateBinding-test second binding]/returns:
Error: Import-Module WebAdministration; New-WebBinding -Name "test" -Port 80 -Protocol "http" -HostHeader "second.test.net" -IPAddress "*" -SslFlags "0" returned 1 instead of one of [0]
Error: /Stage[main]/Profiles::Test_web/Iis::Manage_binding[test second binding]/Exec[CreateBinding-test second binding]/returns: change from notrun to 0 failed: Import-Module WebAdministration; New-WebBinding -Name "test" -Port 80 -Protocol "http" -HostHeader "second.test.net" -IPAddress "*" -SslFlags "0" returned 1 instead of one of [0]

Any additional information you'd like to impart

N/A

how to manage state

Hi,

how do do get the website to start with manage_site_state.pp is there an example ?

iis::manage_app_pool resource ordering

There is no resource ordering on certain parameters in in iis::manage_app_pool define type - for example setting the app pool max processes value. Puppet sometimes tries to apply this setting before the app pool has been created.

Adding 'require => Exec["Create-${app_pool_name}"],' to the "App Pool Max Processes - ${app_pool_name}" exec should fix. The same would need adding to other app pool configuration options that require the application pool to be created.

Thanks

Master branch is out of date

I'm not 100% sure on this, but it's difficult to tell which branch is the proper one to use; Branch appears to be out of date with 2.0.2.

Cannot autoload iispowershell

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Evaluation Error: Error while evaluating a Re
source Statement, Evaluation Error: Error while evaluating a Resource Statement, Could not autoload puppet/type/iis_pool
: Could not autoload puppet/provider/iis_pool/powershell: no such file to load -- puppet/provider/iispowershell at /etc/
puppetlabs/code/environments/production/site/profile/manifests/iisdefault.pp:4:3 on node coolplace-redacted.com
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

Looks related to https://tickets.puppetlabs.com/browse/PUP-4450

Fix seems is to be to wait for the code to be loaded in the pool (?) or to change the requires like so:

-require 'puppet/provider/iispowershell'
+require File.dirname(__FILE__) + ' /../iispowershell.rb'
 require 'json'

Lots of warnings when using create-certificate-binding.ps1

Currently there are a ton of warnings spit out when you try to bind an SSL Certificate from the ERB parser:

==> default: Warning: Variable access via 'certificate_thumbprint' is deprecated. Use '@certificate_thumbprint' instead. template[C:/tmp/vagrant-puppet-4/modules-0/iis/templates/create-certificate-binding.ps1.erb]:5
==> default:    (at C:/tmp/vagrant-puppet-4/modules-0/iis/templates/create-certificate-binding.ps1.erb:5:in `block in result')
==> default: Warning: Variable access via 'ip_address' is deprecated. Use '@ip_address' instead. template[C:/tmp/vagrant-puppet-4/modules-0/iis/templates/create-certificate-binding.ps1.erb]:7
==> default:    (at C:/tmp/vagrant-puppet-4/modules-0/iis/templates/create-certificate-binding.ps1.erb:7:in `block in result')
==> default: Warning: Variable access via 'certificate_thumbprint' is deprecated. Use '@certificate_thumbprint' instead. template[C:/tmp/vagrant-puppet-4/modules-0/iis/templates/create-certificate-binding.ps1.erb]:9
==> default:    (at C:/tmp/vagrant-puppet-4/modules-0/iis/templates/create-certificate-binding.ps1.erb:9:in `block in result')
==> default: Warning: Variable access via 'ip_address' is deprecated. Use '@ip_address' instead. template[C:/tmp/vagrant-puppet-4/modules-0/iis/templates/create-certificate-binding.ps1.erb]:11
==> default:    (at C:/tmp/vagrant-puppet-4/modules-0/iis/templates/create-certificate-binding.ps1.erb:11:in `block in result')
==> default: Warning: Variable access via 'certificate_thumbprint' is deprecated. Use '@certificate_thumbprint' instead. template[C:/tmp/vagrant-puppet-4/modules-0/iis/templates/create-certificate-binding.ps1.erb]:13
==> default:    (at C:/tmp/vagrant-puppet-4/modules-0/iis/templates/create-certificate-binding.ps1.erb:13:in `block in result')
==> default: Warning: Variable access via 'certificate_thumbprint' is deprecated. Use '@certificate_thumbprint' instead. template[C:/tmp/vagrant-puppet-4/modules-0/iis/templates/create-certificate-binding.ps1.erb]:15
==> default:    (at C:/tmp/vagrant-puppet-4/modules-0/iis/templates/create-certificate-binding.ps1.erb:15:in `block in result')
==> default: Warning: Variable access via 'ip_address' is deprecated. Use '@ip_address' instead. template[C:/tmp/vagrant-puppet-4/modules-0/iis/templates/create-certificate-binding.ps1.erb]:16
==> default:    (at C:/tmp/vagrant-puppet-4/modules-0/iis/templates/create-certificate-binding.ps1.erb:16:in `block in result')

These should be cleaned up

Update the license?

Is the LICENSE file still correct? It is still pointed to OpenTable, versus adding additional lines.

Support for Virtual Applications on a directory that already exists

In IIS it's possible to have a directory underneath a site root that is flagged as a virtual application and points to itself. This is different than the scenario you describe where the virtual applications have separate roots in the Readme.md.

Readme.md:

  • Site Root - site_path => 'C:\inetpub\wwwroot\mysite',
    • Application1 - site_path => 'C:\inetpub\wwwroot\application1'
    • Application2 - site_path => 'C:\inetpub\wwwroot\application2'

In the scenario I'm trying to configure, I have a site that is built like:

  • Site Root - site_path => 'C:\inetpub\wwwroot\mysite',
    • Application1 - site_path => 'C:\inetpub\wwwroot\mysite\application1'
    • Application2 - site_path => 'C:\inetpub\wwwroot\mysite\application2'

However, when I add the resource for the virtual application into Puppet, it does not run provisioning to create the virtual application (presumably because there's already an existing directory there and it doesn't think it needs to)

Steps to reproduce:

  1. Create a Site in IIS with Puppet
  2. Manually go in to the site root add a directory named VirtualApp
  3. Add a resource to your puppet manifest for the name VirtualApp
  4. Run Puppet

Expected: Puppet converts the folder to a virtual directory (similar to going into IIS admin and right clicking the folder and clicking convert to virtual application)
Actual: Does not create the virtual directory

Unable to create Manage Virtual Applications that have spaces in the names

If you try to add a virtual application to a site with a space in the name, the module bombs out because it's not passing the names correctly in the powershell command

  $applicationName = "My Test Application"
  iis::manage_site { $applicationName:
    ensure    => present,
    site_path => "${webPath}", #Must be \\'s for IIS to work correctly
    app_pool  => "${applicationName}",
    require => File['application-root'],
  }

  iis::manage_virtual_application { 'vapp':
    site_name   => "${applicationName}",
    site_path   => "${webPath}\\Dashboard",
    app_pool    => "${applicationName}"
  }

Gets you this output:

==> default: Error: powershell.exe -ExecutionPolicy RemoteSigned -Command "Import-Module WebAdministration; New-WebApplication -Name vapp -Site My Test Application -PhysicalPath C:\vagrant\Web\Dashboard -ApplicationPool My Test Site" returned 1 instead of one of [0]
==> default: Error: /Stage[main]/Application_server/Iis::Manage_virtual_application[vapp]/Exec[CreateVirtualApplication-My Test Application-vapp]/returns: change from notrun to 0 failed: powershell.exe -ExecutionPolicy RemoteSigned -Command "Import-Module WebAdministration; New-WebApplication -Name vapp -Site My Test Application -PhysicalPath C:\vagrant\Web\Dashboard -ApplicationPool My Test Site" returned 1 instead of one of [0]

There are quotes missing around the arguments passed to this command

IIS No Sites Issue

So I found an interesting issue. If there are NO sites already on the server, on line 24:

gci "IIS:\sites" | %{ Get-ItemProperty $_.PSPath | Select name, PhysicalPath, ApplicationPool, HostHeader, State, Bindings } | ConvertTo-Json -Depth 4 -Compress

That will obviously return zero results. This creates a NULL value with no data and when I was trying to pull down a NEW site to the server with no sites currently on it, the code was failing because there was no data in the value that was being passed on and I was getting the following error.

Error: Failed to apply catalog: A JSON text must at least contain two octets!

Add an application under an IIS website

Hi,

I am setting up a website in IIS with the below snippet

iis::manage_site {'Demo':
site_path => 'C:\inetpub\wwwroot\Demo',
port => '80',
ip_address => '*',
app_pool => 'Demo',
}

However I have few folders under "Demo" which needs to be converted to an application and not to be used as a virtual directory. Is there an equivalent of "iis::manage_virtual_application" for setting up an application.

SSL binding - potential incorrect exit code in inspect-certificate-binding.ps1.erb

Hi,

I'm using version 1.1.0 from PuppetForge, and I can't get an SSL binding to work. I believe the final exit code in the template 'inspect-certificate-binding.ps1.erb' is incorrect. I think it should be 'exit 0' and not 'exit 1'.

This is what I'm seeing.....

My code is:-
iis::manage_binding { 'www.example.com':
site_name => 'www.example.com',
protocol => 'https',
port => 443,
host_header => 'www.example.com',
ip_address => '1.2.3.4',
certificate_thumbprint => 'abcdef.....', # I've replaced my valid thumbprint here
ensure => present,
}

The puppet run creates the web binding (IIS shows a binding on the correct port etc but with no certificate selected). The two powershell files (create-www.example.com.ps1 and inspect-www.example.com.ps1) are created in c:\temp but the certificate isn't assigned to the binding.

The resource
exec { "Attach-Certificate-${title}"
doesn't run. Manually running the inspect-www.example.com.ps1 file on the host returns 1, as there isn't any items in IIS:\SslBindings. Manually running the create-www.example.com.ps1 script attaches the certificate to the binding, and then there is an entry in IIS:\SslBindings.

Hope this makes some kind of sense.

Thanks,

Version 2.0.0 does not work, because of naming issue

Hi, we are trying to use version 2.0.0 of this module and noticed that one file was misnamed. This issue appears to be fixed, but no new version is available. Do you plan to release version with fix included?

Link to the fixing commit: 63a1c4a

Error in IIS Site SpecificUser

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 2016
  • Ruby: PE
  • Distribution: PE EL7
  • Module version: master

How to reproduce (e.g Puppet code you use)

Try and set a specific user for IIS App Pool.

What are you seeing

Error: Import-Module WebAdministration;$iis = New-Object Microsoft.Web.Administration.ServerManager;iis:;$pool = get-item IIS:\AppPools***;$pool.processModel.username = "**__";$pool.processModel.password = "_";$pool.processModel.identityType = 3;$pool | set-item; returned 1 instead of one of [0] Error: /Stage[main]/Bsb::Websites::Cms/Iis::Manage_app_pool[__]/Exec[app pool identitytype - _]/returns: change from notrun to 0 failed: Import-Module WebAdministration;$iis = New-Object Microsoft.Web.Administration.ServerManager;iis:;$pool = get-item IIS:\AppPools*;$pool.processModel.username = "";$pool.processModel.password = "*";$pool.processModel.identityType = 3;$pool | set-item; returned 1 instead of one of [0]

What behaviour did you expect instead

Application Pool to go Into SpecificUser mode with AD user.

Output log

See above.

Any additional information you'd like to impart

I think I have a fix, I'm working on it in a fork.

replace doubly escaped \ with simple /

as noted in #70 (comment)

Powershell will permit Foo:/bar/baz instead of Foo:\bar\baz.

Since @brushwood24 was making an addition it was just stayed with the current style to keep it consistent.

We should update our code to this easier to read for humans, we should replace doubly escaped backslashes (\) with simple forward slashes (/).

IIS Create Site

I am getting weirdness when I try and use the following to create a new IIS site.

iis_site { 'testsite':
app_pool => 'testsite',
ip => '*',
path => 'C:/sites/testsite',
host_header => 'testsite',
port => '80',
protocol => 'http',
ssl => 'false'
}

I run puppet from the machine to apply the config....

Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for _removedservernamehere_
Info: Applying configuration version 'e2b8bc40e2fa6d019a84a54b6921f2757626c8b3'
Notice: /Stage[main]/Profile::Windows::Iis::Base/Exec[check-feature-delegation]/returns: executed successfully
Error: Failed to apply catalog: A JSON text must at least contain two octets!

Not sure what I am missing here but it does not like what I have in the above in the site creation.

Binding host header changes don't get picked up

It seems:

iis::manage_site {'mysite':
      site_path     => 'C:\inetpub\wwwroot\mysite',
      port          => '80',
      #ssl           => 'false',
      ip_address    => '*',
      host_header   => 'qa-mysite.mydomain.com',
      app_pool      => 'myapppool',
    }

Creates the site with the correct binding, but if we change the host header, it doesn't register as a change. In other words, if I change host_header to "foo-bar.somesite.com", puppet runs, sees there's no changes and carries on.

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.