Skip to content
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

(GH-8)(GH-9)(GH10) added additional parameters, update docs #6

Conversation

ripclawffb
Copy link

@ripclawffb ripclawffb commented Sep 27, 2016

include support for previous module implementations
added ability to not disable the default website
added ability to change packages folder

Closes #8, #9, #10

@ripclawffb ripclawffb changed the title added additional parameters, update docs added additional parameters, use dsc for website and features, update docs Sep 27, 2016
Copy link
Contributor

@ferventcoder ferventcoder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! However I have some questions regarding the switch to DSC - which is typically done when there is a feature necessary that you don't find in the native Puppet resource option. I'm not seeing it here so please elaborate more on why the switch.

README.md Outdated
website. Defaults to 'C:\inetpub\wwwroot'.

##### `packages_folder`
An alternate folder can be defined for the .nupkg files.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should already be possible - see server_package_source (that's what it is for, you can set it to c:\packages).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't see my previous comment for some reason. From my understanding, server_package_source only specifies where the chocolatey.server nuget package can be found. This setting allows you to change the path of where the nuget packages are served from instead of the default C:\tools\chocolatey.server\App_Data\Packages.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair statement! I didn't realize that this is what set this.

##### `packages_folder_permissions`
Set permissions on packages folder. Defaults to:
* IIS APPOOL\${chocolatey_server_app_pool_name} - modify
* IIS_IUSRS - modify
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, how is this actually passed? Would prefer an example of this one in the readme.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I can update the readme with examples to make it more clear.. This is passed as an array of permissions as a parameter, similar to how you set the permissions for the chocolatey.server folder.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added an example that shows how to pass an array of permissions to the readme. Let me know if more clarity is needed.

The default website is stopped to prevent conflicts with the
chocolatey server website. An alternate port can be defined and
this option can be set to disabled so it doesn't modify the default
website. Defaults to 'true'.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this.

README.md Outdated

##### `default_website_path`
The default website path is needed in order to modify the default
website. Defaults to 'C:\inetpub\wwwroot'.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this is necessary with WindowsFeatures module - I'm hesitant to convert to Puppet+DSC as the native option is there. I will explain why native option is better in my review comments at the end.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the dsc dependency as requested.

README.md Outdated
@@ -104,6 +114,32 @@ Host your own Chocolatey package repository

#### Parameters

##### `chocolatey_server_app_pool_name`
Set apppool name used by the chocolatey.server website. Defaults to
'chocolatey.server'.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

metadata.json Outdated
"name": "puppetlabs/dsc",
"version_requirement": ">= 0.8.0 < 2.0.0"
},
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a fan of adding a dependency unless necessary.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed as requested. :)

dsc_xwebapppool { "${_chocolatey_server_app_pool_name}":
dsc_ensure => present,
dsc_name => "${_chocolatey_server_app_pool_name}",
dsc_enable32bitapponwin64 => false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was set to true previously, why the switch?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this again, and it looks like it does work as-is, so I removed the change for disabling the 32-bit app_pool mode.

@ferventcoder
Copy link
Contributor

Whenever there is a native Puppet resource and a Puppet+DSC resource option, it is typically better to prefer the native resource as it handles "in sync" better and is closer to the metal (not a lot of abstractions to go through means less places to look when things are not working).

The "in sync" issue is typically due to many DSC resources ignoring one of the three options (Get/Set/Test, I can not remember offhand which it is currently, it's either Get or Test, I think it is Get) and that causes conflicts when determining if a resource is already set appropriately. We worked hard to work around this limitation with puppetlabs-dsc, but it sometimes requires more time to make that determination.

Another reason to prefer the native resource is typically the Puppet resource can be ensurable, which because of the "in sync" issue is not something that can be done with Puppet+DSC.

Another good reason to prefer the native resource option is better output in what is changing (the diffs you see when Puppet corrects), again due to the same issue of "in sync".

So unless there is an option available in the DSC resource that is not available in the Puppet native option, it is best to prefer the Puppet resource.

Perhaps you can help me understand why your preference is for the DSC resources here?

Copy link
Author

@ripclawffb ripclawffb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Internally, we're starting to use DSC more since over time, more items are available to be managed. I figured this would lead to less dependencies in the long run. However, if you're still inclined to use native types, I can modify my changes and remove the dsc types. Thanks for the feedback.

@ferventcoder
Copy link
Contributor

Hopefully over time those DSC resources will have better implemented the ability to check the values they have to meet the insync and ensurable requirements that Puppet needs. Unfortunately it was not a focus for folks and guidance from Microsoft was not to worry about it when building DSC resources. I think they've started to change that stance more now though and that is a good thing for everyone 👍

For now though, it would probably be best to stick with the native resources, since they are approved modules - this module is neither approved nor supported, which means you are likely open to using approved modules (or at least this one! Ha :D ).

README.md Outdated
##### `chocolatey_server_app_pool_name`
Set apppool name used by the chocolatey.server website. Defaults to
'chocolatey.server'.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it is, as someone else submitted a merge request previously that used the windows feature module and it didn't look like they needed to supply the default website path.

##### `packages_folder_permissions`
Set permissions on packages folder. Defaults to:
* IIS APPOOL\${chocolatey_server_app_pool_name} - modify
* IIS_IUSRS - modify
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I can update the readme with examples to make it more clear.. This is passed as an array of permissions as a parameter, similar to how you set the permissions for the chocolatey.server folder.

this option can be set to disabled so it doesn't modify the default
website. Defaults to 'true'.

##### `packages_folder`
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I read the code correctly, the server_package_source is the location where only the chocolatey.server nuget package can be found. This setting allows you to remap the c:\tools\chocolatey.server\app_data\packages folder to another location where the actual nuget packages being served are stored. For instance, we store all of our nuget packages in c:\packages. Hope that makes sense.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes more sense.

Copy link
Author

@ripclawffb ripclawffb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made the requested changes, updated dependencies and docs.

README.md Outdated

##### `default_website_path`
The default website path is needed in order to modify the default
website. Defaults to 'C:\inetpub\wwwroot'.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the dsc dependency as requested.

##### `packages_folder_permissions`
Set permissions on packages folder. Defaults to:
* IIS APPOOL\${chocolatey_server_app_pool_name} - modify
* IIS_IUSRS - modify
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added an example that shows how to pass an array of permissions to the readme. Let me know if more clarity is needed.

README.md Outdated
website. Defaults to 'C:\inetpub\wwwroot'.

##### `packages_folder`
An alternate folder can be defined for the .nupkg files.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't see my previous comment for some reason. From my understanding, server_package_source only specifies where the chocolatey.server nuget package can be found. This setting allows you to change the path of where the nuget packages are served from instead of the default C:\tools\chocolatey.server\App_Data\Packages.

dsc_xwebapppool { "${_chocolatey_server_app_pool_name}":
dsc_ensure => present,
dsc_name => "${_chocolatey_server_app_pool_name}",
dsc_enable32bitapponwin64 => false,
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this again, and it looks like it does work as-is, so I removed the change for disabling the 32-bit app_pool mode.

metadata.json Outdated
"name": "puppetlabs/dsc",
"version_requirement": ">= 0.8.0 < 2.0.0"
},
{
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed as requested. :)

nuget packages are actually stored that will be served by the chocolatey server.

Note: This is different from 'server_package_source' as that defines where
the chocolatey.server package is located.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@ripclawffb ripclawffb changed the title added additional parameters, use dsc for website and features, update docs added additional parameters, update docs Oct 5, 2016
@ripclawffb
Copy link
Author

Requested changes completed.

@ripclawffb ripclawffb force-pushed the default_website_option branch 4 times, most recently from f039073 to 7b68d10 Compare October 11, 2016 23:04
@ferventcoder
Copy link
Contributor

ferventcoder commented Oct 12, 2016

Please do not use merge. Always rebase. Also check your username/email for commits. Looks like you have possibly flipped to a different user somewhere.

@ripclawffb ripclawffb force-pushed the default_website_option branch 2 times, most recently from e5cb3a9 to b08bcd1 Compare October 12, 2016 19:40
@ferventcoder
Copy link
Contributor

That definitely looks better. 👍

{ identity => 'IUSR',
rights => ['read'] },
{ identity => "IIS APPPOOL\\${_chocolatey_server_app_pool_name}",
rights => ['read'] }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lint hates the way I had it, so thanks for that. I'm much more a fan of it getting it so that lint ignores these lines (not a fan of dropping lines here as it makes it harder to read each permission). No worries though.

@ferventcoder ferventcoder changed the title added additional parameters, update docs (GH-8)(GH-9)(GH10) added additional parameters, update docs Oct 14, 2016
ensure => absent,
site_path => 'any',
app_pool => 'DefaultAppPool',
require => Windowsfeature['Web-WebServer'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me during final pull in - looks like this line was lost.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also note that if you just include chocolatey_server it will disable instead of delete the default website. 👍

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's on purpose. Is that ok? I think it's better to disable the website than to delete it.

'allowOverrideExistingPackageOnPush' => $allow_package_override,
'apiKey' => $apikey,
'requireApiKey' => $require_apikey,
}),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just realized this was EPP and not ERB. It requires future parser in 3.5+ or Puppet v4+. I'm not against using EPP, but hoping to allow this to use erb instead for a bit further compatibility. Is there any disadvantage to using ERB?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I can try to rework it into an ERB template. I'll let you know when complete.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have converted the EPP template to an ERB template as requested.

ripclawffb and others added 4 commits April 21, 2018 23:22
Add additional parameters to modify the chocolatey repository package
folder and set custom permissions. Update readme.
Change default behavior to stop default website instead of deleting
it. Update readme.
Add parameters to allow modification of the default chocolatey server
config such as the API key and the ability to overwrite existing
packages. Update readme
Update dependencies for resources. Upgrade windowsfeature module version.
@ripclawffb ripclawffb force-pushed the default_website_option branch 3 times, most recently from c7e103a to 27fda2b Compare April 23, 2018 03:21
@ripclawffb
Copy link
Author

@ferventcoder I went ahead and rebased against latest master and tested the changes. Everything seems to be working as expected. Can you please review and merge?

@ripclawffb ripclawffb closed this Nov 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for default website
2 participants