Commit graph

1349 commits

Author SHA1 Message Date
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
d59ba09d71 Merge branch '__download' into 'master'
new type: __download

See merge request ungleich-public/cdist!892
2020-06-17 13:39:07 +02:00
201050a9e5 new type: __download 2020-06-16 20:53:31 +03:00
7c490a703d [__clean_path] add --path parameter 2020-06-10 11:38:14 +03:00
Darko Poljak
988190363a Resolve shellcheck SC1090 2020-05-30 15:10:13 +02:00
29c0180204 [__ssh_authorized_keys] add --remove-unknown parameter 2020-05-28 23:31:13 +03:00
716d3554f3 [__user] fix user delete on freebsd 2020-05-23 00:48:35 +03:00
dab32b0cb6 Merge branch '__group_freebsd_fix' into 'master'
[__group] fix --gid on freebsd

See merge request ungleich-public/cdist!881
2020-05-22 10:08:29 +02:00
3bcbd95269 [__motd] debian|ubuntu|devuan use /etc/motd 2020-05-22 02:36:49 +03:00
bf25a18a04 [__group] fix --gid on freebsd 2020-05-22 02:31:38 +03:00
ad58ea79c2 [__ssh_authorized_keys] Fix bug where --option was not multiple
This went against both documentation and intent.
2020-05-18 20:01:01 +02:00
8d639d54d0 Merge branch 'evilham-authorized_keys-man' into 'master'
[__ssh_authorizedkey{,s}] Improve documentation.

See merge request ungleich-public/cdist!877
2020-05-18 19:49:50 +02:00
6d502f737a [__ssh_authorizedkey{,s}] Improve documentation. 2020-05-18 18:37:16 +02:00
086e683c99 [__file] add "default values" in manual for group, mode and owner
Because at least the --mode default value may not be expected, the
manual lists the "default values". As they are not explicitly set in the
`__file` type, it is a bit more difficult, but should resolve to
following:
  - the mode comes from the umask set in the cdist code to protect file
    creation and uses the strongest umask possible.
  - the owner and group comes from the ssh user, which should always be
    the root user. (I think this can be swaped, too, but who will?)

At the owner and group parameter, it could be replaced with something
like "the ssh user and group", which would be more correct, but less
understandable.
2020-05-16 16:33:38 +02:00
dcfabf9268 [__cron] add hint for default values of time-related parameters
This should resolve some misunderstanding when leave a time-related
parameter with it's default value.
2020-05-16 14:00:02 +02:00
42f2dceeb1 [__link] fix typo in the manual 2020-05-09 18:40:44 +02:00
Nico Schottelius
d4059fd29e [__letsencrypt_cert] whitelist Ubuntu 2020-05-01 15:31:23 +02:00
Nico Schottelius
f58d662b32 [__pyvenv] Switch to python3 -m venv for ubuntu 2020-05-01 15:28:01 +02:00
8074f02bb3 Merge branch 'evilham-pf' into 'master'
[__pf*] (~) __pf_ruleset (+)__pf_apply_anchor, deprecate __pf_apply

See merge request ungleich-public/cdist!867
2020-04-26 09:59:24 +02:00
71156258a4 Merge branch 'evilham-postfix' into 'master'
[__postfix] Automagically support more OSs by not checking too much.

See merge request ungleich-public/cdist!866
2020-04-26 09:52:08 +02:00
c13608fab5 Merge branch 'evilham-openldap_server' into 'master'
[__openldap_server] Support extra config parameter.

See merge request ungleich-public/cdist!865
2020-04-26 09:50:21 +02:00
b40b95d758 Merge branch 'evilham-motd' into 'master'
[__motd] Improve documentation and support for FreeBSD

See merge request ungleich-public/cdist!864
2020-04-26 09:47:54 +02:00
6ec3274598 Merge branch 'postgres-database-args' into 'master'
Add --template, --encoding, --lc-collate, --lc-support to __postgres_database type

See merge request ungleich-public/cdist!859
2020-04-26 09:41:30 +02:00
2928795441 [__pf_ruleset] Fix shellcheck issue. 2020-04-25 14:54:29 +02:00
fefe90e9c9 [__pf*] (~) __pf_ruleset (+)__pf_apply_anchor, deprecate __pf_apply
__pf_apply the way it exists on cdist is not really useful and __pf_ruleset does
not take advantage of other types as it should, being instead overly complex and
not as reliable.

The new __pf_ruleset is compatible with the previous one, and __pf_apply_anchors
allows for a simple and powerful way of managing pf anchors.
The functionality previously provided by __pf_apply is still possible out of the
box in __pf_ruleset.

