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

FIX: multiple nested tasks include levels #35107

Closed
wants to merge 2 commits into from

Conversation

kiorky
Copy link
Contributor

@kiorky kiorky commented Jan 19, 2018

I'm splitting the #32565 PR on multiple more isolated PR as it may be easier to accept/check in in core.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

include_tasks

ANSIBLE VERSION
2.4
devel
CONFIGURATION

standard

OS / ENVIRONMENT

ubuntu lts

SUMMARY

See 4f97013cabc79cba669090b9a7d2a13bdbf34453

STEPS TO REPRODUCE

See 4f97013cabc79cba669090b9a7d2a13bdbf34453

EXPECTED RESULTS

included tasks find file


Running include_role_nested integration test script
Run command: ./runme.sh -v
+ ansible-playbook -i../../inventory nested.yml -v
Using /srv/corpusops/corpusops.bootstrap/venv/src/ansible/test/integration/integration.cfg as config file

PLAY [verify that multiple level of nested statements and  include+meta doesnt mess included files mecanisms] *****************************************************************************************************************************************************************

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

TASK [include_tasks] **********************************************************************************************************************************************************************************************************************************************************
included: /srv/corpusops/corpusops.bootstrap/venv/src/ansible/test/integration/targets/include_role_nested/tasks/nested/nested.yml for testhost

TASK [include_tasks] **********************************************************************************************************************************************************************************************************************************************************
included: /srv/corpusops/corpusops.bootstrap/venv/src/ansible/test/integration/targets/include_role_nested/./tasks/nested/../../nestedtasks/nested/nested.yml for testhost

TASK [include_role] ***********************************************************************************************************************************************************************************************************************************************************

TASK [nested/test_nested_dep_role : include_tasks] ****************************************************************************************************************************************************************************************************************************
included: /srv/corpusops/corpusops.bootstrap/venv/src/ansible/test/integration/targets/include_role_nested/nested/nested/test_nested_dep_role/tasks/./runc.yml for testhost

TASK [nested/test_nested_dep_role : debug] ************************************************************************************************************************************************************************************************************************************
ok: [testhost] => {
    "msg": "from test_nested_dep_role"
}

TASK [nested/test_nested_dep_role : include_role] *****************************************************************************************************************************************************************************************************************************

TASK [nested/nested/test_nested_dep_role2b : include_tasks] *******************************************************************************************************************************************************************************************************************
included: /srv/corpusops/corpusops.bootstrap/venv/src/ansible/test/integration/targets/include_role_nested/nested/nested/nested/test_nested_dep_role2b/tasks/./runf.yml for testhost

TASK [nested/nested/test_nested_dep_role2b : command] *************************************************************************************************************************************************************************************************************************
changed: [testhost] => {"changed": true, "cmd": "echo from deprole2b", "delta": "0:00:00.100271", "end": "2018-01-19 21:28:28.678150", "rc": 0, "start": "2018-01-19 21:28:28.577879", "stderr": "", "stderr_lines": [], "stdout": "from deprole2b", "stdout_lines": ["from deprole2b"]}

TASK [nested/nested/test_nested_dep_role2a : include_tasks] *******************************************************************************************************************************************************************************************************************
included: /srv/corpusops/corpusops.bootstrap/venv/src/ansible/test/integration/targets/include_role_nested/nested/nested/nested/test_nested_dep_role2a/tasks/./rune.yml for testhost

TASK [nested/nested/test_nested_dep_role2a : command] *************************************************************************************************************************************************************************************************************************
changed: [testhost] => {"changed": true, "cmd": "echo from deprole2", "delta": "0:00:00.098868", "end": "2018-01-19 21:28:28.972384", "rc": 0, "start": "2018-01-19 21:28:28.873516", "stderr": "", "stderr_lines": [], "stdout": "from deprole2", "stdout_lines": ["from deprole2"]}

TASK [nested/nested/test_nested_dep_role2 : include_tasks] ********************************************************************************************************************************************************************************************************************
included: /srv/corpusops/corpusops.bootstrap/venv/src/ansible/test/integration/targets/include_role_nested/nested/nested/nested/test_nested_dep_role2/tasks/./rund.yml for testhost

TASK [nested/nested/test_nested_dep_role2 : command] **************************************************************************************************************************************************************************************************************************
changed: [testhost] => {"changed": true, "cmd": "echo from deprole2a", "delta": "0:00:00.110779", "end": "2018-01-19 21:28:29.281009", "rc": 0, "start": "2018-01-19 21:28:29.170230", "stderr": "", "stderr_lines": [], "stdout": "from deprole2a", "stdout_lines": ["from deprole2a"]}

TASK [test_nested_include_task : include_tasks] *******************************************************************************************************************************************************************************************************************************
included: /srv/corpusops/corpusops.bootstrap/venv/src/ansible/test/integration/targets/include_role_nested/roles/test_nested_include_task/tasks/./runa.yml for testhost

TASK [test_nested_include_task : debug] ***************************************************************************************************************************************************************************************************************************************
ok: [testhost] => {
    "msg": "from test_nested_include_task"
}

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

included tasks doesnt find file

Running include_role_nested integration test script
Run command: ./runme.sh -v
+ ansible-playbook -i../../inventory nested.yml -v
Using /srv/corpusops/corpusops.bootstrap/venv/src/ansible/test/integration/integration.cfg as config file

PLAY [verify that multiple level of nested statements and  include+meta doesnt mess included files mecanisms] *****************************************************************************************************************************************************************

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

TASK [include_tasks] **********************************************************************************************************************************************************************************************************************************************************
included: /srv/corpusops/corpusops.bootstrap/venv/src/ansible/test/integration/targets/include_role_nested/tasks/nested/nested.yml for testhost

TASK [include_tasks] **********************************************************************************************************************************************************************************************************************************************************
included: /srv/corpusops/corpusops.bootstrap/venv/src/ansible/test/integration/targets/include_role_nested/./tasks/nested/../../nestedtasks/nested/nested.yml for testhost

TASK [include_role] ***********************************************************************************************************************************************************************************************************************************************************

TASK [nested/test_nested_dep_role : include_tasks] ****************************************************************************************************************************************************************************************************************************
fatal: [testhost]: FAILED! => {"reason": "Unable to retrieve file contents\nCould not find or access '/srv/corpusops/corpusops.bootstrap/venv/src/ansible/test/integration/targets/include_role_nested/runc.yml'"}
 [WARNING]: Failure using method (v2_runner_on_failed) in callback plugin (<ansible.plugins.callback.junit.CallbackModule object at 0x7f9e22175e10>):
/srv/corpusops/corpusops.bootstrap/venv/src/ansible/test/integration/targets/include_role_nested/nested/nested/test_nested_dep_role/tasks/main.yml:2: verify that multiple level of nested statements and  include+meta doesnt mess included files mecanisms:
nested/test_nested_dep_role : include_tasks _raw_params=./runc.yml: duplicate host callback: testhost

        to retry, use: --limit @/srv/corpusops/corpusops.bootstrap/venv/src/ansible/test/integration/targets/include_role_nested/nested.retry

PLAY RECAP ********************************************************************************************************************************************************************************************************************************************************************
testhost                   : ok=3    changed=0    unreachable=0    failed=1

NOTICE: To resume at this test target, use the option: --start-at include_role_nested
ERROR: Command "./runme.sh -v" returned exit status 2.

@kiorky kiorky changed the title Nested tasks FIX: multiple nested tasks include levels Jan 19, 2018
@ansibot ansibot added affects_2.5 This issue/PR affects Ansible v2.5 backport This PR does not target the devel branch. bugfix_pull_request needs_triage Needs a first human triage before being processed. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team. test This PR relates to tests. labels Jan 19, 2018
@ansibot ansibot added the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. label Jan 19, 2018
@kiorky
Copy link
Contributor Author

kiorky commented Jan 20, 2018

Test seems just flaky

This fixes the path of included files when you want
to call include_task inside a role's task file and this
role is itself called from multiple level of playbook include_tasks

Related to ansible/ansible:ansible#21890
This fixes ansible/ansible:ansible#35109
@ansibot ansibot removed the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. label Jan 21, 2018
@kiorky
Copy link
Contributor Author

kiorky commented Jan 21, 2018

This is another solution for #34782 (related to #34783)

@kiorky
Copy link
Contributor Author

kiorky commented Jan 21, 2018

ready_for_review

@kiorky
Copy link
Contributor Author

kiorky commented Jan 21, 2018

!ready_for_review

@kiorky kiorky closed this Jan 22, 2018
@s-hertel s-hertel removed the needs_triage Needs a first human triage before being processed. label Jan 26, 2018
@ansibot ansibot added bug This issue/PR relates to a bug. and removed bugfix_pull_request labels Mar 6, 2018
@ansible ansible locked and limited conversation to collaborators Apr 26, 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 backport This PR does not target the devel branch. bug This issue/PR relates to a bug. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team. test This PR relates to tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants