mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 11:21:25 -07:00
This implements a basic --check mode which for now is only implemented on template & copy operations. More detail will be shared with the list
shortly.
This commit is contained in:
parent
28cf95e585
commit
fed82c2188
21 changed files with 125 additions and 24 deletions
|
@ -15,6 +15,8 @@
|
|||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from ansible.runner.return_data import ReturnData
|
||||
|
||||
class ActionModule(object):
|
||||
|
||||
def __init__(self, runner):
|
||||
|
@ -23,6 +25,9 @@ class ActionModule(object):
|
|||
def run(self, conn, tmp, module_name, module_args, inject):
|
||||
''' transfer the given module name, plus the async module, then run it '''
|
||||
|
||||
if self.runner.check:
|
||||
return ReturnData(conn=conn, comm_ok=True, result=dict(skipped=True, msg='check mode not supported for this module'))
|
||||
|
||||
# shell and command module are the same
|
||||
if module_name == 'shell':
|
||||
module_name = 'command'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue