Support for sub-types #106
Labels
No Label
bugfix
cleanup
discussion
documentation
doing
done
feature
improvement
packaging
Stale
testing
TODO
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: ungleich-public/cdist#106
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Created by: sideeffect42
When writing cdist types I very often have the problem that I would need multiple possible "entry-points" in a single type.
What's the situation?
Say I want to implement a type to install and configure an Apache web server.
There are multiple pieces needed to configure Apache.
(For ease of getting my point across I'm assuming a Debian-based system here.)
What's the solution (now)?
As it is now, I would need to create at least 4 different types (for each of the steps described above), like
__apache2_install
,__apache2_mod
,__apache2_vhost
,__apache2_conf
And what exactly is the problem now?
Creating four types makes the types very hard to distribute. Of course I could try to get all of these types upstream, but that doesn't work for all of the million of possible types.
I used to put each type in a separate Git repository and then submodule those into the
type/
folder of my~/.cdist
repository.What I envisage as a better solution
It would be great if the type lookup of cdist could be extended to look two levels deep, so that I could bundle up all of the four types into one Git repository.
Resulting in a directory structure similar to this:
mentioned in issue #854
mentioned in issue #804
closed
Created by: sideeffect42
@darko-poljak: Thanks for the hint. I missed that option.
Using CDIST_PATH should work, but it requires me to manually set the environment variable manually each time I want to run cdist (or write a script for it).
Would it be possible to have cdist to automatically "prepopulate" (read: concat with the passed environment variable) the CDIST_PATH using something like
find $CDIST_REPO/packages -type d -maxdepth 1
?This way there would be a convenient method to install bundles/packages/modules of types.
Created by: darko-poljak
@sideeffect42 Would CDIST_PATH (https://www.nico.schottelius.org/software/cdist/man/latest/cdist-reference.html#environment-variables-for-writing) help? You can have separate type repos and all used by cdist by defining CDIST_PATH.