-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2831 from mpranj/cache-tools
Cache tools
- Loading branch information
Showing
28 changed files
with
506 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
# VISION | ||
|
||
The vision of Elektra is to have | ||
systems in which every configuration | ||
setting is easily accessible and specifiable. | ||
|
||
We will use samba and its configuration value | ||
`global/workgroup` as running example. | ||
|
||
## Problem | ||
|
||
Currently, the administrator would first need to | ||
locate the configuration file (it could be | ||
`/etc/samba/smb.conf` | ||
|
||
## Configuration Management | ||
|
||
By a single invocation of a command-line tool | ||
it should be possible to change a configuration | ||
value: | ||
|
||
If you already use configuration management tools, | ||
the vision is that a single statement suffices to | ||
change a configuration value: | ||
|
||
Key/value access in Chef: | ||
|
||
``` | ||
kdbset 'system/sw/samba/global/workgroup' do | ||
value 'MY_WORKGROUP' | ||
action :create | ||
end | ||
``` | ||
|
||
Key/value access in Ansible: | ||
|
||
```yaml | ||
- name: setup samba workgroup | ||
connection: local | ||
hosts: localhost | ||
tasks: | ||
- name: set workgroup | ||
elektra: | ||
key: "system/sw/samba/global/workgroup" | ||
value: "MY_WORKGROUP" | ||
``` | ||
elektra: | ||
mountpoint: system/sw/samba | ||
file: /etc/samba/smb.conf | ||
plugins: ini | ||
Key/value access in puppet-libelektra: | ||
``` | ||
kdbkey {'system/sw/samba/global/workgroup': | ||
ensure => 'present', | ||
value => 'MY_WORKGROUP' | ||
} | ||
``` | ||
|
||
## Legacy | ||
|
||
The vision also includes legacy applications which do | ||
not directly use Elektra. Then distributions can mount | ||
configuration files, so that the configuration is | ||
visible within Elektra. | ||
|
||
Mounting can also be done via configuration management | ||
tools. | ||
|
||
Mounting in puppet-libelektra: | ||
|
||
``` | ||
kdbmount {'system/sw/samba': | ||
ensure => 'present', | ||
file => '/etc/samba/smb.conf', | ||
plugins => 'ini' | ||
} | ||
kdbkey {'system/sw/samba/global/log level': | ||
ensure => 'absent' | ||
} | ||
``` | ||
|
||
## Specifications | ||
|
||
Key/value specifications in puppet-libelektra: | ||
|
||
``` | ||
kdbkey {'system/sw/samba/global/log level': | ||
ensure => 'present', | ||
value => 'MY_WORKGROUP', | ||
check => { | ||
'type' => 'short', | ||
'range' => '0-10', | ||
'default' => '1', | ||
'description' => 'Sets the amount of log/ | ||
debug messages that are sent to the | ||
log file. 0 is none, 3 is consider- | ||
able.' | ||
} | ||
``` | ||
|
||
Ideally, applications already specify their settings. | ||
|
||
\end{frame} | ||
|
||
## Unique Key Names | ||
|
||
The main technique to achieve the vision is | ||
unique key names: Every configuration setting | ||
can be addressed by its unique key name. | ||
|
||
With this unique key name, we get an identifier, | ||
which can be used at all places throughout the | ||
system. | ||
|
||
## Common Data Structure | ||
|
||
## Abstract Configuration For New Applications | ||
|
||
## Integrate Legacy Applications | ||
|
||
## Specify Keys | ||
|
||
## Facilitate Configuration Management | ||
|
||
- Continue reading [big picture](BIGPICTURE.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# kdb-cache(1) -- Enable, disable or clear the cache | ||
|
||
## SYNOPSIS | ||
|
||
`kdb cache {enable,disable,default,clear}` | ||
|
||
## DESCRIPTION | ||
|
||
This command is used to enable or disable the cache and to revert | ||
to the default settings. The default settings will let the system | ||
decide whether to use the cache or not. The clear command will | ||
remove the generated cache files in a safe way. | ||
|
||
## LIMITATIONS | ||
|
||
Caches are stored on a per-user basis, therefore the `clear` | ||
subcommand can only remove a user's cache files (i.e. not system wide). | ||
|
||
## OPTIONS | ||
|
||
- `-H`, `--help`: | ||
Show the man page. | ||
- `-V`, `--version`: | ||
Print version info. | ||
- `-p`, `--profile <profile>`: | ||
Use a different kdb profile. | ||
- `-C`, `--color <when>`: | ||
Print never/auto(default)/always colored output. | ||
- `-v`, `--verbose`: | ||
Explain what is happening. Prints additional information in case of errors/warnings. | ||
- `-d`, `--debug`: | ||
Give debug information. Prints additional debug information in case of errors/warnings. | ||
|
||
## EXAMPLES | ||
|
||
```sh | ||
# Backup-and-Restore: system/elektra/cache | ||
|
||
# Enable the cache | ||
kdb cache enable | ||
|
||
# Disable the cache | ||
kdb cache disable | ||
|
||
# Revert to defaults | ||
kdb cache default | ||
|
||
# Clear all generated cache files | ||
kdb cache clear | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
.\" generated with Ronn/v0.7.3 | ||
.\" http://github.com/rtomayko/ronn/tree/0.7.3 | ||
. | ||
.TH "KDB\-CACHE" "1" "August 2019" "" "" | ||
. | ||
.SH "NAME" | ||
\fBkdb\-cache\fR \- Enable, disable or clear the cache | ||
. | ||
.SH "SYNOPSIS" | ||
\fBkdb cache {enable,disable,default,clear}\fR | ||
. | ||
.SH "DESCRIPTION" | ||
This command is used to enable or disable the cache and to revert to the default settings\. The default settings will let the system decide whether to use the cache or not\. The clear command will remove the generated cache files in a safe way\. | ||
. | ||
.SH "LIMITATIONS" | ||
Caches are stored on a per\-user basis, therefore the \fBclear\fR subcommand can only remove a user\'s cache files (i\.e\. not system wide)\. | ||
. | ||
.SH "OPTIONS" | ||
. | ||
.TP | ||
\fB\-H\fR, \fB\-\-help\fR | ||
Show the man page\. | ||
. | ||
.TP | ||
\fB\-V\fR, \fB\-\-version\fR | ||
Print version info\. | ||
. | ||
.TP | ||
\fB\-p\fR, \fB\-\-profile <profile>\fR | ||
Use a different kdb profile\. | ||
. | ||
.TP | ||
\fB\-C\fR, \fB\-\-color <when>\fR | ||
Print never/auto(default)/always colored output\. | ||
. | ||
.TP | ||
\fB\-v\fR, \fB\-\-verbose\fR | ||
Explain what is happening\. Prints additional information in case of errors/warnings\. | ||
. | ||
.TP | ||
\fB\-d\fR, \fB\-\-debug\fR | ||
Give debug information\. Prints additional debug information in case of errors/warnings\. | ||
. | ||
.SH "EXAMPLES" | ||
. | ||
.nf | ||
|
||
# Backup\-and\-Restore: system/elektra/cache | ||
|
||
# Enable the cache | ||
kdb cache enable | ||
|
||
# Disable the cache | ||
kdb cache disable | ||
|
||
# Revert to defaults | ||
kdb cache default | ||
|
||
# Clear all generated cache files | ||
kdb cache clear | ||
. | ||
.fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.