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

tags are not inherented by multiple include levels #13674

Closed
zshamrock opened this Issue Dec 26, 2015 · 2 comments

Comments

Projects
None yet
5 participants
@zshamrock

zshamrock commented Dec 26, 2015

Issue Type:
  • Bug Report (or feature request, depends on how you see it)
Ansible Version:

1.9.4

Ansible Configuration:

Default

Environment:

Debian 8.2 (jessie)

Summary:

See the project structure below

Steps To Reproduce:

I have the following project structure:

roles/
  local/   
    tasks/
      main.yml [1]
      media/
        main.yml [2]
        hipchat.yml
        slack.yml
       ...

[1] main.yml has content:
- include: media/main.yml tags=media

[2] main.yml has content:

- include: hipchat.yml tags=hipchat
- include: slack.yml tags=slack
...
Expected Results:

I expect all tasks from media/main.yml will inherit all tags specified in tasks/main.yml. So, if I run ansible-playbook -i hosts site.yml --tags media, it will run all tasks specified in media/main.yml, and $ ansible-playbook --list-tags -i hosts site.yml reports this tag as well

playbook: site.yml

  play #1 (localhost):  TAGS: []
    TASK TAGS: [alternatives, apt, atom, chrome, clojure, docker, dot-files, dropbox, git, gnome, go, hipchat, idea, jdk, maven, packages, permissions, productivity, sdkman, skype, slack, spotify, system, tools, viber, vim]
Actual Results:

It fails with the following error:

ERROR: tag(s) not found in playbook: media.  possible values: alternatives,apt,atom,chrome,clojure,docker,dot-files,dropbox,git,gnome,go,hipchat,idea,jdk,maven,packages,permissions,productivity,sdkman,skype,slack,spotify,system,tools,viber,vim

P.S.1: The whole source code of the project is available here https://github.com/zshamrock/ididitagain

P.S.2: As a workaround (or the right way to do?), move specific subdirectories, like media, dev, dot-files, etc, in its own roles, and assign tags with role instead, as mentioned here http://docs.ansible.com/ansible/playbooks_tags.html in my site.yml?

roles:
  - { role: webserver, port: 5000, tags: [ 'web', 'foo' ] }

@jimi-c jimi-c added the bug_report label Dec 26, 2015

@jimi-c jimi-c added this to the stable-1.9 milestone Dec 26, 2015

@bcoca bcoca modified the milestone: stable-1.9 Sep 6, 2016

@bcoca bcoca removed the triage label Nov 7, 2016

@ansibot

This comment has been minimized.

Show comment
Hide comment
@ansibot

ansibot Apr 11, 2017

Contributor

@zshamrock Greetings! Thanks for taking the time to open this issue. In order for the community to handle your issue effectively, we need a bit more information.

Here are the items we could not find in your description:

  • component name

Please set the description of this issue with this template:
https://raw.githubusercontent.com/ansible/ansible/devel/.github/ISSUE_TEMPLATE.md

click here for bot help

Contributor

ansibot commented Apr 11, 2017

@zshamrock Greetings! Thanks for taking the time to open this issue. In order for the community to handle your issue effectively, we need a bit more information.

Here are the items we could not find in your description:

  • component name

Please set the description of this issue with this template:
https://raw.githubusercontent.com/ansible/ansible/devel/.github/ISSUE_TEMPLATE.md

click here for bot help

@ansibotdev

This comment has been minimized.

Show comment
Hide comment
@ansibotdev

ansibotdev Nov 22, 2017

@zshamrock You have not responded to information requests in this issue so we will assume it no longer affects you. If you are still interested in this, please create a new issue with the requested information.

click here for bot help

ansibotdev commented Nov 22, 2017

@zshamrock You have not responded to information requests in this issue so we will assume it no longer affects you. If you are still interested in this, please create a new issue with the requested information.

click here for bot help

@ansibotdev ansibotdev closed this Nov 22, 2017

@ansibot ansibot added bug and removed bug_report labels Mar 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment