mirror of https://github.com/ansible/ansible.git
deprecate esoteric/undocumented playbook syntaxes (#85378)
Co-authored-by: Matt Clay <matt@mystile.com>pull/85382/head
parent
1f8937b57e
commit
547c64f326
@ -0,0 +1,4 @@
|
||||
deprecated_features:
|
||||
- playbook syntax - Using a mapping with the ``action`` keyword is deprecated. (https://github.com/ansible/ansible/issues/84101)
|
||||
- playbook syntax - Using ``key=value`` args and the task ``args`` keyword on the same task is deprecated.
|
||||
- playbook syntax - Specifying the task ``args`` keyword without a value is deprecated.
|
||||
@ -0,0 +1,8 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from ansible.plugins.action import ActionBase
|
||||
|
||||
|
||||
class ActionModule(ActionBase):
|
||||
def run(self, tmp=None, task_vars=None):
|
||||
return dict(action_args=self._task.args)
|
||||
@ -0,0 +1,4 @@
|
||||
shippable/posix/group3
|
||||
context/controller
|
||||
gather_facts/no
|
||||
env/set/ANSIBLE_DEPRECATION_WARNINGS/yes
|
||||
@ -0,0 +1,39 @@
|
||||
# Validates some deprecated (previously untested/undocumented) playbook syntax until support is removed.
|
||||
|
||||
- name: action-as-dict (static-only, template-to-dict never worked anyway)
|
||||
action:
|
||||
module: "{{ 'echo' }}"
|
||||
args: "{{ echo_args }}" # note that `module` and `args` are children of `action`
|
||||
vars:
|
||||
echo_args:
|
||||
a: 1
|
||||
register: action_as_dict
|
||||
|
||||
- assert:
|
||||
that: action_as_dict.action_args == action_args
|
||||
vars:
|
||||
action_args:
|
||||
a: 1
|
||||
|
||||
- name: kv and task args at the same time
|
||||
echo: kv1=kv
|
||||
args:
|
||||
kv1: task_arg
|
||||
kv2: task_arg
|
||||
register: kv_and_task_args
|
||||
|
||||
- assert:
|
||||
that: kv_and_task_args.action_args == action_args
|
||||
vars:
|
||||
action_args:
|
||||
kv1: kv
|
||||
kv2: task_arg
|
||||
|
||||
- name: task args with no value
|
||||
echo:
|
||||
args:
|
||||
register: args_were_none
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- args_were_none.action_args == {}
|
||||
Loading…
Reference in New Issue