Introduce $CLUSTERSHELL_CFGDIR by kcgthb · Pull Request #483 · clustershell/clustershell · GitHub
Skip to content

Introduce $CLUSTERSHELL_CFGDIR #483

Merged
thiell merged 1 commit into
clustershell:masterfrom
kcgthb:conf_dir
Aug 8, 2022
Merged

Introduce $CLUSTERSHELL_CFGDIR #483
thiell merged 1 commit into
clustershell:masterfrom
kcgthb:conf_dir

Conversation

@kcgthb

@kcgthb kcgthb commented Aug 3, 2022

Copy link
Copy Markdown
Collaborator

Introduce $CLUSTERSHELL_CFGDIR as an alternate location for configuration files.

This is basically a revisit of #191. This original issue led to #111, which allows per-user configuration file overrides, but doesn't provide a way to define system-wide configuration files (not per-user), which are not stored in /etc.

The use case is a multi-node cluster, where ClusterShell could be provided as a user-facing tool, installed on a shared file system (like a NFS mount point), and not as a local package on each node. In that case, providing system defaults for all users would requiring distributing configuration files on each and every of the cluster node's local /etc/ directory. A more flexible approach would be to define an environment variable (the proposed $CLUSTERSHELL_CFGDIR) to point to the global configuration directory, which could be co-located with the shared ClusterShell installation.

When $CLUSTERSHELL_CFGDIR is not defined, the default /etc/clustershell is used as a fallback to keep compatibility with existing configurations.

This PR:

  • updates lib/ClusterShell/Defaults.py
  • updates (text) documentation files in doc/
  • adds a test in tests/CLIConfigTest.py

configuration files. Keep the default `/etc/clustershell` when the
environment variable is not defined.
@thiell thiell self-requested a review August 3, 2022 21:15
@thiell thiell added this to the 1.9 milestone Aug 3, 2022
@thiell thiell requested a review from degremont August 6, 2022 00:03

@degremont degremont left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just ensure the new variable name matches other possible variables we already support, if they exist. (CLUSTERSHELL_ prefix).

@kcgthb

kcgthb commented Aug 8, 2022

Copy link
Copy Markdown
Collaborator Author

@thiell thiell merged commit ac542f6 into clustershell:master Aug 8, 2022
@kcgthb kcgthb deleted the conf_dir branch August 8, 2022 18:02
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.

3 participants