Warning: apt-key output should not be parsed (stdout is not a terminal)
on stderr. Redirect stderr of apt-key to /dev/null to prevent output in
cdist run.
getent(1) is a utility available where Name Service Switch (NSS)
is available. Many modern operating systems support it, but that
may not be the case of all (e.g. embedded systems).
This commit modifies the __user type explorers to check the
traditional files instead of relying solely on the availability
of getent(1).
- Makes the group explorer use /etc/group
- Makes the passwd explorer use /etc/passwd
- Makes the shadow explorer use /etc/shadow
Implementation note
"getent shadow" does not support querying an entry using a uid
since it does not store that information. Since the shadow explorer
uses __object_id, the passwd explorer does not check if __object_id
matches an entry by uid. This behavior ensures consistent, transparent
behavior of the type. The group explorer, on the other hand, handles
group names and uids; like always.
/etc/os-release was introduced by systemd[1] and is now
more and more common; even on systems without systemd (e.g. lede).
In addition to detecting the OS based on specific attributes,
this file provides the ID marker to describe the OS.
This commit adds support for OS detection via /etc/os-release.
According to [2], it is already lowercase.
[1] http://0pointer.de/blog/projects/os-release
[2] https://www.freedesktop.org/software/systemd/man/os-release.html
When --remote-copy and --remote-exec are provided,
args.remote_cmds_cleanup_pattern is not set.
This patches fixes the evaluation of args.remote_cmds_cleanup_pattern
and prevents cdist from throwing an exception when --remote-copy
and --remote-exec are used.