debops / debops-playbooks

Ansible playbooks used by DebOps project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Depend variables default way to indicate source role name

ypid opened this issue · comments

Edited, current approved version

Various roles in DebOps expose dependency variables for other roles to use. Example ferm__dependent_rules of debops.ferm.

There have been a number of changes in the format how to do this.

The recommended format is:

  - something: 'something'
    by_role: 'ROLE_OWNER.ROLE_NAME'
# and
  - something: 'something'
    by_role:: 'debops.nginx'

This applies for all roles. Other keys like role are deprecated and might be used for other purposes later.
The role which exposes/provides dependency variables has to take care of properly sanitizing the role name. This can be done by replace(".", "_") in case the value is used as part of a file name.

@drybjed Or

  - something: 'something'
    role: 'debops.nginx'

?

The use of debops.nginx is probably better since it's more explicit, and there could be other nginx roles in use.

It is just not widely used in DebOps yet. Probably also because file names are generated based on that. I would propose to sanitize the role (name) then with (replace(".", "_")). Sounds good?

Sure, sounds good.

Updated my first comment with the currently approved version based on a discussion with @drybjed. Example:

  - something: 'something'
    by_role: 'ROLE_OWNER.ROLE_NAME'
# and
  - something: 'something'
    by_role:: 'debops.nginx'