mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-12 19:29:11 -07:00
fix missing attribs with dirct module execution (#53875)
* fix missing attribs with dirct module execution * also make remote tmp handling smarter update tests * set default if attrib does not exist * add simple test
This commit is contained in:
parent
c6ed5b314d
commit
bda541fa0d
8 changed files with 59 additions and 30 deletions
|
@ -18,24 +18,28 @@ from ansible.module_utils.six import (
|
|||
# Python2 & 3 way to get NoneType
|
||||
NoneType = type(None)
|
||||
|
||||
# if adding boolean attribute, also add to PASS_BOOL
|
||||
# some of this dupes defaults from controller config
|
||||
PASS_VARS = {
|
||||
'check_mode': 'check_mode',
|
||||
'debug': '_debug',
|
||||
'diff': '_diff',
|
||||
'keep_remote_files': '_keep_remote_files',
|
||||
'module_name': '_name',
|
||||
'no_log': 'no_log',
|
||||
'remote_tmp': '_remote_tmp',
|
||||
'selinux_special_fs': '_selinux_special_fs',
|
||||
'shell_executable': '_shell',
|
||||
'socket': '_socket_path',
|
||||
'string_conversion_action': '_string_conversion_action',
|
||||
'syslog_facility': '_syslog_facility',
|
||||
'tmpdir': '_tmpdir',
|
||||
'verbosity': '_verbosity',
|
||||
'version': 'ansible_version',
|
||||
'check_mode': ('check_mode', False),
|
||||
'debug': ('_debug', False),
|
||||
'diff': ('_diff', False),
|
||||
'keep_remote_files': ('_keep_remote_files', False),
|
||||
'module_name': ('_name', None),
|
||||
'no_log': ('no_log', False),
|
||||
'remote_tmp': ('_remote_tmp', None),
|
||||
'selinux_special_fs': ('_selinux_special_fs', ['fuse', 'nfs', 'vboxsf', 'ramfs', '9p']),
|
||||
'shell_executable': ('_shell', '/bin/sh'),
|
||||
'socket': ('_socket_path', None),
|
||||
'string_conversion_action': ('_string_conversion_action', 'warn'),
|
||||
'syslog_facility': ('_syslog_facility', 'INFO'),
|
||||
'tmpdir': ('_tmpdir', None),
|
||||
'verbosity': ('_verbosity', 0),
|
||||
'version': ('ansible_version', '0.0'),
|
||||
}
|
||||
|
||||
PASS_BOOLS = ('check_mode', 'debug', 'diff', 'keep_remote_files', 'no_log')
|
||||
|
||||
|
||||
def _return_datastructure_name(obj):
|
||||
""" Return native stringified values from datastructures.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue