Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Depend variables default way to indicate source role name #296

Open
ypid opened this issue Aug 21, 2016 · 5 comments
Open

Depend variables default way to indicate source role name #296

ypid opened this issue Aug 21, 2016 · 5 comments

Comments

@ypid
Copy link
Member

ypid commented Aug 21, 2016

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.

@ypid
Copy link
Member Author

ypid commented Aug 23, 2016

@drybjed Or

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

?

@drybjed
Copy link
Member

drybjed commented Aug 24, 2016

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

@ypid
Copy link
Member Author

ypid commented Aug 24, 2016

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?

@drybjed
Copy link
Member

drybjed commented Aug 24, 2016

Sure, sounds good.

@ypid
Copy link
Member Author

ypid commented Aug 24, 2016

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'

ypid added a commit to ypid/ansible-dnsmasq that referenced this issue Aug 27, 2016
ypid added a commit to ypid/ansible-redis that referenced this issue Aug 30, 2016
ypid added a commit to ypid/ansible-ferm that referenced this issue Sep 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants