Commit Graph

1925 Commits

Author SHA1 Message Date
Dennis Camera 0d84c91b40 [explorer/init] Fix unique() for Solaris 2020-02-20 23:34:19 +01:00
Dennis Camera 364340c8d5 [explorer/init] Refactor and testing 2020-02-20 23:34:19 +01:00
Dennis Camera d895bb0e87 [explorer/init] Clean up 2020-02-20 23:34:19 +01:00
Dennis Camera 21c9e3db18 [explorer/init] Support more init systems 2020-02-20 23:34:11 +01:00
kjg 28d3760e29 [cdist]Update os_version for alpine 2020-02-20 09:40:55 +01:00
ander a3bc8f9407 __update_alternatives: remove expired comment 2020-02-19 12:59:14 +02:00
ander b891bb05d5 __update_alternatives: add state explorer 2020-02-19 12:58:22 +02:00
fnux 09540dc6bd Add simple __service type 2020-02-17 21:38:03 +01:00
fnux 31ad1bdaad Fix various typos and styling errors in __consul_agent, conf-dir
explorer
2020-02-17 13:43:18 +01:00
fnux f595664924 Patch __consul_* to discover remote consul configuration dir 2020-02-17 13:42:19 +01:00
fnux 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
poljakowski 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
fnux a1536933ab Fix password command synthax in __postgres_role 2020-02-15 14:16:00 +01:00
poljakowski 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
poljakowski 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
matze ef089d1c61 [__systemd_service] new type to manage the state of systemd services 2020-02-15 11:42:01 +01:00
matze 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
matze 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
poljakowski 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
ander 869a38676f __package_apt: add comment about package index update 2020-02-14 19:22:06 +02:00
ander 1be5a9d316 __package_apt: add note about updating index 2020-02-14 19:19:12 +02:00
ander f771840178 __mysql_privileges: fix typo 2020-02-13 17:38:34 +02:00
ander b7483d73eb __mysql_privileges: fix shellcheck 2020-02-13 17:38:19 +02:00
ander 710e99f240 __mysql_privileges: fix quoting 2020-02-13 17:29:44 +02:00
ander b3bad9468d __package_apt: pkgcache.bin may not exist 2020-02-09 20:43:09 +02:00
ander 08d5814e2c __package_apt: update index cache, on installation, when it is older than one day 2020-02-09 20:37:06 +02:00
poljakowski 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 984e0dc8c4 [explorer/os_release] Add fallbacks to /usr/lib/os-release and /var/run/os-release 2020-02-03 19:29:04 +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
matze e5d86ffc93 Fix to remove cronjobs when the cronjob expression did not match. 2020-02-01 17:08:25 +01:00
Dennis Camera 4fe2dcba89 [explorer/init] Linux is a mess... 2020-01-30 18:35:50 +01:00
Dennis Camera de1a421b68 [explorer/init] Support for Darwin and more BusyBox combinations 2020-01-30 18:04:00 +01:00
ander 1fbd2fc2bd __acl: add --file and --directory for convenience 2020-01-19 22:51:40 +02:00
ander 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
poljakowski 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
ander 65c5b592a5 __apt_unattended_upgrades: update manual 2020-01-17 14:48:54 +02:00
ander 6097cd9e90 __apt_unattended_upgrades: use word expansions 2020-01-17 14:41:00 +02:00
fnux ef2f4b9a00 __postgres_*: fix forgotten edge cases in delimited identifier escape 2020-01-17 11:24:24 +01:00
ander 6fa0d687f7 __apt_unattended_upgrades: alternative approach 2020-01-16 01:13:27 +02:00
ander 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
ander b3f36dbe5b __apt_unattended_upgrades: fix typo 2020-01-15 20:51:47 +02:00
ander 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
ander 68e5502fce __apt_unattended_upgrades: move debian wiki link to manual 2020-01-15 19:27:02 +02:00
ander 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
Darko Poljak 3258fc98e1 Fix typo 2020-01-12 12:19:49 +01:00
Darko Poljak 3f133dbc17 Info command: support tilde expansion 2020-01-11 15:26:46 +01:00
Darko Poljak 11f569959d Fix missing configuration file usage, support -g
PreOS code did not use configuration support. This fix adds support
for using cdist configuration, which takes into account cdist
configuration file, environment variables and command line options,
especially conf_dir.

It also adds support for -g, --config-file option, for specifying
custom configuration file.
2020-01-11 14:16:33 +01:00
ander d4bd49bbb5 __acl: rename --acl to --entry for the sake of consistency, add compatibility 2020-01-04 17:43:57 +02:00
ander ec8d9571f9 __apt_unattended_upgrades: add manual 2020-01-04 17:07:46 +02:00
ander a9d491f998 __apt_unattended_upgrades: add license header 2020-01-04 16:59:42 +02:00
ander 94e32dcd78 __apt_unattended_upgrades: initial commit 2020-01-04 16:36:44 +02:00
poljakowski 1fc845480e Merge branch '__mysql' into 'master'
rewrite __mysql_database, add types __mysql_user and __mysql_privileges

See merge request ungleich-public/cdist!827
2020-01-04 13:45:15 +01:00
Darko Poljak e4596593c0 Add cdist info command 2020-01-04 12:50:12 +01:00
ander 4329cced82 __mysql_privileges: add manual 2020-01-03 18:55:55 +02:00
ander 5e8dc7122d __mysql_user: add manual 2020-01-03 18:48:11 +02:00
ander fcc774cb7b __mysql_database: add manual 2020-01-03 18:33:23 +02:00
ander 24862e0208 __mysql_database: carry over state 2020-01-03 18:26:11 +02:00
ander 9a693537f4 __mysql_*: add license headers 2020-01-01 12:38:12 +02:00
ander c32e4040b1 __mysql_*: initial rewrite 2019-12-31 19:16:49 +02:00
fnux beb930c0dc __postgres_*: use delimited identifiers (double quoted) in generated SQL 2019-12-31 11:34:51 +01:00
Steven Armstrong df05abd15b bugfix: __install_chroot_umount was not using __chroot_umount/manifest
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
2019-12-19 12:33:47 +01:00
Nico Schottelius f407e8825f [consul/alpine] no init script required to be deployed anymore 2019-12-15 22:56:16 +01:00
Darko Poljak bd4eee7925 Fix shellcheck reported issues 2019-12-12 07:37:32 +01:00
poljakowski c58c4b8309 Merge branch 'evilham-openldap' into 'master'
[new-type] __openldap_server

See merge request ungleich-public/cdist!822
2019-12-10 19:33:33 +01:00
evilham 3ba230c10d [type-docs] __start_on_boot: remove unspported *BSD claim.
The type appears to support {Open,Free}BSD properly.
2019-12-10 13:12:54 +01:00
evilham 35f0d4dbfa [new-type] __openldap_server: another documentation typo. 2019-12-10 13:10:19 +01:00
evilham 79d58f0813 [new-type] __openldap_server: fix docs / dependency.
It's nicer to have slapd_flags after slapd_enable in rc.conf on freebsd.
2019-12-10 13:04:24 +01:00
evilham 22c5cd550b [new-type] __openldap_server: first public version.
This already takes care of setting up the base DN and managing it as well as
allowing for settings for the listener URLS.

The type was also made a singleton as it doesn't make much sense to setup
multiple LDAP servers on the same machine.
2019-12-10 12:49:07 +01:00
evilham 42914d26c5 [new-type] __openldap_server: sudo make nico.happy. 2019-12-09 19:59:15 +01:00
evilham 1ad605a509 [new-type] __openldap_server: Add admin-email parameter. 2019-12-09 19:49:05 +01:00
evilham fd430eab62 [new-type] __openldap_server: Add a "schema" optional parameter. 2019-12-09 19:39:43 +01:00
evilham bee95efa43 [new-type] __openldap_server
Originally developed at ungleich and improved for Open Sourcing by Evilham.
2019-12-09 19:13:10 +01:00
Darko Poljak 4735df1bed Add plugins-dir preos option 2019-12-09 09:48:12 +01:00
poljakowski fb97574592 Merge branch 'master' into 'master'
[docs] PreOS: English nitpicking

See merge request ungleich-public/cdist!820
2019-12-06 19:46:29 +01:00
Darko Poljak f22349ce8a Fix documentation for install types
Fixes gitlab #790.
2019-12-06 09:00:16 +01:00
evilham 58cbe53e61 Merge branch 'master' of https://code.ungleich.ch/ungleich-public/cdist 2019-12-05 23:15:11 +01:00
evilham 4f21bf534d [docs] PreOS: English nitpicking. 2019-12-05 23:14:27 +01:00
Dominique Roux d25c72e678 [PACKAGE-UPDATE-INDEX]: Bugfix of the alpine part of the __package_update_index type 2019-12-03 10:13:46 +01:00
Darko Poljak da274e5ef3 Redefine/reimplement CDIST_ORDER_DEPENDENCY
CDIST_ORDER_DEPENDENCY now defines type order dependency context.
cdist (emulator) maintains global state variables, as files,
order_dep_state and typeorder_dep, and per object state variable,
as file, typeorder_dep.

If order_dep_state exists then this defines that order dependency is
turned on.
If order_dep_state does not exist then order dependency is turned off.

If order dependency is on then objects created after it is turned on are
recorded into:
    * global typeorder_dep, in case of init manifest
    * object's typeorder_dep, in case of type's manifest.

If order dependency is on then requirement is injected, where object
created before current, is read from:
    * global typeorder_dep, in case of init manifest
    * object's typeorder_dep, in case of type's manifest.

Every time order dependency is turned off, typeorder_dep files are
removed, which means that type order list is cleared, context is
cleaned.

In the end cdist cleans after itself, i.e. mentioned files are removed.

When running type manifest is finished typeorder_dep file is removed.
When running config finishes global typeorder_dep and order_dep_state
files are removed.

Global type order recording is untouched.
Furthermore, for completeness, type order is now recorded for each object
too.
2019-11-27 15:04:47 +01:00
Darko Poljak 3d3b59ab87 Add pycodestyle ignores 2019-11-27 14:59:25 +01:00
Darko Poljak c01aa576de Add/keep empty directories 2019-11-27 14:51:28 +01:00
Darko Poljak d1c3264cce Revert "Merge branch '__clean_path_use_types' into 'master'"
This reverts commit 073523be38, reversing
changes made to 56435492a0.
2019-11-26 17:58:25 +01:00
ander 2848a6a0f4 __clean_path: use __directory and __file types for better clarity 2019-11-25 21:52:00 +02:00
moep 64b07af4ab give error msg to stderr 2019-11-24 17:18:34 +01:00
ander 4ed18e3446 __hostname: silence grep exit 1, when os_version is not numeric
on Debian Sid os_version returns 'bullseye/sid'
2019-11-22 18:56:34 +02:00
ander 01bd01573e __apt_key: use mktemp for unique temporary gpg home 2019-11-21 14:15:51 +02:00
poljakowski 96ffb4fd02 Merge branch 'xymon_client-msgcache' into 'master'
add `--msgcache`-parameter to support passive clients (__xymon_client)

See merge request ungleich-public/cdist!811
2019-11-20 20:59:10 +01:00
tom 552860b9cd add parameters for ownership and generic rsync-options (__xymon_config) 2019-11-20 15:49:25 +01:00
tom 34bd96db4b add `--msgcache`-parameter to support passive clients (__xymon_client)
Fix a typo along the way, too.
2019-11-20 15:47:25 +01:00