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

Can not remove ServiceAutoStartProvider property with xWebApplication resource #225

Open
fredgate opened this issue Sep 6, 2016 · 3 comments
Labels
bug The issue is a bug. in progress The issue is being actively worked on by someone.

Comments

@fredgate
Copy link

fredgate commented Sep 6, 2016

With the xWebApplication resource, I can configure the auto start provider of the application :

xWebApplication WebApp
{
            Name = "Foo"
            Ensure = "Present"
            Website = "Default Web Site"
            WebAppPool = "Foo"
            PhysicalPath = "c:\inetpub\foo"
            ServiceAutoStartEnabled = $true
            ServiceAutoStartProvider = "FooAutoStart"
            ApplicationType = "Foo.AutoStart, Foo"
}

But after, I can not use this resource to remove the auto start provider of the the web application. If I use the following configuration, the autostart provider will be simply skipped :

xWebApplication WebApp
{
            Name = "Foo"
            Ensure = "Present"
            Website = "Default Web Site"
            WebAppPool = "Foo"
            PhysicalPath = "c:\inetpub\foo"
}

This can lead to a blocking position.
It seems normal to not configure a property (such as self auto start provider) if it is not specified in a DSC resource use. By cons it would be convenient to reset or remove a property value that has been previously configured. This could be achieved by example by setting a null value to the property, as below:

xWebApplication WebApp
{
            Name = "Foo"
            Ensure = "Present"
            Website = "Default Web Site"
            WebAppPool = "Foo"
            PhysicalPath = "c:\inetpub\foo"
            ServiceAutoStartEnabled = $false
            ServiceAutoStartProvider = $null
}

I started looking at how to do and it seems quite easily achievable.
The ideal and the more complicated could be to remove the application type if it is no longer used by any web application.

@kwirkykat kwirkykat added bug The issue is a bug. help wanted The issue is up for grabs for anyone in the community. labels Sep 7, 2016
@fredgate
Copy link
Author

fredgate commented Sep 7, 2016

I can start to work on this bug/feature.
Actually, the operation of the ServiceAutoStartEnabled is as follow :

  • if the property is not specified, nothing is done
  • if a value is specified, the property is added/updated

This seems correct but not sufficient. It would be necessary to remove the property : for that I suggest to allow null value. It is currently authorized by the DSC resource but produces an error.

@fredgate
Copy link
Author

fredgate commented Sep 8, 2016

I started to work on this issue.
It is not terminated, but I opened a pull request to get feedback and help.

@nzspambot
Copy link

@fredgate yeah that was on my todo list; let me look at your PR

@johlju johlju added in progress The issue is being actively worked on by someone. and removed help wanted The issue is up for grabs for anyone in the community. labels Apr 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug. in progress The issue is being actively worked on by someone.
Projects
None yet
Development

No branches or pull requests

4 participants