Skip to content
Snippets Groups Projects
  • Mark Goddard's avatar
    73df2767
    Use environment variables for plugin paths · 73df2767
    Mark Goddard authored
    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
    73df2767
    History
    Use environment variables for plugin paths
    Mark Goddard authored
    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