Inventory location inconsistency #130
Labels
No labels
bugfix
cleanup
discussion
documentation
doing
done
feature
improvement
packaging
Stale
testing
TODO
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: ungleich-public/cdist#130
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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: matthijskooijman
I've been looking at the inventory feature, and was a bit surprised about a few things:
~/.cdist/inventory
, whereas everything else seems to default to the in-distribution location (e.gcdist/conf/manifest/init
). Is there any compelling for this reason?$HOME
is unset, but not when it is empty. This prevents switching to the other behaviour usingHOME= ./bin/cdist ...
, which isn't terribly convenient.$HOME
is unset) seems inconsistent: it iscdist/inventory
, where I would expectcdist/conf/inventory
, along with the rest of the config.Created by: matthijskooijman
A bit late, but: Thanks! Works like a charm for me :-)
Created by: darko-poljak
@matthijskooijman @telmich I think we can take in-distribution config file into account if it exists.
Created by: darko-poljak
@telmich Your thoughts?
Created by: matthijskooijman
That would work, except that:
Created by: darko-poljak
How about
ln -s <file inside repo> ~/.cdist.cfg
?Created by: matthijskooijman
Yeah, but none of these are inside my repository, so I can't make the repository self-contained (and it also won't work if I want to work with multiple self-contained repositories). Perhaps I'm thinking about this in the wrong way, but a in-distribution (default) config that is parsed would make sense, right?
Created by: darko-poljak
@matthijskooijman You can have user's configuration file (first one found of ~/.cdist.cfg, $XDG_CONFIG_HOME/cdist/cdist.cfg, in specified order) or
system-wide configuration file (/etc/cdist.cfg).
Created by: matthijskooijman
Yeah, that's also an option. I still need to pass a -g option explicitly. Would it make sense to automatically load a config file from the distribution, if it exists? e.g.
cdist/conf/cdist.conf
or something?Created by: darko-poljak
@matthijskooijman You can also use configuration file: https://www.nico.schottelius.org/software/cdist/man/latest/cdist-configuration.html
There is an option for inventory_dir. If you want a config file in git repo you can also have your home dir config file be link to the one in git repo.
Does this fit your needs?
Created by: matthijskooijman
Works, thanks.
As for the in-distribution location, let me explain my usecase. I'm using cdist to configure a number of similar machines. For this, I forked the cdist repo, as recommended, and put all the needed configuration in there. To make this repo a fully self-contained tool to easily configure and change all these machines, it should include a list of these machines, so any changes made can be easily pushed to all of them.
Currently, I should either:
Neither of which seem very elegant to me.
Also, I would think the inventory is more configuration (in
cdist/conf
) than code (which is the rest ofcdist
).However, having the inventory as something in addition to the configuration could also make sense. I find the current location (inside the python package) a bit weird, but thinking about it, I actually think the same applies to the
cdist/conf
directory...Created by: darko-poljak
@matthijskooijman Can you test the following commit, related to empty HOME env var?
2b5f1a0148
Created by: darko-poljak
@matthijskooijman Inventory location defaults to ~/.cdist/inventory because there is nothing related to inventory that comes with distribution, except implementation support. Also, in-distribution location cdist/inventory is used instead of cdist/conf/inventory because inventory is not tight coupled with manifests and types that are used for configuring hosts, and this is what is held in conf directory.
The HOME env var empty case will be fixed.