For more information on the preset logic please have a look at the Presets document.
It is not recommended to ship preset files within the respective software packages implementing the units, but rather centralize them in a distribution or spin default policy, which can be amended by administrator policy.
If no preset files exist, systemctl preset will enable all units that are installed by default. If this is not desired and all units shall rather be disabled, it is necessary to ship a preset file with a single, catchall "disable *" line. (See example 1, below.)
Presets must refer to the "real" unit file, and not to any aliases. See systemd.unit(5) for a description of unit aliasing.
Two different directives are understood: "enable" may be used to enable units by default, "disable" to disable units by default.
If multiple lines apply to a unit name, the first matching one takes precedence over all others.
Each preset file shall be named in the style of <priority>-<policy-name>.preset. Files in /etc/ override files with the same name in /usr/lib/ and /run/. Files in /run/ override files with the same name in /usr/lib/. Packages should install their preset files in /usr/lib/. Files in /etc/ are reserved for the local administrator, who may use this logic to override the preset files installed by vendor packages. All preset files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same unit name, the entry in the file with the lexicographically earliest name will be applied. It is recommended to prefix all filenames with a two-digit number and a dash, to simplify the ordering of the files.
If the administrator wants to disable a preset file supplied by the vendor, the recommended way is to place a symlink to /dev/null in /etc/systemd/system-preset/ bearing the same filename.
# /usr/lib/systemd/system-preset/99-default.preset disable *
This disables all units. Due to the filename prefix "99-", it will be read last and hence can easily be overridden by spin or administrator preset policy.
Example 2. Enable multiple template instances
# /usr/lib/systemd/system-preset/80-dirsrv.preset enable dirsrv@.service foo bar baz
This enables all three of firstname.lastname@example.org, email@example.com and firstname.lastname@example.org.
Example 3. A GNOME spin
# /usr/lib/systemd/system-preset/50-gnome.preset enable gdm.service enable colord.service enable accounts-daemon.service enable avahi-daemon.*
This enables the three mentioned units, plus all avahi-daemon regardless of which unit type. A file like this could be useful for inclusion in a GNOME spin of a distribution. It will ensure that the units necessary for GNOME are properly enabled as they are installed. It leaves all other units untouched, and subject to other (later) preset files, for example like the one from the first example above.
Example 4. Administrator policy
# /etc/systemd/system-preset/00-lennart.preset enable httpd.service enable sshd.service enable postfix.service disable *
This enables three specific services and disables all others. This is useful for administrators to specifically select the units to enable, and disable all others. Due to the filename prefix "00-" it will be read early and override all other preset policy files.