Commit graph

6,689 commits

Author SHA1 Message Date
6da0f9e0c5 __lxc_container: updated todo.txt about type splitting
Because it will get a mess when adding every option to __lxc_container
..
2020-11-29 18:14:34 +01:00
2b97e08ff2 __lxc_container: remove default --quiet parameter
Because we want to see error messages, too. And lxc isn't that
verbose.
2020-11-29 15:01:46 +01:00
4e06ea7816 __lxc_container: no grep ERE used, switching to BRE
When checking for lxc configuration that should be removed, it says to
grep to use extended regular expressions (ERE). But there are no
characters not covered by basic regular expressions (BRE). So switching
to to BRE, as it may not match user input as regex.
2020-10-20 17:03:14 +02:00
e8aede1e91 __lxc_container: do not call rm recusivly for a file 2020-10-19 18:00:05 +02:00
5d6f90555b [__lxc_container] s/\t/ /g; renewed todo.txt file
Replaced all tabs with 4 spaces (~/.vimrc is modified, too).

The issue.txt is not required anymore and the todo.txt was updated.
2020-07-13 21:16:18 +02:00
9fd892a224 [__lxc_container] add --restart-if-changed parameter to apply changes
This parameter restarts the container if configuration changes and it is
already running and should keept running. It handles the freeze state,
because it would be expected to apply changes in this state, too.
2020-07-13 20:47:09 +02:00
12a6d52a46 [__lxc_container] handle $empty_conf for --no-default-config correctly
Fixed wrong variable spelling and correct check to remove the tempfile
again (forgotten from 304d974f).
2020-07-12 21:30:44 +02:00
6d29b0542a [__lxc_container] better support config modifications at creation time
When a container is created, the configuration is unknown to the
explorer. To do the job without the knowleage, following is added: If
the container will be created, it adds all absent configuration options
to be deleted. Because it do not know which configuration options exist,
it tries to remove all if there exists.

This behaviour is extended for containers that will be cloned: Because
the container who will be cloned is known and it will copy the config
nearly one to one, so it will read this configuration.

The removal of configuration is generally improved by generating a
pattern to ignore spaces at the beginning, near the equal sign and at
the end. This deletes the correct configuration lines even they have
malformed whitespaces.
2020-07-12 20:37:59 +02:00
304d974f7b [__lxc_container] moved config diff incl. gencode-local to gencode-remote
Rather than the config handling is split up over gencode-{local,remote}
and the manifest, it is now completly moved to the gencode-remote script.

This avoids complexity, file uploading and direct ssh interactions as it
was used before. The diff creation was extracted into an extra script, and
the gencode-local was removed.

Now, the gencode-remote script executes the config diff script before
the short curcuit and uses here-documents and pipes if the diff is
required on the remote host. With this, the script size grows, but
should be no difference if the file is downloaded temporarily.

With this, the remote handling of an empty configuration file was
enhanced by handling it completely into the code-remote script (hope
escaping works correctly).
2020-07-11 18:54:29 +02:00
1b69d037ac [__lxc_container] fix some shellchecks (incl. warnings)
To the error in the `explorer/state`: It's intended, as it passes
possible parameters to the command. Varibale will set unquoted, so
word splitting take action, but the quotes inside the variable work.
2020-07-05 20:50:40 +02:00
211393814a [__lxc_container] Updated manpage (completly proof-read it)
I think it should be fine now .. :-)
2020-07-05 20:15:41 +02:00
1c8eee1749 [__lxc_container] Updated manpage (incl. examples, copyright, ..)
Should be fine now.
2020-07-05 14:50:58 +02:00
e9256b6e8e [__lxc_container] create: added backingstore and template options
With some minor changes, the backingstore parameters and some more
template options where added (incl. `man.rst`).
2020-07-05 14:50:58 +02:00
c92d562934 [__lxc_container] refactored gencode-remote processing
litte changes to `gencode-local` and more messages, too.
2020-07-05 14:50:58 +02:00
939abf6d45 [__lxc_container] got type to fly with heavier changes
Helper scripts do not work with explorers, so there are useless; and
some other problems detected at runtime.

`gencode-remote` *will be refactored - be aware*
2020-07-05 14:50:58 +02:00
1b735fb150 [__lxc_container] fix SC2021
Problems with backets and tr.
2020-07-05 14:50:58 +02:00
8ee71e67f4 [__lxc_container] initial work for lxc contaienr type
This should theoretically work, but is untested. It is able to create
and delete, change basic configuration and start/stop/freeze the
container.
2020-07-05 14:50:58 +02:00
Darko Poljak
88400551f9 ++changelog 2020-06-30 23:59:45 +02:00
727f3dbb03 Merge branch 'fix/type/__user/openbsd-shadow' into 'master'
__user: Fix shadow explorer for OpenBSD

See merge request ungleich-public/cdist!902
2020-06-30 22:55:33 +02:00
c5a8004c9a Merge branch 'hosts-aliases' into 'master'
__hosts: add --alias parameter

See merge request ungleich-public/cdist!901
2020-06-30 22:52:52 +02:00
Dennis Camera
6467ccbdcc [type/__user] Make shellcheck happy 2020-06-30 14:31:11 +02:00
ssrq
9e33a8f42f Merge branch 'master' into 'fix/type/__user/openbsd-shadow'
# Conflicts:
#   cdist/conf/type/__user/explorer/shadow
2020-06-30 14:26:23 +02:00
Dennis Camera
999e7b0134 [type/__user] Fix shadow explorer for OpenBSD 2020-06-30 14:23:34 +02:00
Dennis Camera
a263fdfe58 [__hosts] Add --alias parameter
The --alias parameter allows to specify a hostname and multiple aliases on a
single /etc/hosts line.
2020-06-30 14:05:26 +02:00
Darko Poljak
077989e8fd Remove annoying warnings
Those warnings don't have any specail meaning and usage.
Resolve #825.
2020-06-27 15:55:57 +02:00
Darko Poljak
7074f9c395 ++changelog 2020-06-25 06:32:10 +02:00
684043bf37 Merge branch 'fix/type/__package_opkg/lock' into 'master'
__package_opkg: Add locking

See merge request ungleich-public/cdist!896
2020-06-25 06:31:16 +02:00
ceedcd02f2 Merge branch 'feature/type/__locale_system/support-devuan' into 'master'
__locale_system: "Whitelist" Devuan

See merge request ungleich-public/cdist!900
2020-06-25 06:24:17 +02:00
Dennis Camera
5364d3bc90 [type/__package_opkg] Implement flock locking if available 2020-06-24 21:06:10 +02:00
Dennis Camera
a9778965be [type/__package_opkg] Use mkdir(1) to lock instead of noclobber
noclobber is potentially unsafe, because it relies on the underlying shell to
implement noclobber in a safe way that avoids race conditions between multiple
processes.
mkdir is safer because it is mandated by POSIX to "fail" if the target already
exists.
2020-06-24 08:47:22 +02:00
Dennis Camera
3649555f35 [type/__package_opkg] Do not lock execution of code-remote (revert)
Instead, rely on `nonparallel`.
In any case cdist should never run explorer and code concurrently even if the
dependency graph would allow to do so as it would result in many more
synchronization issues than this one.
2020-06-22 09:32:57 +02:00
d478bef8a6 Merge branch 'lint/py3-classes' into 'master'
Consequently use Python 3-style classes

See merge request ungleich-public/cdist!898
2020-06-21 17:54:56 +02:00
e67215f93d Merge branch 'lint/no-python-shebangs' into 'master'
Remove unnecessary Python shebangs

See merge request ungleich-public/cdist!897
2020-06-21 17:53:44 +02:00
Dennis Camera
6aae58dea7 [type/__package_opkg] Mark lock variables readonly 2020-06-21 17:35:28 +02:00
Dennis Camera
ce07021580 Do not subclass object 2020-06-21 16:53:47 +02:00
Dennis Camera
a6a3fb40bf Remove unnecessary Python shebangs 2020-06-21 16:03:09 +02:00
Dennis Camera
e79b26a61f [type/__package_opkg] Also lock execution of code-remote 2020-06-21 15:53:01 +02:00
Dennis Camera
97e48be39e [type/__package_opkg] Fix explorer running in parallel 2020-06-21 15:52:57 +02:00
Darko Poljak
a6543a72ad ++changelog 2020-06-17 13:40:31 +02:00
d59ba09d71 Merge branch '__download' into 'master'
new type: __download

See merge request ungleich-public/cdist!892
2020-06-17 13:39:07 +02:00
Darko Poljak
cdb998398d Release 6.6.0 2020-06-17 12:10:58 +02:00
201050a9e5 new type: __download 2020-06-16 20:53:31 +03:00
Darko Poljak
5be8437a60 ++changelog 2020-06-13 13:48:34 +02:00
7a48b30d7a Merge branch 'log-server-new-min-py-ver' into 'master'
Log server to capture nested logging output

See merge request ungleich-public/cdist!891
2020-06-13 13:46:05 +02:00
Darko Poljak
59b98091d7 Adapt; update docs and code style 2020-06-13 13:44:01 +02:00
Steven Armstrong
57e352cd1e log server is also usefull for cdist config
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
2020-06-13 13:44:01 +02:00
Steven Armstrong
831bfc822b remove unused code
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
2020-06-13 13:44:01 +02:00
Steven Armstrong
6e9e9ad557 implement log server to capture nested logging output
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
2020-06-13 13:44:01 +02:00
Darko Poljak
eba3d0505b ++changelog 2020-06-12 06:29:39 +02:00
Darko Poljak
eec7ab8e45 Increase minimum supported Python version to 3.5 2020-06-12 06:08:56 +02:00