kayobe/releasenotes/notes/plugin-env-vars-e6265564b3441dfe.yaml
Mark Goddard 73df27677c Use environment variables for plugin paths
Kayobe provides various roles and plugins in the ansible directory.
These are accessible to Kayobe playbooks in the same directory.

In some cases it can be useful to use these items from Kayobe custom
playbooks, however they cannot since they reside in a different
directory. Typically we work around this by symlinking to the relevant
directory from the directory containing the custom playbook. This is not
an elegant workaround, and has assumptions about the relative paths of
the Kayobe configuration and virtual environment in which Kayobe is
installed.

This change adds the Kayobe role, collection, and plugin paths to the
relevant Ansible lookup paths using environment variables. This allows
custom playbooks to use these items. Also added to the lookup paths are
roles, collections and plugins in Kayobe configuration in the
etc/kayobe/ansible/ directory. This removes the limitation of playbooks
needing to reside in the same directory as those items in order to use
them.

We import the Ansible configuration settings module directly, since it
avoids replicating the configuration logic.

Story: 2010280
Task: 46234

Change-Id: I2fb2b4d7ed937e0184a62b0f119659569448f8df
2022-12-14 22:52:41 +01:00

12 lines
469 B
YAML

---
features:
- |
Roles, collections and plugins included with Kayobe configuration are now
accessible to all Kayobe playbook executions.
upgrade:
- |
Changes the environment used during Kayobe playbook execution to include
Kayobe's collections, roles and plugins in the Ansible lookup paths.
This allows custom playbooks to use these items, without the requirement to
symlink into the Kayobe installation. Existing symlinks may be removed.