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

Please autotag roles with the role name #17434

Closed
agx opened this issue Sep 7, 2016 · 2 comments
Closed

Please autotag roles with the role name #17434

agx opened this issue Sep 7, 2016 · 2 comments
Labels
affects_2.2 This issue/PR affects Ansible v2.2 feature This issue/PR relates to a feature request. has_pr This issue has an associated PR. support:core This issue/PR relates to code supported by the Ansible Engineering Team.

Comments

@agx
Copy link
Contributor

agx commented Sep 7, 2016

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

Core

ANSIBLE VERSION
$ ansible --version
ansible 2.2.0 (devel 4ed88512e4) last updated 2016/09/07 08:35:44 (GMT +200)
  lib/ansible/modules/core: (detached HEAD 5a5c1491ae) last updated 2016/09/07 08:37:39 (GMT +200)
  lib/ansible/modules/extras: (detached HEAD 1474bde864) last updated 2016/09/07 08:37:39 (GMT +200)
  config file = /var/scratch/src/ansible/ansible/ansible.cfg
  configured module search path = Default w/o overrides

CONFIGURATION
OS / ENVIRONMENT

Debian unstable

SUMMARY

Please autotag roles with the role name:

I always end up writing code like:

roles:
  - { role: webserver, tags: [ 'webserver' ] }
  - { role: proxy, tags: [ 'proxy' ] }
  - { role: foobar, tags: [ 'foobar' ] }

This allows to run and test roles independently (otherwise they'd had dependencies on each other anyway) like:

ansible-playbook -i localhost, -l localhost play.yml -t foobar

Now it would be nice if the all tasks in a role would automatically get tagged with the role name so this would become:

roles:
  - webserver
  - proxy
  - foobar

But I could still use

ansible-playbook -i localhost, -l localhost play.yml -t foobar

to only run tasks from the foobar role.

@ansibot ansibot added triage affects_2.2 This issue/PR affects Ansible v2.2 labels Sep 7, 2016
@bcoca bcoca removed affects_2.2 This issue/PR affects Ansible v2.2 triage labels Sep 9, 2016
@ansibot ansibot added the affects_2.2 This issue/PR affects Ansible v2.2 label Sep 12, 2016
@ansibot ansibot added the support:core This issue/PR relates to code supported by the Ansible Engineering Team. label Jun 29, 2017
robinro pushed a commit to robinro/ansible that referenced this issue Aug 17, 2017
Fixes ansible#17434

A common theme is to use the role name also as a tag, e.g.
    roles:
      - { role: webserver, tags: [ 'webserver' ] }

With this patch one can instead write
    roles:
      - webserver
and have the same result.
@ansibot ansibot added feature This issue/PR relates to a feature request. and removed feature_idea labels Mar 2, 2018
@ansibot
Copy link
Contributor

ansibot commented Jun 10, 2019

Files identified in the description:
None

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot ansibot added the has_pr This issue has an associated PR. label Jul 28, 2019
@sivel
Copy link
Member

sivel commented Sep 1, 2020

Thank you very much for your interest in Ansible. We have no plans to accept this feature at this time.

If you have further questions please stop by IRC or the mailing list:

@sivel sivel closed this as completed Sep 1, 2020
@ansible ansible locked and limited conversation to collaborators Sep 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.2 This issue/PR affects Ansible v2.2 feature This issue/PR relates to a feature request. has_pr This issue has an associated PR. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants