Compare commits
10 commits
master
...
mute-retur
Author | SHA1 | Date | |
---|---|---|---|
ef44d44288 | |||
|
515992249d | ||
cd0c811d74 | |||
965829e18a | |||
bd66b6d948 | |||
b31e13eacf | |||
56a65518ab | |||
0b3c417aef | |||
678df1ec8a | |||
fefc828780 |
8 changed files with 54 additions and 16 deletions
7
README
7
README
|
@ -1,7 +0,0 @@
|
|||
cdist
|
||||
-----
|
||||
|
||||
cdist is a usable configuration management system.
|
||||
|
||||
For the web documentation have a look at https://www.cdi.st/
|
||||
or at docs/src for reStructuredText manual.
|
31
README.md
Normal file
31
README.md
Normal file
|
@ -0,0 +1,31 @@
|
|||
# cdist
|
||||
|
||||
**cdist** is a usable configuration management system.
|
||||
|
||||
It adheres to the [**KISS principle**](https://en.wikipedia.org/wiki/KISS_principle)
|
||||
and is being used in small up to enterprise grade environments.
|
||||
|
||||
For more information have a look at [**homepage**](https://cdi.st)
|
||||
or at **``docs/src``** for manual in **reStructuredText** format.
|
||||
|
||||
## Contributing
|
||||
|
||||
Merge/Pull requests can be made in both
|
||||
[upstream **GitLab**](https://code.ungleich.ch/ungleich-public/cdist/merge_requests)
|
||||
(managed by [**ungleich**](https://ungleich.ch))
|
||||
and [**GitHub** project](https://github.com/ungleich/cdist/pulls).
|
||||
|
||||
Issues can be made and other project management activites happen
|
||||
[**only in GitLab**](https://code.ungleich.ch/ungleich-public/cdist)
|
||||
(needs [**ungleich** account](https://account.ungleich.ch)).
|
||||
|
||||
For community-maintained types there is
|
||||
[**cdist-contrib** project](https://code.ungleich.ch/ungleich-public/cdist-contrib).
|
||||
|
||||
## Participating
|
||||
|
||||
IRC: ``#cdist`` @ freenode
|
||||
|
||||
Matrix: ``#cdist:ungleich.ch``
|
||||
|
||||
Mattermost: https://chat.ungleich.ch/ungleich/channels/cdist
|
|
@ -32,6 +32,10 @@ case "$os" in
|
|||
sysctl -n hw.ncpuonline
|
||||
;;
|
||||
|
||||
"freebsd"|"netbsd")
|
||||
sysctl -n hw.ncpu
|
||||
;;
|
||||
|
||||
*)
|
||||
if [ -r /proc/cpuinfo ]; then
|
||||
cores="$(grep "core id" /proc/cpuinfo | sort | uniq | wc -l)"
|
||||
|
|
|
@ -29,7 +29,7 @@ case "$os" in
|
|||
echo "$(sysctl -n hw.memsize)/1024" | bc
|
||||
;;
|
||||
|
||||
"openbsd")
|
||||
*"bsd")
|
||||
echo "$(sysctl -n hw.physmem) / 1048576" | bc
|
||||
;;
|
||||
|
||||
|
|
|
@ -167,7 +167,8 @@ class Explorer(object):
|
|||
def run_global_explorer(self, explorer):
|
||||
"""Run the given global explorer and return it's output."""
|
||||
script = os.path.join(self.remote.global_explorer_path, explorer)
|
||||
return self.remote.run_script(script, env=self.env, return_output=True)
|
||||
return self.remote.run_script(script, env=self.env, return_output=True,
|
||||
warn_return_output=False)
|
||||
|
||||
# type
|
||||
|
||||
|
@ -229,7 +230,8 @@ class Explorer(object):
|
|||
})
|
||||
script = os.path.join(self.remote.type_path, cdist_type.explorer_path,
|
||||
explorer)
|
||||
return self.remote.run_script(script, env=env, return_output=True)
|
||||
return self.remote.run_script(script, env=env, return_output=True,
|
||||
warn_return_output=False)
|
||||
|
||||
def transfer_type_explorers(self, cdist_type):
|
||||
"""Transfer the type explorers for the given type to the
|
||||
|
|
|
@ -219,7 +219,7 @@ class Remote(object):
|
|||
self._run_command(command)
|
||||
|
||||
def run_script(self, script, env=None, return_output=False, stdout=None,
|
||||
stderr=None):
|
||||
stderr=None, warn_return_output=True):
|
||||
"""Run the given script with the given environment on the remote side.
|
||||
Return the output as a string.
|
||||
|
||||
|
@ -232,10 +232,11 @@ class Remote(object):
|
|||
command.append(script)
|
||||
|
||||
return self.run(command, env=env, return_output=return_output,
|
||||
stdout=stdout, stderr=stderr)
|
||||
stdout=stdout, stderr=stderr,
|
||||
warn_return_output=warn_return_output)
|
||||
|
||||
def run(self, command, env=None, return_output=False, stdout=None,
|
||||
stderr=None):
|
||||
stderr=None, warn_return_output=True):
|
||||
"""Run the given command with the given environment on the remote side.
|
||||
Return the output as a string.
|
||||
|
||||
|
@ -269,10 +270,11 @@ class Remote(object):
|
|||
else:
|
||||
cmd.extend(command)
|
||||
return self._run_command(cmd, env=env, return_output=return_output,
|
||||
stdout=stdout, stderr=stderr)
|
||||
stdout=stdout, stderr=stderr,
|
||||
warn_return_output=warn_return_output)
|
||||
|
||||
def _run_command(self, command, env=None, return_output=False, stdout=None,
|
||||
stderr=None):
|
||||
stderr=None, warn_return_output=True):
|
||||
"""Run the given command with the given environment.
|
||||
Return the output as a string.
|
||||
|
||||
|
@ -280,7 +282,8 @@ class Remote(object):
|
|||
assert isinstance(command, (list, tuple)), (
|
||||
"list or tuple argument expected, got: %s" % command)
|
||||
|
||||
if return_output and stdout is not subprocess.PIPE:
|
||||
warn_return_output_applies = warn_return_output and return_output
|
||||
if warn_return_output_applies and stdout is not subprocess.PIPE:
|
||||
self.log.debug("return_output is True, ignoring stdout")
|
||||
|
||||
close_stdout = False
|
||||
|
|
|
@ -19,6 +19,9 @@
|
|||
# such as ':' for POSIX or ';' for Windows.
|
||||
# If also specified at command line then values from command line are
|
||||
# appended to this value.
|
||||
# Notice that this works in a "last one wins" fashion, so if a type is redefined
|
||||
# in multiple conf_dirs, the last one in which it is defined will be used.
|
||||
# Consider using a unique prefix for your own roles if this can be an issue.
|
||||
# conf_dir = <dir1>:<dir2>
|
||||
#
|
||||
# init_manifest
|
||||
|
|
|
@ -10,6 +10,8 @@ next:
|
|||
* New type: __pf_apply_anchor (Kamila Součková, Evil Ham)
|
||||
* Type __pf_ruleset: Refactor (Kamila Součková, Evil Ham)
|
||||
* Type __pf_apply: Deprecate type (Kamila Součková, Evil Ham)
|
||||
* Configuration: Add notes to cdist.cfg.skeleton (Evil Ham)
|
||||
* Explorers cpu_cores, memory: Improve *BSD support (Evil Ham)
|
||||
|
||||
6.5.4: 2020-04-11
|
||||
* Explorer init: Do not grep on non-existent init (Steven Armstrong)
|
||||
|
|
Loading…
Reference in a new issue