-
Notifications
You must be signed in to change notification settings - Fork 19
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
Updated to work with Puppet 4 and updated IIS module #5
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,66 +30,63 @@ | |
# means. e.g. environment variable ChocolateyBinRoot. Defaults to | ||
# 'C:\tools\chocolatey.server' | ||
class chocolatey_server ( | ||
$port = $::chocolatey_server::params::service_port, | ||
$server_package_source = $::chocolatey_server::params::server_package_source, | ||
$server_install_location = $::chocolatey_server::params::server_install_location, | ||
) inherits ::chocolatey_server::params { | ||
$service_port = '80', | ||
$server_package_source = 'https://chocolatey.org/api/v2/', | ||
$server_install_location = 'C:\tools\chocolatey.server', | ||
$chocolatey_server_app_pool_name = 'chocolatey.server', | ||
$chocolatey_server_app_port = $port, | ||
) { | ||
require chocolatey | ||
|
||
$_chocolatey_server_location = $server_install_location | ||
$_chocolatey_server_app_pool_name = 'chocolatey.server' | ||
$_chocolatey_server_app_port = $port | ||
$_server_package_url = $server_package_source | ||
|
||
# package install | ||
package {'chocolatey.server': | ||
ensure => installed, | ||
provider => chocolatey, | ||
source => $_server_package_url, | ||
ensure => installed, | ||
provider => chocolatey, | ||
source => $server_package_source, | ||
} -> | ||
|
||
# add windows features | ||
windowsfeature { 'Web-WebServer': | ||
installmanagementtools => true, | ||
} -> | ||
windowsfeature { 'Web-Asp-Net45': | ||
windowsfeature { 'Web-Asp-Net45': | ||
} -> | ||
|
||
# remove default web site | ||
iis::manage_site {'Default Web Site': | ||
ensure => absent, | ||
site_path => 'any', | ||
app_pool => 'DefaultAppPool' | ||
iis_site {'Default Web Site': | ||
ensure => stopped, | ||
app_pool => 'DefaultAppPool' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a different change than what the module originally did. It removed the default website. Are you proposing to just stop it instead? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am simply because there is a bug which I meant to include. When no sites exist, this creates an issue. voxpupuli/puppet-iis#123 |
||
} -> | ||
|
||
# application in iis | ||
iis::manage_app_pool { "${_chocolatey_server_app_pool_name}": | ||
iis::manage_app_pool { "${chocolatey_server_app_pool_name}": | ||
enable_32_bit => true, | ||
managed_runtime_version => 'v4.0', | ||
} -> | ||
iis::manage_site {'chocolatey.server': | ||
site_path => $_chocolatey_server_location, | ||
port => "${_chocolatey_server_app_port}", | ||
ip_address => '*', | ||
app_pool => "${_chocolatey_server_app_pool_name}", | ||
iis_site {'chocolatey.server': | ||
ensure => 'started', | ||
path => $server_install_location, | ||
port => $service_port, | ||
app_pool => $chocolatey_server_app_pool_name, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this really the only set of changes related to upgrading? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Upgrading modules, yes. |
||
} -> | ||
|
||
# lock down web directory | ||
acl { "${_chocolatey_server_location}": | ||
purge => true, | ||
acl { "${server_install_location}": | ||
purge => true, | ||
inherit_parent_permissions => false, | ||
permissions => [ | ||
{ identity => 'Administrators', rights => ['full'] }, | ||
{ identity => 'IIS_IUSRS', rights => ['read'] }, | ||
{ identity => 'IUSR', rights => ['read'] }, | ||
{ identity => "IIS APPPOOL\\${_chocolatey_server_app_pool_name}", rights => ['read'] } | ||
], | ||
{ identity => 'Administrators', rights => ['full'] }, | ||
{ identity => 'IIS_IUSRS', rights => ['read'] }, | ||
{ identity => 'IUSR', rights => ['read'] }, | ||
{ identity => "IIS APPPOOL\\${chocolatey_server_app_pool_name}", rights => ['read'] } | ||
], | ||
} -> | ||
acl { "${_chocolatey_server_location}/App_Data": | ||
|
||
acl { "${server_install_location}/App_Data": | ||
permissions => [ | ||
{ identity => "IIS APPPOOL\\${_chocolatey_server_app_pool_name}", rights => ['modify'] }, | ||
{ identity => 'IIS_IUSRS', rights => ['modify'] } | ||
], | ||
{ identity => "IIS APPPOOL\\${chocolatey_server_app_pool_name}", rights => ['modify'] }, | ||
{ identity => 'IIS_IUSRS', rights => ['modify'] } | ||
], | ||
} | ||
# technically you may only need IIS_IUSRS but I have not tested this yet. | ||
} |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We prefer the params pattern because it allows for hiera values. It's possible this will also allow that, but I'm unsure. And keep in mind this should also continue to work with v3.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because these are now parameterized, they will still be looked up via hiera.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will that still be compatible with both versions? Having the extra logic here doesn't hurt anything that I'm aware of, so I'm not ready to modernize until v3 EOLs completely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Automatic parameter lookup also works in v3.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well then there really isn't a reason to be doing params pattern then. Unless there is something I'm not thinking of offhand
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. AFAIK Puppet recommends not using params pattern going forward.