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

DSC meta configuration #574

Merged
merged 27 commits into from
Nov 8, 2024
Merged

DSC meta configuration #574

merged 27 commits into from
Nov 8, 2024

Conversation

anmenaga
Copy link
Collaborator

@anmenaga anmenaga commented Oct 16, 2024

PR Summary

Fix #282

This PR adds settings/policy JSON files support.
A particular dsc setting value (e.g. dsc resource search path) can be specified in any of the locations below.
Override order:

  1. policy file. Writable only by Admins, but readable by everyone:
  • on WIndows: $env:ProgramData+"\dsc\dsc.settings.json"
  • on Linux: "/etc/dsc/dsc.settings.json"
  1. command-line parameters. e.g. --trace-level or --trace-format
  2. main active settings file: dsc.settings.json in dsc executable directory
  3. default settings file: dsc_default.settings.json in dsc executable directory. Should not be modified by user and intended to be used in dsc upgrade scenarios as well as reset settings to defaults scenario. Top-level nodes in the file are versions of settings schema to support possible future breaking changes in settings schema.

Format and defaults for policy/settings currently look like this and described in detail in the spec:

{
  "resourcePath": {
    "allowEnvOverride": true,
    "appendEnvPath": true,
    "directories": []
  },
  "tracing": {
    "level": "WARN",
    "format": "Default",
    "allowOverride": true
  }
}

@anmenaga anmenaga marked this pull request as draft October 16, 2024 22:17
@anmenaga anmenaga requested a review from SteveL-MSFT October 18, 2024 18:34
@anmenaga anmenaga requested a review from tgauth October 18, 2024 18:34
@anmenaga anmenaga marked this pull request as ready for review October 18, 2024 18:34
build.ps1 Outdated Show resolved Hide resolved
dsc/src/util.rs Outdated Show resolved Hide resolved
dsc/src/util.rs Show resolved Hide resolved
dsc/src/util.rs Outdated Show resolved Hide resolved
dsc/src/util.rs Outdated Show resolved Hide resolved
dsc_lib/src/discovery/command_discovery.rs Outdated Show resolved Hide resolved
dsc_lib/src/util.rs Outdated Show resolved Hide resolved
dsc/tests/dsc_settings.tests.ps1 Outdated Show resolved Hide resolved
dsc/tests/dsc_settings.tests.ps1 Outdated Show resolved Hide resolved
dsc_lib/src/util.rs Show resolved Hide resolved
@anmenaga anmenaga force-pushed the issue_282 branch 2 times, most recently from 1d5d25b to e63e3c3 Compare October 24, 2024 17:34
@michaeltlombardi michaeltlombardi added the Schema-Impact Change requires updating a canonical schema for configs or manifests label Oct 30, 2024
@michaeltlombardi
Copy link
Collaborator

To clarify, the scope of this initial PR is just to get DSC working with the settings/policy files, correct? The CLI / resource for getting and defining the values will follow in a future PR?

@anmenaga
Copy link
Collaborator Author

To clarify, the scope of this initial PR is just to get DSC working with the settings/policy files, correct? The CLI / resource for getting and defining the values will follow in a future PR?

Yes and Yes.

build.ps1 Outdated Show resolved Hide resolved
build.ps1 Outdated Show resolved Hide resolved
build.ps1 Outdated Show resolved Hide resolved
dsc/src/util.rs Outdated Show resolved Hide resolved
dsc_lib/src/discovery/command_discovery.rs Show resolved Hide resolved
dsc_lib/src/util.rs Show resolved Hide resolved
dsc/src/util.rs Outdated Show resolved Hide resolved
Copy link
Member

@SteveL-MSFT SteveL-MSFT left a comment

Choose a reason for hiding this comment

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

LGTM

@SteveL-MSFT SteveL-MSFT added this pull request to the merge queue Nov 8, 2024
Merged via the queue into PowerShell:main with commit 2918d67 Nov 8, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Doc-Impact Schema-Impact Change requires updating a canonical schema for configs or manifests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DSC meta configuration
3 participants