Categorize FILE_COMMON_ARGS

Some file_common_args are not common to all file modules.  Divide the
args into categories for a future refator of this into a separate
file_argspec.
pull/39984/head
Toshio Kuratomi 6 years ago
parent 5fd9954ccc
commit b9a00372c2

@ -216,7 +216,8 @@ _literal_eval = literal_eval
_ANSIBLE_ARGS = None _ANSIBLE_ARGS = None
FILE_COMMON_ARGUMENTS = dict( FILE_COMMON_ARGUMENTS = dict(
src=dict(), # These are things we want. About setting metadata (mode, ownership, permissions in general) on
# created files
mode=dict(type='raw'), mode=dict(type='raw'),
owner=dict(), owner=dict(),
group=dict(), group=dict(),
@ -224,17 +225,23 @@ FILE_COMMON_ARGUMENTS = dict(
serole=dict(), serole=dict(),
selevel=dict(), selevel=dict(),
setype=dict(), setype=dict(),
follow=dict(type='bool', default=False), attributes=dict(aliases=['attr']),
# not taken by the file module, but other modules call file so it must ignore them.
content=dict(no_log=True), # The following are not about perms and should not be in a rewritten file_common_args
backup=dict(), src=dict(), # Maybe dest or path would be appropriate but src is not
force=dict(), follow=dict(type='bool', default=False), # Maybe follow is appropriate because it determines whether to follow symlinks for permission purposes too
force=dict(type='bool'),
# not taken by the file module, but other action plugins call the file module so this ignores
# them for now. In the future, the caller should take care of removing these from the module
# arugments before calling the file module.
content=dict(no_log=True), # used by copy
backup=dict(), # Used by a few modules to create a remote backup before updating the file
remote_src=dict(), # used by assemble remote_src=dict(), # used by assemble
regexp=dict(), # used by assemble regexp=dict(), # used by assemble
delimiter=dict(), # used by assemble delimiter=dict(), # used by assemble
directory_mode=dict(), # used by copy directory_mode=dict(), # used by copy
unsafe_writes=dict(type='bool'), # should be available to any module using atomic_move unsafe_writes=dict(type='bool'), # should be available to any module using atomic_move
attributes=dict(aliases=['attr']),
) )
PASSWD_ARG_RE = re.compile(r'^[-]{0,2}pass[-]?(word|wd)?') PASSWD_ARG_RE = re.compile(r'^[-]{0,2}pass[-]?(word|wd)?')

Loading…
Cancel
Save