These patches were mostly contributed by Kamila Součková and made fit for
upstreaming by Evilham.
2020-04-25 12:23:27 +02:00
5981d0a5f1 [__postfix] Automagically support more OSs by not checking too much.
It is quite likely that the package is going to be called postfix, rather
than trying to have an exhaustive "allow list" for this package, we can
just add special cases for OSs where that is not the case (not aware of any
atm).
2020-04-25 00:22:28 +02:00
056c7c5400 [__openldap_server] Support extra config parameter.
This allows the user to, e.g. manually define ACLs, while this type does not
support that.
2020-04-25 00:12:24 +02:00
de37b0ce45 [__motd] Improve documentation and support for FreeBSD
This makes it easier to use the type just by reading the man page and also
treats FreeBSD's MOTD better.
2020-04-24 20:26:44 +02:00
Darko Poljak
38ccdfda32 Fix newly found shellcheck issues 2020-04-22 23:21:34 +02:00
c3f924d350 Add --template flag to __postgres_database type 2020-04-14 10:23:08 +02:00
d53077f4e8 Add --encoding, --lc-collate, --lc-support to __postgres_database type 2020-04-06 09:30:01 +02:00
Darko Poljak
890c73f6bd Fix shellcheck issues 2020-04-02 20:18:04 +02:00
Nico Schottelius
d034fe9369 [__pyvenv] use python3 -m venv on alpine
Until python4 comes, this will work
2020-04-02 18:24:13 +02:00
Nico Schottelius
0f639a9278 Make __cron nonparallel
It fails due to removal / edit of crontab at the same time

VERBOSE: [18331]: uncloud.ungleich.ch: Running object __cron/pg_dump_cleanup
VERBOSE: [18332]: uncloud.ungleich.ch: Running object __ungleich_packages/server
VERBOSE: [18335]: uncloud.ungleich.ch: Running object __postgres_role/app
INFO: [18335]: uncloud.ungleich.ch: Processing __postgres_role/app
INFO: [18331]: uncloud.ungleich.ch: Processing __cron/pg_dump_cleanup
ERROR: [16451]: uncloud.ungleich.ch: ssh -o User=root -o ControlPath=/tmp/tmp_8eu4oep/s -o ControlMaster=auto -o ControlPersist=2h uncloud.ungleich.ch /bin/sh -c ' export __object=/var/lib/cdist/object/__cron/pg_dumpall_under_day/.cdist-mfd00npk;  export __object_id=pg_dumpall_under_day;/bin/sh -e /var/lib/cdist/object/__cron/pg_dumpall_under_day/.cdist-mfd00npk/code-remote': ['ssh', '-o', 'User=root', '-o', 'ControlPath=/tmp/tmp_8eu4oep/s', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=2h', 'uncloud.ungleich.ch', "/bin/sh -c ' export __object=/var/lib/cdist/object/__cron/pg_dumpall_under_day/.cdist-mfd00npk;  export __object_id=pg_dumpall_under_day;/bin/sh -e /var/lib/cdist/object/__cron/pg_dumpall_under_day/.cdist-mfd00npk/code-remote'"]

Error processing object '__cron/pg_dumpall_under_day'
=====================================================
name: __cron/pg_dumpall_under_day
path: /tmp/tmplaq9cwdh/6318c251013a449595327745daacf3ee/data/object/__cron/pg_dumpall_under_day/.cdist-mfd00npk
source: /tmp/tmplaq9cwdh/6318c251013a449595327745daacf3ee/data/conf/type/__ungleich_postgresql/manifest
type: /home/nico/vcs/cdist/cdist/conf/type/__cron

code-remote:stderr
------------------
crontab: can't move 'postgres.new' to 'postgres': No such file or directory

VERBOSE: [16451]: config: Total processing time for 1 host(s): 13.98031210899353
[18:09] line:~%
2020-04-02 18:14:09 +02:00
1eb02f908b Merge branch 'fix/__package_update_index' into 'master'
[__package_update_index] Fix maxage false-positives on brand-new installations

See merge request ungleich-public/cdist!858
2020-03-29 13:53:55 +02:00
Darko Poljak
b25939cdd6 Fix shellcheck 2020-03-27 13:30:52 +01:00
11148995d1 Merge branch 'master' into 'master'
fix typo

See merge request ungleich-public/cdist!857
2020-03-27 08:50:29 +01:00
Nico Schottelius
66d9905029 [__consul_agent] make conf_dir depent on the OS 2020-03-26 21:48:17 +01:00
f00e4af5f0 fix typo 2020-03-26 21:17:32 +08:00
358e04b2af Handle specially if no time about the last index update found.
The explorer 'currage' now returns -1 if he can not find any value about
this. The gencode-remote script handle this value special to not exit if
-1 given as value.

This fixes the bug
  ungleich-public/cdist#803
2020-03-14 09:58:38 +01:00
fb32d6ed3f alpine uses a different getent lib which doesnt support: getent shadow 2020-03-08 16:04:02 +01:00
4b24d886eb Merge branch 'file/better-errors' into 'master'
[__file] Better errors analogous to __directory

See merge request ungleich-public/cdist!854
2020-02-26 21:50:01 +01:00
Dennis Camera
9eacba06bb [__file] Treat pre-exists as a special case in gencode-remote as it should never get there 2020-02-26 16:48:14 +01:00
Dennis Camera
46d2487f08 [__file] Give more precise error message when --state pre-exists 2020-02-26 16:40:53 +01:00
dd6b07d924 Merge branch 'directory-exists' into 'master'
[__directory] Add --state exists and --state pre-exists

See merge request ungleich-public/cdist!832
2020-02-26 16:33:37 +01:00
Dennis Camera
6b4b6534a1 [__directory] Give more precise error message when --state pre-exists 2020-02-26 16:15:23 +01:00
e6f683b886 Add support for alpine (edge) package to __consul_agent 2020-02-24 09:20:49 +01:00
47ec9ada10 Merge branch 'consul_agent' into 'master'
Refactor __consul_* for use with distribution packages

See merge request ungleich-public/cdist!837
2020-02-23 09:28:24 +01:00
e1b80f7222 Merge branch 'service' into 'master'
Add simple __service type

See merge request ungleich-public/cdist!847
2020-02-23 09:21:29 +01:00
a3bc8f9407 __update_alternatives: remove expired comment 2020-02-19 12:59:14 +02:00
b891bb05d5 __update_alternatives: add state explorer 2020-02-19 12:58:22 +02:00
09540dc6bd Add simple __service type 2020-02-17 21:38:03 +01:00
31ad1bdaad Fix various typos and styling errors in __consul_agent, conf-dir
explorer
2020-02-17 13:43:18 +01:00
f595664924 Patch __consul_* to discover remote consul configuration dir 2020-02-17 13:42:19 +01:00
70200cd28f Refactor __consul_agent type to support distribution packages 2020-02-17 13:42:19 +01:00
Darko Poljak
0640b02f90 Fix too short title underline 2020-02-15 14:59:12 +01:00
7acbc8709b Merge branch 'postgres-role-password' into 'master'
Fix password command synthax in __postgres_role

See merge request ungleich-public/cdist!845
2020-02-15 14:36:54 +01:00
a1536933ab Fix password command synthax in __postgres_role 2020-02-15 14:16:00 +01:00
221c3820ca Merge branch 'type/__systemd_service' into 'master'
[__systemd_service] new type to manage the state of systemd services

See merge request ungleich-public/cdist!844
2020-02-15 12:22:04 +01:00
b898412faf Merge branch 'fix/__cron' into 'master'
[__cron] Fix cronjob removal if `is` and `should` don't match

See merge request ungleich-public/cdist!841
2020-02-15 12:16:58 +01:00
ef089d1c61 [__systemd_service] new type to manage the state of systemd services 2020-02-15 11:42:01 +01:00
5e6e17b3e5 Moved default parameter values from scripts to cdist parameter handling.
For more generalisation, the default parameter values are now handled by
cdist instead of trying to get a value and use a default if parameter is
not given.

It handles the default values in a more general way, instead of write
one default in (possibly) multiple places.
Problem occurred when checking the 'state' parameter, which required to
set a default value in two places.
2020-02-15 09:46:23 +01:00
a761d4842c Add check for the state parameter in manifest.
This only allow following cases:
  - present
  - absent
else, it will abort with an error message.
2020-02-15 08:21:24 +01:00
c8dbd0718e Merge branch '__package_apt_updates_index' into 'master'
__package_apt: update index cache, on installation, when it is older than one day

See merge request ungleich-public/cdist!842
2020-02-14 21:57:04 +01:00
869a38676f __package_apt: add comment about package index update 2020-02-14 19:22:06 +02:00
1be5a9d316 __package_apt: add note about updating index 2020-02-14 19:19:12 +02:00
f771840178 __mysql_privileges: fix typo 2020-02-13 17:38:34 +02:00
b7483d73eb __mysql_privileges: fix shellcheck 2020-02-13 17:38:19 +02:00
710e99f240 __mysql_privileges: fix quoting 2020-02-13 17:29:44 +02:00
b3bad9468d __package_apt: pkgcache.bin may not exist 2020-02-09 20:43:09 +02:00
08d5814e2c __package_apt: update index cache, on installation, when it is older than one day 2020-02-09 20:37:06 +02:00
0edda3b528 Merge branch 'no-stat-patch' into 'master'
__file/__directory: Patch for systems without stat(1)

See merge request ungleich-public/cdist!839
2020-02-04 07:46:28 +01:00
Dennis Camera
3b5433d63a [__directory] stat explorer patch for systems without stat(1)
Some embedded systems (like OpenWrt) do not ship a stat(1) binary.
This workaround parses the output of ls(1) and /etc/passwd, /etc/group to
gather the information needed.
2020-02-03 18:36:59 +01:00
Dennis Camera
e82dd35869 [__file] stat explorer patch for systems without stat(1)
Some embedded systems (like OpenWrt) do not ship a stat(1) binary.
This workaround parses the output of ls(1) and /etc/passwd, /etc/group to
gather the information needed.
2020-02-03 18:36:59 +01:00
Nico Schottelius
2d8afe0d16 Merge branch 'master' of code.ungleich.ch:ungleich-public/cdist 2020-02-03 17:44:55 +01:00
Nico Schottelius
f3237e5d76 [consul agent] add support for Debian 10 2020-02-03 17:44:47 +01:00
e5d86ffc93 Fix to remove cronjobs when the cronjob expression did not match. 2020-02-01 17:08:25 +01:00
1fbd2fc2bd __acl: add --file and --directory for convenience 2020-01-19 22:51:40 +02:00
e1ac97b6a5 __acl: add --source 2020-01-19 14:02:00 +02:00
Darko Poljak
ffb3c003ca Merge branch 'ssrq/cdist-line-patches' 2020-01-17 18:07:14 +01:00
efdeab61f3 Merge branch '__apt_unattended_upgrades' into 'master'
__apt_unattended_upgrades

See merge request ungleich-public/cdist!828
2020-01-17 15:50:07 +01:00
65c5b592a5 __apt_unattended_upgrades: update manual 2020-01-17 14:48:54 +02:00
6097cd9e90 __apt_unattended_upgrades: use word expansions 2020-01-17 14:41:00 +02:00
ef2f4b9a00 __postgres_*: fix forgotten edge cases in delimited identifier escape 2020-01-17 11:24:24 +01:00
6fa0d687f7 __apt_unattended_upgrades: alternative approach 2020-01-16 01:13:27 +02:00
f5f70671cb __apt_unattended_upgrades: make parameters more speaking 2020-01-16 00:59:03 +02:00
Dennis Camera
5a9a1ba57f [__line] Produce error when file does not exist 2020-01-15 22:00:56 +01:00
b3f36dbe5b __apt_unattended_upgrades: fix typo 2020-01-15 20:51:47 +02:00
cd24a806e7 __apt_unattended_upgrades: rewrite manifest, add more parameters 2020-01-15 20:48:32 +02:00
Dennis Camera
2cf44c66d4 [__directory] Add --state exists and --state pre-exists 2020-01-15 19:00:30 +01:00
68e5502fce __apt_unattended_upgrades: move debian wiki link to manual 2020-01-15 19:27:02 +02:00
cd2d5b3f79 __apt_unattended_upgrades: all objects depend on package 2020-01-15 19:24:21 +02:00
Dennis Camera
51b1b11cc2 [__line/state] Logic fixes in explorer
This commit fixes the incorrectly reported state "wrongposition" if position is
"after" and anchor is present in the file but the line missing.
2020-01-15 17:57:45 +01:00
Dennis Camera
4cdb8aaa03 [__line/state] Make sure the index match is at the beginning
Without the == 1 all lines which contain --line as a substring match.  e.g. if
--line is "line" and the file contains the line "wrong line" this was considered
a match.
2020-01-15 17:50:43 +01:00
Dennis Camera
629d0795c8 [__line] Always add line to end if anchor is not found 2020-01-15 17:27:25 +01:00
Dennis Camera
93ec4b46aa [__line] Ensure the line is only added once 2020-01-15 17:27:25 +01:00
d4bd49bbb5 __acl: rename --acl to --entry for the sake of consistency, add compatibility 2020-01-04 17:43:57 +02:00
ec8d9571f9 __apt_unattended_upgrades: add manual 2020-01-04 17:07:46 +02:00
a9d491f998 __apt_unattended_upgrades: add license header 2020-01-04 16:59:42 +02:00