Welcome to the first of Enroll's new, erm, news section! To celebrate, Enroll 0.7.0 has been released, and makes manifest rendering target-selectable. Ansible remains the default, but Puppet and Salt are now first-class manifest targets rather than ad-hoc exports.
Highlights
--target puppetrenders Puppet module/control-repo style output., and in--fqdnmode, renders per-host Hiera data.--target saltrenders Salt state trees and, in--fqdnmode, Salt pillar data.- Ansible works basically as it always did, and is the default, but you can specify
--target ansibletoo. As usual, in--fqdnmode, specific artifacts end up inhost_varsinventory folders rather than polluting the 'golden' roles. - All three config management manifest renderers derive from the same harvest state. You can rendered repeatedly into different config management tools without re-harvesting the host!
- Single-site output tries to combine package/service data by their package manager's
Section(or equivalent metadata), to reduce role/module/state sprawl. - Flatpak and Snap detection!
Dry-run examples
$ enroll harvest --out ./harvest
$ enroll manifest --harvest ./harvest --target ansible --out ./ansible
$ ansible-playbook -i "localhost," -c local ./ansible/playbook.yml --check --diff
$ enroll manifest --harvest ./harvest --target puppet --out ./puppet
$ puppet apply --modulepath ./puppet/modules ./puppet/manifests/site.pp --noop
$ enroll manifest --harvest ./harvest --target salt --out ./salt
$ salt-call --local --file-root ./salt/states state.apply test=True
New grouping behaviour in roles/modules
Did you find the number of manifested roles overwhelming?
Previously, Enroll created an Ansible role (or, now, a Puppet module or Salt role) for pretty much every 'package' it found. In some cases (especially on desktops) this could result in hundreds of roles. Technically fine, but overwhelming to look at!
As of 0.7.0, where Enroll can read that package metadata, it groups related package and service snapshots by the package manager's Section category (or comparable backend metadata), to make it less noisy. For example, network-related packages and config files might end up in a role called net. Meanwhile, vim, nano might both appear in editors, and mutt and Thunderbird may be in mail.
If you're not a fan of this new layout, you can pass --no-common-roles to enforce the previous behaviour. Also, if you use --fqdn for host-specific data-driven output, the 'common' roles are disabled automatically, because it's then safer to avoid 'bleed in' of unnecessary package installation on other hosts from a role that otherwise 'assumes too much' for all hosts.
Flatpak and Snap detection
Beyond deb and rpm
When using Ansible, Enroll now attempts to detect Flatpak and Snaps present on the system. For Flatpaks, this includes user-specific Flatpaks as well as system-wide ones. Manifesting to Ansible will attempt to use the community.general collection to create Flatpak and Snap tasks to enforce the presence of those packages.
$ sudo ansible-playbook playbook.yml -i localhost, -c local --tags role_snap --diff
PLAY [Apply all roles on all hosts] *******************************************************************************************************************************************************************************
TASK [Gathering Facts] ********************************************************************************************************************************************************************************************
ok: [localhost]
TASK [snap : Install system-wide snaps with full detected attributes] *********************************************************************************************************************************************
ok: [localhost] => (item={'channel': 'latest/stable', 'classic': False, 'dangerous': False, 'devmode': False, 'install_revision': False, 'name': 'bare', 'notes': ['base'], 'revision': 5, 'source': 'snap-list'})
ok: [localhost] => (item={'channel': 'latest/stable', 'classic': False, 'dangerous': False, 'devmode': False, 'install_revision': False, 'name': 'core24', 'notes': ['base'], 'revision': 1643, 'source': 'snap-list'})
ok: [localhost] => (item={'channel': 'latest/stable', 'classic': False, 'dangerous': False, 'devmode': False, 'install_revision': False, 'name': 'gnome-46-2404', 'notes': [], 'revision': 153, 'source': 'snap-list'})
ok: [localhost] => (item={'channel': 'latest/stable', 'classic': False, 'dangerous': False, 'devmode': False, 'install_revision': False, 'name': 'gtk-common-themes', 'notes': [], 'revision': 1535, 'source': 'snap-list'})
ok: [localhost] => (item={'channel': 'latest/stable', 'classic': False, 'dangerous': False, 'devmode': False, 'install_revision': False, 'name': 'mesa-2404', 'notes': [], 'revision': 1165, 'source': 'snap-list'})
ok: [localhost] => (item={'channel': 'latest/stable', 'classic': False, 'dangerous': False, 'devmode': False, 'install_revision': False, 'name': 'onionshare', 'notes': [], 'revision': 212, 'source': 'snap-list'})
ok: [localhost] => (item={'channel': 'latest/stable', 'classic': False, 'dangerous': False, 'devmode': False, 'install_revision': False, 'name': 'snapd', 'notes': ['snapd'], 'revision': 26865, 'source': 'snap-list'})
Please be aware that you need version 13+ of the community.general collection for this to work properly. A requirements.yml gets created with your manifest to help you install it if necessary.
Other smaller changes
sysctlruntime parameters are now detected and would be written to/etc/sysctl.d/99-enroll.conf. Not all runtime parameters are supported..bashrcand similar files are now only harvested from user directories when--dangerousis used, since this is a common place for sensitive environment variables to be set. As always, remember that--dangerousgives better harvest coverage, but you should use--sopsor some other means of your own to encrypt the harvested data at rest safely!- Some output during an Ansible play is hidden with
no_logto avoid potentially sensitive output, particularly of systemd unit state. - In case you missed it in version 0.6.0: Enroll now harvests runtime
iptablesandipsetrules!
See you soon..
I'm off to try and write more tests - we're at 84% coverage in pytest, and we also run a stack of 'noop' executions for Ansible, Puppet and Salt too now, in CI.
Thanks to everyone who has reached out with suggestions, constructive criticism, and bug reports! You're helping make Enroll better for everyone.