mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-07 19:23:09 +00:00
always_run: removed deprecated always_run task option (#40470)
This commit is contained in:
2
changelogs/fragments/always_run_removal.yaml
Normal file
2
changelogs/fragments/always_run_removal.yaml
Normal file
@@ -0,0 +1,2 @@
|
||||
removed_features:
|
||||
- removed the deprecated always_run task option, please use `check_mode: no` instead
|
||||
@@ -4,7 +4,6 @@ accelerate_port: "*DEPRECATED*, set to override default port use for accelerate
|
||||
action: "The 'action' to execute for a task, it normally translates into a C(module) or action plugin."
|
||||
args: "*DEPRECATED*, A secondary way to add arguments into a task. Takes a dictionary in which keys map to options and values."
|
||||
always: List of tasks, in a block, that execute no matter if there is an error in the block or not.
|
||||
always_run: "*DEPRECATED*, forces a task to run even in check mode. Use :term:`check_mode` directive instead."
|
||||
any_errors_fatal: Force any un-handled task errors on any host to propagate to all hosts and end the play.
|
||||
async: Run a task asynchronously if the C(action) supports this; value is maximum runtime in seconds.
|
||||
become: Boolean that controls if privilege escalation is used or not on :term:`Task` execution.
|
||||
|
||||
@@ -17,7 +17,7 @@ This document is part of a collection on porting. The complete list of porting g
|
||||
Playbook
|
||||
========
|
||||
|
||||
No notable changes.
|
||||
* The deprecated task option ``always_run`` has been removed, please use ``check_mode: no`` instead.
|
||||
|
||||
Deprecated
|
||||
==========
|
||||
|
||||
@@ -578,7 +578,6 @@ class Base(FieldAttributeBase):
|
||||
# flags and misc. settings
|
||||
_environment = FieldAttribute(isa='list', extend=True, prepend=True)
|
||||
_no_log = FieldAttribute(isa='bool')
|
||||
_always_run = FieldAttribute(isa='bool')
|
||||
_run_once = FieldAttribute(isa='bool')
|
||||
_ignore_errors = FieldAttribute(isa='bool')
|
||||
_check_mode = FieldAttribute(isa='bool')
|
||||
|
||||
@@ -436,11 +436,6 @@ class PlayContext(Base):
|
||||
if new_info.no_log is None:
|
||||
new_info.no_log = C.DEFAULT_NO_LOG
|
||||
|
||||
if task.always_run:
|
||||
display.deprecated("always_run is deprecated. Use check_mode = no instead.", version="2.4", removed=False)
|
||||
new_info.check_mode = False
|
||||
|
||||
# check_mode replaces always_run, overwrite always_run if both are given
|
||||
if task.check_mode is not None:
|
||||
new_info.check_mode = task.check_mode
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# test code for the always_run option
|
||||
# test code for the check_mode: no option
|
||||
# (c) 2014, James Cammarata <jcammarata@ansible.com>
|
||||
|
||||
# This file is part of Ansible
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# test code for the always_run option
|
||||
# test code for the check_mode: no option
|
||||
# (c) 2014, James Cammarata <jcammarata@ansible.com>
|
||||
|
||||
# This file is part of Ansible
|
||||
|
||||
@@ -19,13 +19,12 @@
|
||||
|
||||
#- name: clean out the test directory
|
||||
# file: name={{output_dir|mandatory}} state=absent
|
||||
# always_run: True
|
||||
# tags:
|
||||
# - prepare
|
||||
# when: clean_working_dir|default("yes")|bool
|
||||
#
|
||||
#- name: create the test directory
|
||||
# file: name={{output_dir}} state=directory
|
||||
# always_run: True
|
||||
# check_mode: no
|
||||
# tags:
|
||||
# - prepare
|
||||
|
||||
@@ -114,8 +114,6 @@ class TestBase(unittest.TestCase):
|
||||
data = {'no_log': False,
|
||||
'remote_user': None,
|
||||
'vars': self.assorted_vars,
|
||||
# 'check_mode': False,
|
||||
'always_run': False,
|
||||
'environment': [],
|
||||
'run_once': False,
|
||||
'connection': None,
|
||||
|
||||
Reference in New Issue
Block a user