summaryrefslogtreecommitdiff
path: root/lib/ansible/playbook
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ansible/playbook')
-rw-r--r--lib/ansible/playbook/role/__init__.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/ansible/playbook/role/__init__.py b/lib/ansible/playbook/role/__init__.py
index b88f247896..43d4b27152 100644
--- a/lib/ansible/playbook/role/__init__.py
+++ b/lib/ansible/playbook/role/__init__.py
@@ -294,7 +294,10 @@ class Role(Base, Conditional, Taggable, CollectionSearch):
if self._loader.path_exists(full_path):
# Note: _load_role_yaml() takes care of rebuilding the path.
argument_specs = self._load_role_yaml('meta', main='argument_specs')
- return argument_specs.get('argument_specs', {})
+ try:
+ return argument_specs.get('argument_specs') or {}
+ except AttributeError:
+ return {}
# We did not find the meta/argument_specs.[yml|yaml] file, so use the spec
# dict from the role meta data, if it exists. Ansible 2.11 and later will