Skip to content

Commit

Permalink
SYNC with production 4-May-2022 (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
basvandervlies authored May 4, 2022
1 parent ecd8754 commit 9ac838d
Show file tree
Hide file tree
Showing 38 changed files with 110 additions and 64 deletions.
19 changes: 19 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<!-- vim-markdown-toc GFM -->

* [Version: 1.3.0 (2022-05-04)](#version-130-2022-05-04)
* [Version: 1.2.0 (2022-01-26)](#version-120-2022-01-26)
* [scl_service_rotate_files](#scl_service_rotate_files)
* [Version: 1.1.0 (2021-12-21)](#version-110-2021-12-21)
Expand All @@ -26,6 +27,24 @@
* [Version: 0.9.0 (2018-08-24)](#version-090-2018-08-24)

<!-- vim-markdown-toc -->
# Version: 1.3.0 (2022-05-04)

SCL enhancements:
* `lib/scl/services.cf`: Always run `bundle common <service` then all variables are resolved. All services are adjusted

These services have bug fixes or new features:
* jupyterhub:
* `JUPYTERHUB_SERVICE_PREFIX` was set incorrectly must end with `/`
* munge:
* Added a template file and adjusted default.json. So we can specify the daemon options
* node\_exporter:
* when service file has been changed reload the systemd
* resolv:
* Change header of the mustache file
* slurm:
* added `prolog_section` definition to json/mustache
* `default.json` has been adjusted to slurm version 21.08

# Version: 1.2.0 (2022-01-26)

The SCL enhancements:
Expand Down
3 changes: 3 additions & 0 deletions masterfiles/lib/scl/services.cf
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ bundle agent scl_services_autorun
"" usebundle => scl_services_data_expand(),
comment => "Expand cross reference bundle variables";

"" usebundle => "$(scl_services.enabled)",
comment => "Always run the service bundle, mostly it is the common bundle";

"" usebundle => scl_services_run("$(scl_services.enabled)");

reports:
Expand Down
3 changes: 1 addition & 2 deletions services/apache.cf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

bundle agent apache
bundle common apache()
{
vars:

Expand Down Expand Up @@ -203,7 +203,6 @@ bundle agent apache_autorun()

methods:
debian|sles::
"" usebundle => apache();
"" usebundle => apache_install();
"" usebundle => apache_config();
"" usebundle => apache_daemon_check();
Expand Down
1 change: 0 additions & 1 deletion services/apt.cf
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ bundle agent apt_autorun()

methods:
any::
"" usebundle => scl_data_autorun("apt");
"" usebundle => apt_install();
"" usebundle => apt_repository();
"" usebundle => apt_auth_conf();
Expand Down
6 changes: 6 additions & 0 deletions services/check_space.cf
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#
## check_space.cf @SURF
#
bundle common check_space()
{
vars:
"version" string => "0.0.1";
}

bundle agent check_space_autorun()
{
meta:
Expand Down
1 change: 0 additions & 1 deletion services/chrony.cf
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ bundle agent chrony_autorun()

methods:
any::
"" usebundle => scl_data_autorun("chrony");
"" usebundle => chrony_install();
"" usebundle => chrony_config();
"" usebundle => chrony_daemons_check();
Expand Down
2 changes: 1 addition & 1 deletion services/configurable_http_proxy.cf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
## configurable_http_proxy.cf @SURF
#
bundle agent configurable_http_proxy
bundle common configurable_http_proxy
{
vars:
}
Expand Down
10 changes: 8 additions & 2 deletions services/copy_dirs.cf
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
#
## copy_dirs.cf @SURF
#
bundle agent copy_dirs()
bundle common copy_dirs()
{
vars:
"version" string => "0.0.1";
}


bundle agent copy_dirs_autorun()
{
meta:
"tags" slist => { "service_copy_dirs", "template_copy_dirs" };

methods:
any::
"" usebundle => scl_data_autorun("copy_dirs");
"" usebundle => copy_dirs_config();
}

Expand Down
1 change: 0 additions & 1 deletion services/dhclient.cf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ bundle agent dhclient_autorun()

methods:
any::
"" usebundle => scl_data_autorun("dhclient");
"" usebundle => dhclient_config();

}
Expand Down
4 changes: 1 addition & 3 deletions services/enroot.cf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
## enroot.cf @SURF
#
bundle agent enroot()
bundle common enroot()
{
vars:
any::
Expand All @@ -16,8 +16,6 @@ bundle agent enroot_autorun()
"tags" slist => { "service_enroot", "template_enroot" };

methods:
"" usebundle => enroot();
"" usebundle => scl_data_autorun("enroot");
"" usebundle => enroot_install();
"" usebundle => enroot_config();
}
Expand Down
3 changes: 1 addition & 2 deletions services/jupyterhub.cf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
## jupyterhub.cf @SURF
#
bundle agent jupyterhub
bundle common jupyterhub
{
vars:
any::
Expand All @@ -21,7 +21,6 @@ bundle agent jupyterhub_autorun()

methods:
any::
"" usebundle => scl_data_autorun("jupyterhub");
"" usebundle => jupyterhub_install();

JUPYTERHUB_SERVER::
Expand Down
27 changes: 23 additions & 4 deletions services/munge.cf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ bundle common munge()
any::
"config_dir" string => "/etc/munge";
"munge_key_file" string => "$(config_dir)/munge.key";

any::
"service_name" string => "munge";
"packages" data => parsejson('
{
Expand All @@ -15,6 +13,15 @@ bundle common munge()
}
');

## Mustache templates
"template_2_destination" data => parsejson('
{
"munge.mustache" : "$(default_file)"
}
');
debian::
"service_name" string => "munge";
"default_file" string => "/etc/default/$(service_name)";
systemd::
"restart" string => "$(paths.path[systemctl]) restart $(service_name)";
!systemd::
Expand Down Expand Up @@ -81,9 +88,12 @@ bundle agent munge_config()
any::
"" usebundle => munge_daemons_restart(),
if => or(
canonify("scl$(munge.munge_key_file)")
canonify("scl$(munge.munge_key_file)"),
canonify("scl$(munge.default_file)")
);

"" usebundle => scl_template_autorun("munge");

munge_copy_files_set::
"" usebundle => scl_service_copy_files("munge");

Expand All @@ -100,6 +110,14 @@ Source: [munge.cf](/services/munge.cf)
This bundle copies a munge key to a node.
* `/etc/munge/munge.key`

This bundle will install munge and configure the following files with mustache templates:
* /etc/default/munge (debian)

These files will be generated with the aid of mustache templates with json data.
the templates are located in:
* templates/scl/munge/
* templates/scl/munge/json

This bundle also makes sure that the proper owner (munge:munge) and permissions (400) are set.

The following json variables can be set in def.cf/json to invoke files bundles:
Expand All @@ -124,7 +142,7 @@ and extra json file(s) can be specified via:
```
vars:
any::
"munge_json_files" slist => { "lisa.json" }s
"munge_json_files" slist => { "lisa.json" }
```

The variable must be `cron_json_files` and with this setup 1 extra json file will be merged.
Expand All @@ -140,6 +158,7 @@ To debug this bundle set the `DEBUG_munge` class:
See [default.json](/templates/munge/json/default.json) what the default values are and
which variables can be overriden.


### copy_files

With this variable is set it will copy the specified file (usually the munge key) to the
Expand Down
15 changes: 10 additions & 5 deletions services/node_exporter.cf
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ bundle common node_exporter()
}
');

"reload" string => "$(paths.path[systemctl]) reload $(service_name)";
"restart" string => "$(paths.path[systemctl]) restart $(service_name)";
"daemon_reload" string => "$(paths.path[systemctl]) daemon-reload";
"reload" string => "$(paths.path[systemctl]) reload $(service_name)";
"restart" string => "$(paths.path[systemctl]) restart $(service_name)";

!systemd::
"template_2_destination" data => parsejson('
Expand Down Expand Up @@ -56,10 +57,15 @@ bundle agent node_exporter_config()
any::
"" usebundle => scl_mustache_autorun("node_exporter");
node_exporter_cron::
"" usebundle => scl_make_cron_file("sys2prometheus","@(scl.node_exporter[cron_job])");
"" usebundle => scl_make_cron_file("sys2prometheus", "@(scl.node_exporter[cron_job])");

commands:
systemd::
"$(node_exporter.daemon_reload)"
if => or(
canonify("scl$(node_exporter.systemd_file)")
);

"$(node_exporter.restart)"
if => or(
canonify("scl$(node_exporter.systemd_file)"),
Expand All @@ -79,12 +85,12 @@ bundle agent node_exporter_config()

"$(node_exporter.systemd_file)"
perms => mog("644", "root", "root");

}

bundle agent node_exporter_restart
{
commands:
"$(node_exporter.daemon_reload)";
"$(node_exporter.restart)";
}

Expand Down Expand Up @@ -123,7 +129,6 @@ bundle agent node_exporter_autorun()
"tags" slist => { "service_node_exporter", "template_node_exporter" };

methods:
"" usebundle => scl_data_autorun("node_exporter");
"" usebundle => node_exporter_install();
"" usebundle => node_exporter_config();
"" usebundle => node_exporter_daemon_check();
Expand Down
1 change: 0 additions & 1 deletion services/nscd.cf
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ bundle agent nscd_autorun()

methods:
any::
"" usebundle => scl_data_autorun("nscd");
"" usebundle => nscd_install();
"" usebundle => nscd_config();
"" usebundle => nscd_daemons_check();
Expand Down
4 changes: 1 addition & 3 deletions services/nsswitch.cf
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
#
# bundle to create nsswitch.conf @SURF
#
bundle common nsswitch(params)
bundle common nsswitch()
{
vars:

any::
"config_dir" string => "/etc";
"file" string => "$(config_dir)/nsswitch.conf";
Expand All @@ -24,7 +23,6 @@ bundle agent nsswitch_autorun()
"tags" slist => { "service_nsswitch", "template_nsswitch" };

methods:
"config" usebundle => scl_data_autorun("nsswitch");
"config" usebundle => nsswitch_config();

reports:
Expand Down
1 change: 0 additions & 1 deletion services/ntp.cf
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ bundle agent ntp_autorun()

methods:
any::
"" usebundle => scl_data_autorun("ntp");
"" usebundle => ntp_install();
"" usebundle => ntp_config();
"" usebundle => ntp_daemons_check();
Expand Down
1 change: 0 additions & 1 deletion services/nvidia_gpu_prometheus_exporter.cf
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ bundle agent nvidia_gpu_prometheus_exporter_autorun()
"tags" slist => { "service_nvidia_gpu_prometheus_exporter", "template_nvidia_gpu_prometheus_exporter" };

methods:
"" usebundle => scl_data_autorun("nvidia_gpu_prometheus_exporter");
"" usebundle => nvidia_gpu_prometheus_exporter_install();
"" usebundle => nvidia_gpu_prometheus_exporter_config();
"" usebundle => nvidia_gpu_prometheus_exporter_daemon_check();
Expand Down
1 change: 0 additions & 1 deletion services/pam.cf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ bundle agent pam_autorun()

methods:
any::
"" usebundle => scl_data_autorun("pam");
"" usebundle => pam_install();
"" usebundle => pam_config();

Expand Down
1 change: 0 additions & 1 deletion services/pam_radius.cf
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ bundle agent pam_radius_autorun()

methods:
any::
"" usebundle => scl_data_autorun("pam_radius");
"" usebundle => pam_radius_install();
"" usebundle => pam_radius_config();
}
Expand Down
15 changes: 8 additions & 7 deletions services/pkg_management.cf
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
#
## package_management.cf @SURF
#
bundle common pkg_management()
{
vars:
"version" string => "0.0.2";
}


bundle agent pkg_management_autorun()
{
meta:
"tags" slist => { "service_pkg_management", "template_pkg_management" };

methods:
"" usebundle => scl_data_autorun("pkg_management");
"" usebundle => pkg_management();
}

bundle agent pkg_management()
{
vars:
any::
"names" slist => getindices("scl.pkg_management"),
comment => "Get all package names";

methods:
PKG_MANAGEMENT_PRIO_BACKPORTS::
"" usebundle => pkg_management_prio_backport_packages("@(pkg_management.names)"),
"" usebundle => pkg_management_prio_backport_packages("@(pkg_management_autorun.names)"),
comment => "Priorize backports packages";

any::
Expand Down
1 change: 0 additions & 1 deletion services/postfix.cf
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ bundle agent postfix_autorun()

methods:
any::
"" usebundle => scl_data_autorun("postfix");
"" usebundle => postfix_install();
"" usebundle => scl_service_copy_dirs("postfix"),
if => "postfix_copy_dirs_set";
Expand Down
2 changes: 1 addition & 1 deletion services/rootfiles.cf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
## rootfiles.cf @SURF
#
bundle common rootfiles(params)
bundle common rootfiles()
{
vars:
any::
Expand Down
Loading

0 comments on commit 9ac838d

Please sign in to comment.