Commit Graph

1679 Commits

Author SHA1 Message Date
ander e1e1348998
[explorer/os_version] use 99.99 as fallback for unknown code names in */sid 2021-08-23 10:47:21 +03:00
ander 67f85546ec
[explorer/os_version] add new debian code names: bookworm and trixie 2021-08-23 10:09:41 +03:00
poljakowski 841ebb9b88 Merge branch 'fix/explorer/os_version/old-freebsd' into 'master'
explorer/os_version: fix for FreeBSD < 10.0 (again)

See merge request ungleich-public/cdist!1017
2021-08-05 10:26:33 +02:00
poljakowski 39dcb41349 Merge branch 'fix/explorer/os_version/legacy-macosx' into 'master'
explorer/os_version: Fix for legacy Mac OS X versions

See merge request ungleich-public/cdist!1018
2021-08-05 10:25:17 +02:00
poljakowski d37772f3ea Merge branch 'fix/type/__update_alternatives/dry-run' into 'master'
update alternatives: fixes for dry runs and non-English systems

See merge request ungleich-public/cdist!1016
2021-08-05 10:23:29 +02:00
poljakowski 49a9bcdf93 Merge branch 'fix/explorer/memory/gt-2g' into 'master'
explorer/memory: fix conversion of large numbers (>= 2GiB)

See merge request ungleich-public/cdist!1015
2021-08-05 10:23:20 +02:00
Dennis Camera 2a0c073d40 [explorer/os_version] Fix for legacy Mac OS X versions 2021-08-04 21:55:56 +02:00
Dennis Camera bbcc81a984 [type/__update_alternatives] Fix for non-English locales
Since update-alternatives(1) is localized, screen scraping its output breaks
if the locale is set to non-English.
2021-08-04 21:44:04 +02:00
Dennis Camera 0b3b47396f [type/__update_alternatives] dry-run fixes 2021-08-04 21:39:39 +02:00
Dennis Camera a7d6481a7d [type/__update_alternatives] Secure cdist-defined environment variables with :? 2021-08-04 21:38:21 +02:00
Dennis Camera 83fe6e9f5b [explorer/memory] Fix conversion of large numbers (>= 2GiB)
At least mawk uses scientific notation when using print for
numbers >=2^31 (INT_MAX of a signed 32-bit int).

`printf "%.f\n"` works around this.
2021-08-04 20:45:14 +02:00
Dennis Camera e108cbc205 [explorer/os_version] Ubuntu: fall back to os-release/lsb-release files 2021-08-04 20:44:17 +02:00
Dennis Camera 53334fb4eb [explorer/os_version] Fix for FreeBSD < 10.0 (again) 2021-08-04 19:50:10 +02:00
sparrowhawk 4156fea900
[filesystem] Add ubuntu as supported distribution. 2021-07-28 12:56:39 +02:00
poljakowski bf0c355fe7 Merge branch 'feature/explorer/os_version/devuan-ceres' into 'master'
explorer/os_version: Convert Devuan ceres to version number

See merge request ungleich-public/cdist!1008
2021-07-20 06:37:40 +02:00
Dennis Camera 24c9406ea0 [explorer/os_version] Convert Devuan ceres to version number
Conversion of Devuan ceres to version numbers is done based on Devuan codenames.
The version number is the version number of the final release - 0.01.

Analogous to Debian.
2021-07-19 12:14:20 +02:00
poljakowski 8b160841ad Merge branch 'apt-pin-type' into 'master'
New type: __apt_pin - manage apt pinning

See merge request ungleich-public/cdist!1005
2021-07-18 17:44:04 +02:00
ander 46b5c24cd2
use $__remote_exec for RSYNC_RSH 2021-07-18 16:25:00 +03:00
ander 0e611af2a6
[__rsync] rewrite 2021-07-17 11:44:09 +03:00
Darko Poljak 65c43d3c1d Fix docs code block errors 2021-07-10 21:02:27 +02:00
poljakowski b8f601ee15 Merge branch 'rsync-ssh-multiplex' into 'master'
__rsync: Use $__remote_exec and thus the ssh multiplexing

See merge request ungleich-public/cdist!1001
2021-07-08 08:05:52 +02:00
fancsali 166b58aeea Fix typo in distro names... 2021-07-05 15:32:27 +02:00
fancsali 521241d741 Refine docs even more 2021-07-05 15:28:05 +02:00
fancsali be92731c5c Shell check quoting
We're actually echo-ing the command, hence the escape in front of the
quotes - the issue Shellcheck alludes too would actually occur, had the
escaping bakcslashes been omitted.
2021-07-05 12:44:09 +01:00
poljakowski d8da298cdf Merge branch '__snakeoil_cert' into 'master'
new type: __snakeoil_cert

See merge request ungleich-public/cdist!1002
2021-07-05 08:59:59 +02:00
ander 30ba796d06
new type: __snakeoil_cert 2021-07-02 10:09:38 +03:00
poljakowski 6528fd1c77 Merge branch 'feature/type/__debconf_set_selections/state-explorer' into 'master'
__debconf set selections: Add state explorer

See merge request ungleich-public/cdist!999
2021-07-02 06:49:24 +02:00
ander 60753ddfcc
fix shellcheck 2021-07-01 14:42:10 +03:00
fancsali d937d53f3d Add quotes to rsync command 2021-06-28 18:09:35 +01:00
fancsali 2db40d8d70 Use $__remote_exec and thus the ssh multiplexing 2021-06-28 12:54:20 +02:00
ander 7b3f268df2
[__download] improvements
1. post download checksum verification
2. detect hashes without prefix
3. add optional --destination
4. updated man
2021-06-22 16:36:30 +03:00
fancsali b726697e07 Add documentation 2021-06-11 15:05:33 +01:00
fancsali a3102022e1 More sensible defaults; reword debian-only error message 2021-06-11 15:05:17 +01:00
Dennis Camera 6ede76b08b [type/__debconf_set_selections] man.rst: Fix line break in AUTHORS 2021-06-08 16:20:55 +02:00
Dennis Camera d596986af8 [type/__pyvenv] Fix group explorer 2021-05-31 09:06:52 +02:00
poljakowski d2ce55ea6e Merge branch '__git_fix_group_explorer' into 'master'
[__git] fix group explorer

See merge request ungleich-public/cdist!992
2021-05-29 11:20:20 +02:00
ander 503a06ed28
[__git] fix group explorer
group name from numberic id wasn't resolved correctly.

try to use getent and fallback to reading /etc/group directly.
2021-05-23 13:35:33 +03:00
evilham 81b426e4e2 [__letsencrypt_cert] Revamp explorers, add locking.
Closes #839

See merge request ungleich-public/cdist!976

This patch joins all explorers in one to avoid starting multiple remote python
processes and uses a cdist-specific lock in /tmp/certbot.cdist.lock with a
60 seconds timeout.
2021-05-10 12:10:01 +02:00
evilham a696f3cf00 [__letsencrypt_cert] Revamp explorers, add locking.
This would fix #839

Certbot uses locking [1] even for read-only operations and does not properly
use exit codes, which means that sometimes it would print:
"Another instance of Certbot is already running" and exit with success.

However, the previous explorers would take that as the certificate being absent
and would trigger code generation.

The issue was made worse by having many explorers running certbot, so for N
certificates, we'd run certbot N*4 times, potentially "in parallel".

[1]: https://certbot.eff.org/docs/using.html#id5

This patch joins all explorers in one to avoid starting multiple remote python
processes and uses a cdist-specific lock in /tmp/certbot.cdist.lock with a
60 seconds timeout.

It has been tested with certbot 0.31.0 and 0.17 that the:

    from certbot.main import main

trick works. It is somewhat well documented so it can be somewhat relied upon.
2021-05-10 12:10:00 +02:00
evilham c00c8c2012 [__apt_key*] Deprecate __apt_key_uri and improve __apt_key
Previously this type was falling back to using the deprecated apt-key(8) by
checking for existence of files/directories on the controller host in
gencode-remote.

Adding `--use-deprecated-apt-key` as an explicit boolean serves two purposes:
1. It prevents fallbacks that might end up doing the wrong thing
   (as was the case)
2. It allows for a simple way to remove keys from the keyring that were
   previously added with apt-key(8) to /etc/apt/trusted.gpg

This parameter is added marked as deprecated as is only intended use is to
migrate to directory-based keyrings as recommended by Debian for a few releases.
It will be removed when Debian 11 stops being supported.

During the review process of this merge request, it was noted that the state of
PGP Key Servers is somewhat suboptimal, that the examples encouraged bad
practise (it is trivial to produce collisions for short key IDs), and that
this use does not require the Web of Trust, but instead only the public key
that is signing the repository.

That is why this also adds `--source` as an argument allowing for in-type or
in-manifest provision of such public keys by the type/manifest maintainer and
the use of Key Servers is still supported, but discouraged.
2021-05-10 12:08:22 +02:00
Dennis Camera a42ebc7a78 [type/__debconf_set_selections] Synchronise objects
Works around locking error:

	debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
2021-04-27 19:46:07 +02:00
Dennis Camera 9cf19388ab [type/__debconf_set_selections] Send message about each debconf setting that is changed 2021-04-26 16:47:44 +02:00
Dennis Camera a4122882f2 [type/__debconf_set_selections] Add state explorer
…and to make it work, replace --file with --line.

--file is deprecated because it does not work with the state explorer as the
contents of the file are not available on the target.
2021-04-26 16:39:51 +02:00
Dennis Camera 0f05f38384 [type/__postgres_role] Treat --password '' like no --password 2021-04-25 20:01:36 +02:00
Dennis Camera 0d33407b18 [type/__postgres_database] Proper quoting in state explorer 2021-04-25 20:01:36 +02:00
Dennis Camera 8296051653 [type/__postgres_extension] Add state explorer 2021-04-25 20:01:36 +02:00
Dennis Camera 3cf93249c3 [type/__postgres_extension] Include postgres_user explorer from __postgres_conf 2021-04-25 20:01:36 +02:00
Dennis Camera beb8da6d5f [type/__postgres_role] Include postgres_user explorer from __postgres_conf 2021-04-25 20:01:36 +02:00
Dennis Camera 58b279a8d0 [type/__postgres_database] Improve quoting 2021-04-25 20:01:36 +02:00
Dennis Camera 6ac8cbf98f [type/__postgres_database] Include postgres_user explorer from __postgres_conf 2021-04-25 20:01:36 +02:00