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

[2.5] tagged include_tasks with --tags not executed #35459

Closed
resmo opened this issue Jan 29, 2018 · 3 comments
Closed

[2.5] tagged include_tasks with --tags not executed #35459

resmo opened this issue Jan 29, 2018 · 3 comments
Labels
affects_2.5 This issue/PR affects Ansible v2.5 bug This issue/PR relates to a bug. module This issue/PR relates to a module. support:core This issue/PR relates to code supported by the Ansible Engineering Team.

Comments

@resmo
Copy link
Contributor

resmo commented Jan 29, 2018

tagged tasks with include_tasks are not executed with matching --tags <name>. This looks like to be a regression to 2.4

ISSUE TYPE
  • Bug Report
COMPONENT NAME

include_tasks

ANSIBLE VERSION
devel
CONFIGURATION
OS / ENVIRONMENT
SUMMARY
STEPS TO REPRODUCE

See https://github.com/resmo/ansible-tmp-tagged-indlude-tasks

EXPECTED RESULTS

in 2.4.2:

ansible-playbook test.yml --tags foo
 [WARNING]: Unable to parse /etc/ansible/hosts as an inventory source

 [WARNING]: No inventory was parsed, only implicit localhost is available

 [WARNING]: Could not match supplied host pattern, ignoring: all

 [WARNING]: provided hosts list is empty, only localhost is available


PLAY [localhost] ******************************************************************************************************************************************************************************************************************************

TASK [Gathering Facts] ************************************************************************************************************************************************************************************************************************
ok: [localhost]

TASK [testrole : include_tasks] ***************************************************************************************************************************************************************************************************************
included: /home/resmo/tmp/test/roles/testrole/tasks/foo.yml for localhost

TASK [testrole : debug] ***********************************************************************************************************************************************************************************************************************
ok: [localhost] => {
    "msg": "foo works"
}

PLAY RECAP ************************************************************************************************************************************************************************************************************************************
localhost                  : ok=3    changed=0    unreachable=0    failed=0   
ACTUAL RESULTS

2.5 devel

 $ ansible-playbook test.yml --tags foo                                           
 [WARNING]: Unable to parse /etc/ansible/hosts as an inventory source

 [WARNING]: No inventory was parsed, only implicit localhost is available

 [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'


PLAY [localhost] ******************************************************************************************************************************************************************************************************************************

TASK [Gathering Facts] ************************************************************************************************************************************************************************************************************************
ok: [localhost]

TASK [testrole : include_tasks] ***************************************************************************************************************************************************************************************************************
included: /home/resmo/tmp/test/roles/testrole/tasks/foo.yml for localhost

PLAY RECAP ************************************************************************************************************************************************************************************************************************************
localhost                  : ok=2    changed=0    unreachable=0    failed=0   
@resmo resmo changed the title ] [2.5] tagged include_tasks with --tags not executed Jan 29, 2018
@ansibot
Copy link
Contributor

ansibot commented Jan 29, 2018

Files identified in the description:

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 affects_2.5 This issue/PR affects Ansible v2.5 bug_report module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Jan 29, 2018
@sivel
Copy link
Member

sivel commented Jan 29, 2018

After looking at your reproducer, this is expected in 2.5.

tags applied to a dynamic include_* only apply to the dynamic include itself, and are not inherited by the tasks within.

See #35199 for more information.

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

@sivel sivel closed this as completed Jan 29, 2018
@sivel sivel removed the needs_triage Needs a first human triage before being processed. label Jan 29, 2018
@ansibot ansibot added bug This issue/PR relates to a bug. and removed bug_report labels Mar 7, 2018
@scaronni
Copy link

Hello, sorry for writing here, but I don't know where to.

tags applied to a dynamic include_* only apply to the dynamic include itself, and are not inherited by the tasks within.

So this is what happens when I have a when or a loop with an include_tasks. But if I don't have anything like that, tasks still inherit the tags with include_tasks.

@ansible ansible locked and limited conversation to collaborators Apr 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.5 This issue/PR affects Ansible v2.5 bug This issue/PR relates to a bug. module This issue/PR relates to a module. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

No branches or pull requests

4 participants