mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
include_vars: include main.yml (#51926)
Enhance the conditional check to include main.yml if it is not from 'role/vars/' Fixes: #29135 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
parent
f470736476
commit
a5d3647eca
2 changed files with 5 additions and 17 deletions
|
@ -0,0 +1,2 @@
|
|||
bugfixes:
|
||||
- Enhance the conditional check to include main.yml if it is not from 'role/vars/' (https://github.com/ansible/ansible/pull/51926).
|
|
@ -1,19 +1,5 @@
|
|||
# (c) 2016, Allen Sanabria <asanabria@linuxdynasty.org>
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
# Copyright: (c) 2016, Allen Sanabria <asanabria@linuxdynasty.org>
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
@ -265,7 +251,7 @@ class ActionModule(ActionBase):
|
|||
stop_iter = False
|
||||
# Never include main.yml from a role, as that is the default included by the role
|
||||
if self._task._role:
|
||||
if filename == 'main.yml':
|
||||
if path.join(self._task._role._role_path, filename) == path.join(root_dir, 'vars', 'main.yml'):
|
||||
stop_iter = True
|
||||
continue
|
||||
|
||||
|
|
Loading…
Reference in a new issue