diff options
author | Sam Doran <sdoran@redhat.com> | 2021-02-07 01:52:15 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-07 00:52:15 -0600 |
commit | e9c6b382eaa90f806801a32f894411cc60dd359d (patch) | |
tree | 01629f63d54784dcc2d4692dc2e54b623cc282bc /lib | |
parent | 3eafe0f255727dbf3283fd5d774ea7503a81adf6 (diff) | |
download | ansible-e9c6b382eaa90f806801a32f894411cc60dd359d.tar.gz |
[stable-2.10] import_playbook - change additional params to deprecation (#72987) (#73015)
I incorrectly recommended this be set as a warning when it should have been a deprecation.
* Fix deprecation sanity test to not required a collection name when not inside a collection
(cherry picked from commit 8e022ef00a)
Co-authored-by: Sam Doooran <sdoran@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ansible/modules/import_playbook.py | 4 | ||||
-rw-r--r-- | lib/ansible/playbook/playbook_include.py | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/ansible/modules/import_playbook.py b/lib/ansible/modules/import_playbook.py index 51ef23fae4..767a8a450f 100644 --- a/lib/ansible/modules/import_playbook.py +++ b/lib/ansible/modules/import_playbook.py @@ -42,6 +42,10 @@ EXAMPLES = r''' - name: Include a play after another play import_playbook: otherplays.yaml +- name: Set variables on an imported playbook + import_playbook: otherplays.yml + vars: + service: httpd - name: This DOES NOT WORK hosts: all diff --git a/lib/ansible/playbook/playbook_include.py b/lib/ansible/playbook/playbook_include.py index 4aeecb1eda..01c9803102 100644 --- a/lib/ansible/playbook/playbook_include.py +++ b/lib/ansible/playbook/playbook_include.py @@ -150,7 +150,8 @@ class PlaybookInclude(Base, Conditional, Taggable): else: new_ds['import_playbook'] = items[0].strip() if len(items) > 1: - display.warning('Additional parameters in import_playbook statements are not supported. This will be an error in version 2.14') + display.deprecated("Additional parameters in import_playbook statements are deprecated. " + "Use 'vars' instead. See 'import_playbook' documentation for examples.", version='2.14') # rejoin the parameter portion of the arguments and # then use parse_kv() to get a dict of params back params = parse_kv(" ".join(items[1:])) |