configuration
This module provides functions for configuration management tasks includingtemplating, validation, and deployment of configuration artifacts. It integrates
with dependencies, git, and templating modules to enable automated configuration
workflows within Dagger pipelines.
Installation
dagger install github.com/stuttgart-things/blueprints/configuration@v2.7.1Entrypoint
Return Type
Configuration Example
dagger -m github.com/stuttgart-things/blueprints/configuration@651a473107e4d7b7e73bcc8511fbdc5f667e79b8 call \
func (m *MyModule) Example() *dagger.Configuration {
return dag.
Configuration()
}@function
def example() -> dagger.Configuration:
return (
dag.configuration()
)@func()
example(): Configuration {
return dag
.configuration()
}Types
Configuration 🔗
analyzeConfigString() 🔗
AnalyzeConfigString parses a key=value configuration string and validates mandatory keys Dagger-compatible wrapper that returns JSON string representation of the map
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| configString | String ! | - | No description provided |
| mandatoryKeys | String ! | - | Comma-separated list of mandatory keys (e.g., “name,template,disk”) |
Example
dagger -m github.com/stuttgart-things/blueprints/configuration@651a473107e4d7b7e73bcc8511fbdc5f667e79b8 call \
analyze-config-string --config-string string --mandatory-keys stringfunc (m *MyModule) Example(ctx context.Context, configString string, mandatoryKeys string) string {
return dag.
Configuration().
Analyzeconfigstring(ctx, configString, mandatoryKeys)
}@function
async def example(configstring: str, mandatorykeys: str) -> str:
return await (
dag.configuration()
.analyzeconfigstring(configstring, mandatorykeys)
)@func()
async example(configString: string, mandatoryKeys: string): Promise<string> {
return dag
.configuration()
.analyzeConfigString(configString, mandatoryKeys)
}createAnsibleRequirementFiles() 🔗
Return Type
Directory !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| src | Directory | - | No description provided |
| templatePaths | String | "https://raw.githubusercontent.com/stuttgart-things/ansible/refs/heads/main/templates/requirements.yaml.tmpl" | No description provided |
| dataFile | String | "https://raw.githubusercontent.com/stuttgart-things/ansible/refs/heads/main/templates/requirements-data.yaml" | Path to YAML or JSON file containing template data (supports HTTPS URLs) |
| strictMode | Boolean | false | No description provided |
| cacheBuster | String | "" | Any value that changes between runs – a timestamp, a CI run id. Forces a fresh render instead of a cached one. This is NOT the usual “+optional and then discarded” cache buster. Dagger memoises RenderFromFile on its arguments, and when template and data are remote those arguments are two URL STRINGS that never change; nothing can tell Dagger the content behind the URL moved. Discarding the value here would bust only THIS function and leave the inner call answering from its own cache. So the value is written into a marker file inside The obvious approach – appending ?cacheBuster= to the URLs – does not
work: RenderFromFile derives the data format from the string’s suffix and
rejects RESIDUAL: this defeats Dagger’s cache, not GitHub’s. raw.githubusercontent serves a pushed change for a few minutes before it propagates, so a render seconds after a merge can still be stale. That window is bounded and self-healing; the Dagger one was neither. Left empty nothing is added and the behaviour is exactly as before. |
Example
dagger -m github.com/stuttgart-things/blueprints/configuration@651a473107e4d7b7e73bcc8511fbdc5f667e79b8 call \
create-ansible-requirement-filesfunc (m *MyModule) Example() *dagger.Directory {
return dag.
Configuration().
Createansiblerequirementfiles()
}@function
def example() -> dagger.Directory:
return (
dag.configuration()
.createansiblerequirementfiles()
)@func()
example(): Directory {
return dag
.configuration()
.createAnsibleRequirementFiles()
}getVmSize() 🔗
GetVmSize returns a formatted string for VM configuration based on t-shirt size.
This is a Dagger function that can be called via dagger call get-vm-size.
Example:
dagger call get-vm-size --config-file=vm_tshirt_sizes.yaml --size=small
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| configFile | File ! | - | YAML file containing VM t-shirt sizes |
| size | String ! | - | T-shirt size: small, medium, large, or xlarge |
Example
dagger -m github.com/stuttgart-things/blueprints/configuration@651a473107e4d7b7e73bcc8511fbdc5f667e79b8 call \
get-vm-size --config-file file:path --size stringfunc (m *MyModule) Example(ctx context.Context, configFile *dagger.File, size string) string {
return dag.
Configuration().
Getvmsize(ctx, configFile, size)
}@function
async def example(configfile: dagger.File, size: str) -> str:
return await (
dag.configuration()
.getvmsize(configfile, size)
)@func()
async example(configFile: File, size: string): Promise<string> {
return dag
.configuration()
.getVmSize(configFile, size)
}renderFluxKustomization() 🔗
Return Type
Directory !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| src | Directory | - | No description provided |
| ociSource | String | - | OCI source path (e.g., oci://ghcr.io/stuttgart-things/kcl-flux-instance) |
| configParameters | String | - | KCL parameters as comma-separated key=value pairs |
| entrypoint | String | "main.k" | Entry point file name |
| fileName | String | "kustomization" | Output file name for rendered Kustomization |
| fileExtension | String | "yaml" | Output file name for rendered Kustomization |
| repository | String | - | Repository in format “owner/repo” |
| baseBranch | String | "main" | No description provided |
| branchName | String | - | Name of the new branch to create |
| destinationPath | String | "flux/" | Destination path within the repository (e.g., “flux/” or “clusters/prod/”) |
| createBranch | Boolean | "false" | No description provided |
| commitChanges | Boolean | "false" | No description provided |
| applyToCluster | Boolean | "false" | No description provided |
| kubeConfig | Secret | - | Kubeconfig secret for authentication |
| namespace | String | "flux-system" | Namespace for the operation |
| token | Secret | - | GitHub token for authentication |
Example
dagger -m github.com/stuttgart-things/blueprints/configuration@651a473107e4d7b7e73bcc8511fbdc5f667e79b8 call \
render-flux-kustomizationfunc (m *MyModule) Example() *dagger.Directory {
return dag.
Configuration().
Renderfluxkustomization()
}@function
def example() -> dagger.Directory:
return (
dag.configuration()
.renderfluxkustomization()
)@func()
example(): Directory {
return dag
.configuration()
.renderFluxKustomization()
}renderMetadata() 🔗
RenderMetadata renders a README template with variables from multiple YAML files Multiple variables files are merged before rendering (comma-separated) Example usage:
dagger call render-readme \
--src ./tests/configuration \
--template-path README.md.tmpl \
--data-files vm-ansible.yaml,additional-vars.yaml
Return Type
Directory !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| src | Directory | - | Source directory containing template and variables files |
| configParameters | String | - | Configuration parameters as key=value pairs (comma-separated) |
| templatePath | String | "README.md.tmpl" | Path to template file |
| dataFiles | String | "data.yaml" | Path(s) to YAML or JSON file(s) containing template data Multiple files can be comma-separated and will be merged in order |
| strictMode | Boolean | false | No description provided |
Example
dagger -m github.com/stuttgart-things/blueprints/configuration@651a473107e4d7b7e73bcc8511fbdc5f667e79b8 call \
render-metadatafunc (m *MyModule) Example() *dagger.Directory {
return dag.
Configuration().
Rendermetadata()
}@function
def example() -> dagger.Directory:
return (
dag.configuration()
.rendermetadata()
)@func()
example(): Directory {
return dag
.configuration()
.renderMetadata()
}vsphereVm() 🔗
Return Type
Directory !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| src | Directory ! | - | No description provided |
| configParameters | String | - | No description provided |
| variablesFile | String | - | No description provided |
| templatePaths | String | "https://raw.githubusercontent.com/stuttgart-things/vsphere-vm/refs/heads/main/templates/vm.tf.tmpl,https://raw.githubusercontent.com/stuttgart-things/vsphere-vm/refs/heads/main/templates/README.md.tmpl" | No description provided |
| repository | String | - | Repository in format “owner/repo” |
| branchName | String | - | Name of the new branch to create |
| baseBranch | String | "main" | Base ref/branch to create from (e.g., “main”, “develop”) |
| token | Secret | - | GitHub token for authentication |
| createBranch | Boolean | "false" | No description provided |
| renderAnsibleRequirements | Boolean | "true" | No description provided |
| ansibleRequirementsTemplate | String | "https://raw.githubusercontent.com/stuttgart-things/ansible/refs/heads/main/templates/requirements.yaml.tmpl" | No description provided |
| ansibleRequirementsData | String | "https://raw.githubusercontent.com/stuttgart-things/ansible/refs/heads/main/templates/requirements-data.yaml" | No description provided |
| ansibleRequirementsCacheBuster | String | "" | Any value that changes between runs. Forces a fresh fetch of the remote ansible requirements instead of a cached render. It matters more here than in a throwaway execution: the rendered file is COMMITTED to the generated branch, so a stale render does not just affect one run – it lands in the repository and every consumer of that branch inherits it. |
| renderExecutionfile | Boolean | "true" | No description provided |
| executionfileData | String | "https://raw.githubusercontent.com/stuttgart-things/blueprints/refs/heads/main/tests/vm/execution-vars.yaml" | No description provided |
| executionfileTemplate | String | "https://raw.githubusercontent.com/stuttgart-things/blueprints/refs/heads/main/tests/vm/execution.yaml.tmpl" | No description provided |
| commitConfig | Boolean | "false" | No description provided |
| createPullRequest | Boolean | "false" | No description provided |
| commitMessage | String | "" | No description provided |
| destinationFolder | String | "" | No description provided |
| destinationBasePath | String | "./" | No description provided |
| authorName | String | "" | No description provided |
| authorEmail | String | "" | No description provided |
| pullRequestTitle | String | "" | No description provided |
| pullRequestBody | String | "" | No description provided |
Example
dagger -m github.com/stuttgart-things/blueprints/configuration@651a473107e4d7b7e73bcc8511fbdc5f667e79b8 call \
vsphere-vm --src DIR_PATHfunc (m *MyModule) Example(src *dagger.Directory) *dagger.Directory {
return dag.
Configuration().
Vspherevm(src)
}@function
def example(src: dagger.Directory) -> dagger.Directory:
return (
dag.configuration()
.vspherevm(src)
)@func()
example(src: Directory): Directory {
return dag
.configuration()
.vsphereVm(src)
}