Proposal: Configuration as resource
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 38/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Necesita aclaración
- Estado de actividad
- Tranquilo
- Stack tecnológico
- yaml
- Área
- infrastructure
Línea de trabajo
El issue no nombra archivos ni pruebas. Empieza revisando el descubrimiento de recursos de documentos de configuración y la propuesta relacionada #611; después, sigue el trabajo existente de dsc config resolve. Para darlo por terminado, haría falta un diseño acordado para los documentos reutilizables, el manejo de parámetros, el descubrimiento y el versionado, y la expansión de recursos.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary of the new feature / enhancement
As an infrastructure engineer,
I want to define a reusable configuration document that my coworkers can specify like a resource in their configuration documents,
So that we can provide an abstraction over a subset of configuration for readability, composability, and maintainability.
This feature would enable similar functionality for DSC as Puppet defined types, enabling users to define reusable "resources" in the form of a configuration document. This would let a user combine several related resource instances into a single definition that can be parameterized and used in different contexts.
In configuration management, users often find themselves reusing a few low-level resources repeatedly for different subsets of configuration. For example, ensuring a specific version of a package is installed, setting the service for that package, and providing some optional configuration overrides for it.
Proposed technical implementation details (optional)
We could extend the definition for a configuration document to indicate that the document is meant to be reusable as a resource. When a configuration document is used as a resource, it's subject to the normal semantics for discovery, versioning, and so on.
The following snippet shows an example of a hypothetical configuration document as a resource. The field names are placeholders for clarity.
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
manifest:
type: TailspinToys/Service
description: Installs and configures the TSToy service on Windows machines.
version: 1.2.3
author: TailspinToys
tags:
- tstoy
- Windows
parameters:
version:
description: Specifies the version of TSToy to ensure is installed.
type: string
defaultValue: "1.2.3"
packageSource:
description: Specifies the source from which to install the TSToy package.
type: string
defaultValue: winget
updateAutomatically:
description: Indicates whether TSToy should check for updates when it starts.
type: bool
defaultValue: true
updateFrequency:
description: Specifies how often TSToy should check for updates.
type: string
allowedValues:
- daily
- weekly
- monthly
defaultValue: daily
directive:
resourceDiscovery: duringDeployment
variables:
frequency:
daily: 1
weekly: 7
monthly: 30
resources:
- name: Install TSToy
type: Microsoft.WinGet/Package
properties:
version: "[parameters('version')]"
id: tstoy
source: "[parameters('packageSource')]"
- name: TSToy machine settings
type: TailspinToys.Service/Settings
properties:
scope: machine
updateAutomatically: "[parameters('updateAutomatically')]"
updateFrequency: >-
[tryGet(
variables('frequency'),
parameters('updateFrequency')
)]
dependsOn:
- "[resourceId('Microsoft.WinGet/Package','Install TSToy')]"
- name: Enable TSToy service
type: Microsoft.Windows/Service
properties:
name: tstoy
state: running
startMode: automatic
dependsOn:
- "[resourceId('TailspinToys.Service/Settings','TSToy machine settings')]"
In this example, the configuration-document-as-resource metadata is placed under the manifest field. Minimally, users need to give the document a fully qualified type name and version.
While this example is a little contrived, this resource uses a mix of built-in resources (Microsoft.Windows/Service), other public resources (Microsoft.WinGet/Package), and a package published by the same author (TailspinToys.Service/Settings, which is "actually" installed as part of the package). It shows how you can take a relatively complex set of resources to surface a neater resource surface for end users. The alternative option for people would be to develop a resource that handles all of these components together, but that's more fragile and many users won't want to fully author a resource to compose configuration at this relatively low level.
The following snippet shows an instance of this configuration-document resource in an actual configuration:
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
resources:
- name: Setup TSToy
type: TailspinToys/Service
properties:
updateAutomatically: true
updateFrequency: weekly
Considerations
- We can't perfectly replicate a resource instance schema from the parameter definitions - might be useful to support a
schemafield that applies to the parameters (either in themanifestfield or per-parameter) to clarify validation requirements. In the example above, theversionproperty is just a string that defaults to1.0.0. More correctly it should be a semantic version, but that isn't representable in the current data model. - Unless we add a field to enumerate operations, we have to infer available operations by inspecting the resources defined in the configuration.
- There are further potential complications, especially around using adapted resources, but I think they are resolvable.
- Enabling resources to be developed this way raises the importance of a
dsc config resolvecommand that "expands" the node graph to show the full set of resources that will be applied. - This proposal in some ways mirrors #611, though it's more limited - extendable resources enables you to do relatively complex processing and then hand off all or some of the actual system-modifying logic to another resource. In this model, you're limited to what you can express in a configuration document. I think this proposal still covers numerous use cases.
- Lenguaje dominante
- Rust
- Estrellas
- 536
- Forks
- 76
- Merge medio
- 1 d 11 h
- PR fusionados (30 d)
- 15
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de PowerShell/DSC
-
Issue-Enhancement Needs Triage
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
PowerShell/DSC#1750 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
Issue-Bug Need-Review
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
PowerShell/DSC#1749 ·
Los mantenedores suelen responder en 1 día
-
Issue-Bug Need-Review
Dificultad 3/5 1-2 días Aptitud para principiantes 40/100
PowerShell/DSC#1748 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
"apt install dsc" will install the preview release instead of stablePosiblemente ocupada @SteveL-MSFT la tomó hace 2 días. AbiertoIssue-Bug Need-Review
PowerShell/DSC#1746 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Issue-Enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
PowerShell/DSC#1737 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de PowerShell/DSC
Issues similares
-
Progress difficulty filter lists Hard before MediumPosiblemente ocupada @Pandamachi la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
sysprog21/codetrial#281 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
C-bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
rust-lang/rust-analyzer#23501 ·
Los mantenedores suelen responder en 1 día
-
Streamable HTTP client: a 401 or 403 with a JSON-RPC error body and no WWW-Authenticate loses its HTTP statusPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertobug P2 ready for work T-security T-transport
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
modelcontextprotocol/rust-sdk#1339 ·
Los mantenedores suelen responder en 3 días
-
scripts/gen-gallery.py:118: a ready session now reports in_progress, so SESSION_READY_OLD can goAbiertonightly-audit
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
antithesishq/snouty#396 ·
Los mantenedores suelen responder en 1 día
-
French BIP39 wordlist starts with a UTF-8 BOM, so generated French mnemonics carry U+FEFF and derive a non-canonical seedPosiblemente ocupada @Kshot3000 la tomó hoy. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 91/100
ergoplatform/sigma-rust#976 ·
Los mantenedores suelen responder en 1 día