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

Enhancement/versioned config templates #7

Merged
merged 7 commits into from
Jan 15, 2025

Conversation

Salvoxia
Copy link
Contributor

blocky frequently changes the structure of its config file, deprecating older config structures and eventually invalidating them.
The config template this role has used produces several deprecation warnings on startup for upstream, blackLists and whiteLists which are replaced by upstreams, denylists and allowlists.

This PR adds versioned config templates for blocky. The role can now contain several different config templates. A configuration defines a min_version and/or max_version for each config template. The role dynamically detects the correct template to use depending on the value of blocky__version.
It is up to the role's maintainer to update that configuration whenever a new blocky version with configuration changes is released.

# Must be maintained as blocky evolves. min_version and max_version may be defined for the same template.
blocky__config_template_versions: [
  {'max_version': '0.23', 'template': 'config.yaml.up_to_0.23.j2'},
  {'min_version': '0.24', 'template': 'config.yaml.from_0.24.j2'},
]

This approach is able to easily manage changes in configuration structure as long as these changes do not affect the structure of role variables. Changes to role variable structures can be implemented with more complex jinja2 templating in the config template.

Molecule tests for different blocky versions ranging from v0.21 to v0.24 have been introduced as part of the matrix.
Note: Tests for rockylinux9 have ben temporarily disabled due to this issue.

@resmo
Copy link
Member

resmo commented Jan 15, 2025

looks solid, thanks for this contribution.

@resmo resmo merged commit dd92441 into ngine-io:main Jan 15, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants