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

ADDomainController: Ensure Property should be renamed or reimplemented #647

Open
michaeltlombardi opened this issue Feb 12, 2021 · 5 comments
Labels
breaking change When used on an issue, the issue has been determined to be a breaking change. enhancement The issue is an enhancement request. help wanted The issue is up for grabs for anyone in the community.

Comments

@michaeltlombardi
Copy link

Details of the scenario you tried and the problem that is occurring

The schema for the ADDomainController Resource includes the Ensure property as a read-only string:

[Read, Description("Returns the state of the Domain Controller.")] String Ensure;

This is counter to the expectation and idiomatic implementation of the Ensure property across DSC Resources, which is taken to be the enforceable state of a Resource.

Furthermore, the actual implementation of Get-TargetResource for ADDomainController returns $true or $false for Ensure, which is also non-idiomatic (I would expect Present or Absent):

Suggested solution to the issue

I suggest either renaming the read-only Ensure property to something like IsPromoted (with a Boolean type) or reworking the Resource entirely such that it becomes an ensurable resource and the Ensure property is idiomatic.

Version of the DSC module that was used

  • Latest code on main
@gaelcolas gaelcolas added the breaking change When used on an issue, the issue has been determined to be a breaking change. label Feb 12, 2021
@gaelcolas
Copy link
Member

gaelcolas commented Feb 12, 2021

Agreed on all accounts.
Given when this resource was originally written, I guess the reason it's still this way is to minimize breaking changes and the lack of time to refactor.

That said, you're right and I'll let the maintainers of @dsccommunity/activedirectorydsc to comment on feasibility and preferred approach.

@johlju
Copy link
Member

johlju commented Feb 12, 2021

Yes it should use Ensure property as any other DSC resource, meaning using the two values Present and Absent. If I recall correctly the current implementation was a workaround to fix a bug and not make a breaking change.

This issue is related to issue #251 which suggest that the ADDomainController should be able to demote a domain controller.

@johlju johlju added enhancement The issue is an enhancement request. help wanted The issue is up for grabs for anyone in the community. labels Feb 12, 2021
@johlju
Copy link
Member

johlju commented Feb 12, 2021

We are happy to review a PR that implements this breaking change, preferably that also fixes issue #251. 🙂

@michaeltlombardi
Copy link
Author

We are happy to review a PR that implements this breaking change, preferably that also fixes issue #251. 🙂

I probably can't commit to implementing the PR myself (I'm hip-deep in the Puppet-DSC integration work myself, we found this via a customer raising a bug) at this time, unfortunately.

@johlju
Copy link
Member

johlju commented Feb 12, 2021

No worries @michaeltlombardi. Hopefully someone in the community can pick this up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change When used on an issue, the issue has been determined to be a breaking change. enhancement The issue is an enhancement request. help wanted The issue is up for grabs for anyone in the community.
Projects
None yet
Development

No branches or pull requests

3 participants