Dagger
Search

configuration

This module provides functions for configuration management tasks including
templating, 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.1

Entrypoint

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
NameTypeDefault ValueDescription
configStringString !-No description provided
mandatoryKeysString !-

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 string
func (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
NameTypeDefault ValueDescription
srcDirectory -No description provided
templatePathsString "https://raw.githubusercontent.com/stuttgart-things/ansible/refs/heads/main/templates/requirements.yaml.tmpl"No description provided
dataFileString "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)

strictModeBoolean falseNo description provided
cacheBusterString ""

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 src, which IS an argument of the inner call. A different value means a different directory digest means a genuine re-render. The file is never read: with remote template and data RenderFromFile does not touch src at all, and with local ones it addresses templates by explicit path, so a dot-file alongside them is inert.

The obvious approach – appending ?cacheBuster= to the URLs – does not work: RenderFromFile derives the data format from the string’s suffix and rejects .yaml?cacheBuster=... as an unsupported format.

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-files
func (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
NameTypeDefault ValueDescription
configFileFile !-

YAML file containing VM t-shirt sizes

sizeString !-

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 string
func (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
NameTypeDefault ValueDescription
srcDirectory -No description provided
ociSourceString -

OCI source path (e.g., oci://ghcr.io/stuttgart-things/kcl-flux-instance)

configParametersString -

KCL parameters as comma-separated key=value pairs

entrypointString "main.k"

Entry point file name

fileNameString "kustomization"

Output file name for rendered Kustomization

fileExtensionString "yaml"

Output file name for rendered Kustomization

repositoryString -

Repository in format “owner/repo”

baseBranchString "main"No description provided
branchNameString -

Name of the new branch to create

destinationPathString "flux/"

Destination path within the repository (e.g., “flux/” or “clusters/prod/”)

createBranchBoolean "false"No description provided
commitChangesBoolean "false"No description provided
applyToClusterBoolean "false"No description provided
kubeConfigSecret -

Kubeconfig secret for authentication

namespaceString "flux-system"

Namespace for the operation

tokenSecret -

GitHub token for authentication

Example
dagger -m github.com/stuttgart-things/blueprints/configuration@651a473107e4d7b7e73bcc8511fbdc5f667e79b8 call \
 render-flux-kustomization
func (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
NameTypeDefault ValueDescription
srcDirectory -

Source directory containing template and variables files

configParametersString -

Configuration parameters as key=value pairs (comma-separated)

templatePathString "README.md.tmpl"

Path to template file

dataFilesString "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

strictModeBoolean falseNo description provided
Example
dagger -m github.com/stuttgart-things/blueprints/configuration@651a473107e4d7b7e73bcc8511fbdc5f667e79b8 call \
 render-metadata
func (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
NameTypeDefault ValueDescription
srcDirectory !-No description provided
configParametersString -No description provided
variablesFileString -No description provided
templatePathsString "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
repositoryString -

Repository in format “owner/repo”

branchNameString -

Name of the new branch to create

baseBranchString "main"

Base ref/branch to create from (e.g., “main”, “develop”)

tokenSecret -

GitHub token for authentication

createBranchBoolean "false"No description provided
renderAnsibleRequirementsBoolean "true"No description provided
ansibleRequirementsTemplateString "https://raw.githubusercontent.com/stuttgart-things/ansible/refs/heads/main/templates/requirements.yaml.tmpl"No description provided
ansibleRequirementsDataString "https://raw.githubusercontent.com/stuttgart-things/ansible/refs/heads/main/templates/requirements-data.yaml"No description provided
ansibleRequirementsCacheBusterString ""

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.

renderExecutionfileBoolean "true"No description provided
executionfileDataString "https://raw.githubusercontent.com/stuttgart-things/blueprints/refs/heads/main/tests/vm/execution-vars.yaml"No description provided
executionfileTemplateString "https://raw.githubusercontent.com/stuttgart-things/blueprints/refs/heads/main/tests/vm/execution.yaml.tmpl"No description provided
commitConfigBoolean "false"No description provided
createPullRequestBoolean "false"No description provided
commitMessageString ""No description provided
destinationFolderString ""No description provided
destinationBasePathString "./"No description provided
authorNameString ""No description provided
authorEmailString ""No description provided
pullRequestTitleString ""No description provided
pullRequestBodyString ""No description provided
Example
dagger -m github.com/stuttgart-things/blueprints/configuration@651a473107e4d7b7e73bcc8511fbdc5f667e79b8 call \
 vsphere-vm --src DIR_PATH
func (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)
}