normalize docs in become plugins (#9452)
* normalize docs in become plugins Normalize doc blocks for plugins * adjustmentspull/9431/head
parent
0bbc3eccd9
commit
29e3226718
|
@ -5,11 +5,11 @@
|
|||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = '''
|
||||
DOCUMENTATION = r"""
|
||||
name: doas
|
||||
short_description: Do As user
|
||||
description:
|
||||
- This become plugins allows your remote/login user to execute commands as another user via the doas utility.
|
||||
- This become plugins allows your remote/login user to execute commands as another user using the C(doas) utility.
|
||||
author: Ansible Core Team
|
||||
options:
|
||||
become_user:
|
||||
|
@ -27,7 +27,7 @@ DOCUMENTATION = '''
|
|||
- name: ANSIBLE_BECOME_USER
|
||||
- name: ANSIBLE_DOAS_USER
|
||||
become_exe:
|
||||
description: Doas executable.
|
||||
description: C(doas) executable.
|
||||
type: string
|
||||
default: doas
|
||||
ini:
|
||||
|
@ -42,7 +42,7 @@ DOCUMENTATION = '''
|
|||
- name: ANSIBLE_BECOME_EXE
|
||||
- name: ANSIBLE_DOAS_EXE
|
||||
become_flags:
|
||||
description: Options to pass to doas.
|
||||
description: Options to pass to C(doas).
|
||||
type: string
|
||||
default: ''
|
||||
ini:
|
||||
|
@ -57,7 +57,7 @@ DOCUMENTATION = '''
|
|||
- name: ANSIBLE_BECOME_FLAGS
|
||||
- name: ANSIBLE_DOAS_FLAGS
|
||||
become_pass:
|
||||
description: Password for doas prompt.
|
||||
description: Password for C(doas) prompt.
|
||||
type: string
|
||||
required: false
|
||||
vars:
|
||||
|
@ -84,7 +84,7 @@ DOCUMENTATION = '''
|
|||
- name: ansible_doas_prompt_l10n
|
||||
env:
|
||||
- name: ANSIBLE_DOAS_PROMPT_L10N
|
||||
'''
|
||||
"""
|
||||
|
||||
import re
|
||||
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = '''
|
||||
DOCUMENTATION = r"""
|
||||
name: dzdo
|
||||
short_description: Centrify's Direct Authorize
|
||||
description:
|
||||
- This become plugins allows your remote/login user to execute commands as another user via the dzdo utility.
|
||||
- This become plugins allows your remote/login user to execute commands as another user using the C(dzdo) utility.
|
||||
author: Ansible Core Team
|
||||
options:
|
||||
become_user:
|
||||
|
@ -27,7 +27,7 @@ DOCUMENTATION = '''
|
|||
- name: ANSIBLE_BECOME_USER
|
||||
- name: ANSIBLE_DZDO_USER
|
||||
become_exe:
|
||||
description: Dzdo executable.
|
||||
description: C(dzdo) executable.
|
||||
type: string
|
||||
default: dzdo
|
||||
ini:
|
||||
|
@ -42,7 +42,7 @@ DOCUMENTATION = '''
|
|||
- name: ANSIBLE_BECOME_EXE
|
||||
- name: ANSIBLE_DZDO_EXE
|
||||
become_flags:
|
||||
description: Options to pass to dzdo.
|
||||
description: Options to pass to C(dzdo).
|
||||
type: string
|
||||
default: -H -S -n
|
||||
ini:
|
||||
|
@ -57,7 +57,7 @@ DOCUMENTATION = '''
|
|||
- name: ANSIBLE_BECOME_FLAGS
|
||||
- name: ANSIBLE_DZDO_FLAGS
|
||||
become_pass:
|
||||
description: Options to pass to dzdo.
|
||||
description: Options to pass to C(dzdo).
|
||||
type: string
|
||||
required: false
|
||||
vars:
|
||||
|
@ -70,7 +70,7 @@ DOCUMENTATION = '''
|
|||
ini:
|
||||
- section: dzdo_become_plugin
|
||||
key: password
|
||||
'''
|
||||
"""
|
||||
|
||||
from ansible.plugins.become import BecomeBase
|
||||
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = '''
|
||||
DOCUMENTATION = r"""
|
||||
name: ksu
|
||||
short_description: Kerberos substitute user
|
||||
description:
|
||||
- This become plugins allows your remote/login user to execute commands as another user via the ksu utility.
|
||||
- This become plugins allows your remote/login user to execute commands as another user using the C(ksu) utility.
|
||||
author: Ansible Core Team
|
||||
options:
|
||||
become_user:
|
||||
|
@ -28,7 +28,7 @@ DOCUMENTATION = '''
|
|||
- name: ANSIBLE_KSU_USER
|
||||
required: true
|
||||
become_exe:
|
||||
description: Su executable.
|
||||
description: C(ksu) executable.
|
||||
type: string
|
||||
default: ksu
|
||||
ini:
|
||||
|
@ -43,7 +43,7 @@ DOCUMENTATION = '''
|
|||
- name: ANSIBLE_BECOME_EXE
|
||||
- name: ANSIBLE_KSU_EXE
|
||||
become_flags:
|
||||
description: Options to pass to ksu.
|
||||
description: Options to pass to C(ksu).
|
||||
type: string
|
||||
default: ''
|
||||
ini:
|
||||
|
@ -58,7 +58,7 @@ DOCUMENTATION = '''
|
|||
- name: ANSIBLE_BECOME_FLAGS
|
||||
- name: ANSIBLE_KSU_FLAGS
|
||||
become_pass:
|
||||
description: Ksu password.
|
||||
description: C(ksu) password.
|
||||
type: string
|
||||
required: false
|
||||
vars:
|
||||
|
@ -85,7 +85,7 @@ DOCUMENTATION = '''
|
|||
- name: ansible_ksu_prompt_l10n
|
||||
env:
|
||||
- name: ANSIBLE_KSU_PROMPT_L10N
|
||||
'''
|
||||
"""
|
||||
|
||||
import re
|
||||
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = '''
|
||||
DOCUMENTATION = r"""
|
||||
name: machinectl
|
||||
short_description: Systemd's machinectl privilege escalation
|
||||
description:
|
||||
- This become plugins allows your remote/login user to execute commands as another user via the machinectl utility.
|
||||
- This become plugins allows your remote/login user to execute commands as another user using the C(machinectl) utility.
|
||||
author: Ansible Core Team
|
||||
options:
|
||||
become_user:
|
||||
|
@ -28,7 +28,7 @@ DOCUMENTATION = '''
|
|||
- name: ANSIBLE_BECOME_USER
|
||||
- name: ANSIBLE_MACHINECTL_USER
|
||||
become_exe:
|
||||
description: Machinectl executable.
|
||||
description: C(machinectl) executable.
|
||||
type: string
|
||||
default: machinectl
|
||||
ini:
|
||||
|
@ -43,7 +43,7 @@ DOCUMENTATION = '''
|
|||
- name: ANSIBLE_BECOME_EXE
|
||||
- name: ANSIBLE_MACHINECTL_EXE
|
||||
become_flags:
|
||||
description: Options to pass to machinectl.
|
||||
description: Options to pass to C(machinectl).
|
||||
type: string
|
||||
default: ''
|
||||
ini:
|
||||
|
@ -58,7 +58,7 @@ DOCUMENTATION = '''
|
|||
- name: ANSIBLE_BECOME_FLAGS
|
||||
- name: ANSIBLE_MACHINECTL_FLAGS
|
||||
become_pass:
|
||||
description: Password for machinectl.
|
||||
description: Password for C(machinectl).
|
||||
type: string
|
||||
required: false
|
||||
vars:
|
||||
|
@ -72,24 +72,23 @@ DOCUMENTATION = '''
|
|||
- section: machinectl_become_plugin
|
||||
key: password
|
||||
notes:
|
||||
- When not using this plugin with user V(root), it only works correctly with a polkit rule which will alter
|
||||
the behaviour of machinectl. This rule must alter the prompt behaviour to ask directly for the user credentials,
|
||||
if the user is allowed to perform the action (take a look at the examples section).
|
||||
If such a rule is not present the plugin only work if it is used in context with the root user,
|
||||
because then no further prompt will be shown by machinectl.
|
||||
'''
|
||||
- When not using this plugin with user V(root), it only works correctly with a polkit rule which will alter the behaviour
|
||||
of machinectl. This rule must alter the prompt behaviour to ask directly for the user credentials, if the user is allowed
|
||||
to perform the action (take a look at the examples section). If such a rule is not present the plugin only work if it
|
||||
is used in context with the root user, because then no further prompt will be shown by machinectl.
|
||||
"""
|
||||
|
||||
EXAMPLES = r'''
|
||||
EXAMPLES = r"""
|
||||
# A polkit rule needed to use the module with a non-root user.
|
||||
# See the Notes section for details.
|
||||
/etc/polkit-1/rules.d/60-machinectl-fast-user-auth.rules: |
|
||||
/etc/polkit-1/rules.d/60-machinectl-fast-user-auth.rules: |-
|
||||
polkit.addRule(function(action, subject) {
|
||||
if(action.id == "org.freedesktop.machine1.host-shell" &&
|
||||
subject.isInGroup("wheel")) {
|
||||
return polkit.Result.AUTH_SELF_KEEP;
|
||||
}
|
||||
});
|
||||
'''
|
||||
"""
|
||||
|
||||
from re import compile as re_compile
|
||||
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = '''
|
||||
DOCUMENTATION = r"""
|
||||
name: pbrun
|
||||
short_description: PowerBroker run
|
||||
description:
|
||||
- This become plugins allows your remote/login user to execute commands as another user via the pbrun utility.
|
||||
- This become plugins allows your remote/login user to execute commands as another user using the C(pbrun) utility.
|
||||
author: Ansible Core Team
|
||||
options:
|
||||
become_user:
|
||||
|
@ -28,7 +28,7 @@ DOCUMENTATION = '''
|
|||
- name: ANSIBLE_BECOME_USER
|
||||
- name: ANSIBLE_PBRUN_USER
|
||||
become_exe:
|
||||
description: Sudo executable.
|
||||
description: C(pbrun) executable.
|
||||
type: string
|
||||
default: pbrun
|
||||
ini:
|
||||
|
@ -43,7 +43,7 @@ DOCUMENTATION = '''
|
|||
- name: ANSIBLE_BECOME_EXE
|
||||
- name: ANSIBLE_PBRUN_EXE
|
||||
become_flags:
|
||||
description: Options to pass to pbrun.
|
||||
description: Options to pass to C(pbrun).
|
||||
type: string
|
||||
default: ''
|
||||
ini:
|
||||
|
@ -58,7 +58,7 @@ DOCUMENTATION = '''
|
|||
- name: ANSIBLE_BECOME_FLAGS
|
||||
- name: ANSIBLE_PBRUN_FLAGS
|
||||
become_pass:
|
||||
description: Password for pbrun.
|
||||
description: Password for C(pbrun).
|
||||
type: string
|
||||
required: false
|
||||
vars:
|
||||
|
@ -72,7 +72,7 @@ DOCUMENTATION = '''
|
|||
- section: pbrun_become_plugin
|
||||
key: password
|
||||
wrap_exe:
|
||||
description: Toggle to wrap the command pbrun calls in C(shell -c) or not.
|
||||
description: Toggle to wrap the command C(pbrun) calls in C(shell -c) or not.
|
||||
default: false
|
||||
type: bool
|
||||
ini:
|
||||
|
@ -82,7 +82,7 @@ DOCUMENTATION = '''
|
|||
- name: ansible_pbrun_wrap_execution
|
||||
env:
|
||||
- name: ANSIBLE_PBRUN_WRAP_EXECUTION
|
||||
'''
|
||||
"""
|
||||
|
||||
from ansible.plugins.become import BecomeBase
|
||||
|
||||
|
|
|
@ -5,18 +5,18 @@
|
|||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = '''
|
||||
DOCUMENTATION = r"""
|
||||
name: pfexec
|
||||
short_description: profile based execution
|
||||
description:
|
||||
- This become plugins allows your remote/login user to execute commands as another user via the pfexec utility.
|
||||
- This become plugins allows your remote/login user to execute commands as another user using the C(pfexec) utility.
|
||||
author: Ansible Core Team
|
||||
options:
|
||||
become_user:
|
||||
description:
|
||||
- User you 'become' to execute the task.
|
||||
- This plugin ignores this setting as pfexec uses its own C(exec_attr) to figure this out,
|
||||
but it is supplied here for Ansible to make decisions needed for the task execution, like file permissions.
|
||||
- This plugin ignores this setting as pfexec uses its own C(exec_attr) to figure this out, but it is supplied here
|
||||
for Ansible to make decisions needed for the task execution, like file permissions.
|
||||
type: string
|
||||
default: root
|
||||
ini:
|
||||
|
@ -31,7 +31,7 @@ DOCUMENTATION = '''
|
|||
- name: ANSIBLE_BECOME_USER
|
||||
- name: ANSIBLE_PFEXEC_USER
|
||||
become_exe:
|
||||
description: Sudo executable.
|
||||
description: C(pfexec) executable.
|
||||
type: string
|
||||
default: pfexec
|
||||
ini:
|
||||
|
@ -46,7 +46,7 @@ DOCUMENTATION = '''
|
|||
- name: ANSIBLE_BECOME_EXE
|
||||
- name: ANSIBLE_PFEXEC_EXE
|
||||
become_flags:
|
||||
description: Options to pass to pfexec.
|
||||
description: Options to pass to C(pfexec).
|
||||
type: string
|
||||
default: -H -S -n
|
||||
ini:
|
||||
|
@ -61,7 +61,7 @@ DOCUMENTATION = '''
|
|||
- name: ANSIBLE_BECOME_FLAGS
|
||||
- name: ANSIBLE_PFEXEC_FLAGS
|
||||
become_pass:
|
||||
description: pfexec password.
|
||||
description: C(pfexec) password.
|
||||
type: string
|
||||
required: false
|
||||
vars:
|
||||
|
@ -75,7 +75,7 @@ DOCUMENTATION = '''
|
|||
- section: pfexec_become_plugin
|
||||
key: password
|
||||
wrap_exe:
|
||||
description: Toggle to wrap the command pfexec calls in C(shell -c) or not.
|
||||
description: Toggle to wrap the command C(pfexec) calls in C(shell -c) or not.
|
||||
default: false
|
||||
type: bool
|
||||
ini:
|
||||
|
@ -87,7 +87,7 @@ DOCUMENTATION = '''
|
|||
- name: ANSIBLE_PFEXEC_WRAP_EXECUTION
|
||||
notes:
|
||||
- This plugin ignores O(become_user) as pfexec uses its own C(exec_attr) to figure this out.
|
||||
'''
|
||||
"""
|
||||
|
||||
from ansible.plugins.become import BecomeBase
|
||||
|
||||
|
|
|
@ -5,15 +5,15 @@
|
|||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = '''
|
||||
DOCUMENTATION = r"""
|
||||
name: pmrun
|
||||
short_description: Privilege Manager run
|
||||
description:
|
||||
- This become plugins allows your remote/login user to execute commands as another user via the pmrun utility.
|
||||
- This become plugins allows your remote/login user to execute commands as another user using the C(pmrun) utility.
|
||||
author: Ansible Core Team
|
||||
options:
|
||||
become_exe:
|
||||
description: Sudo executable
|
||||
description: C(pmrun) executable.
|
||||
type: string
|
||||
default: pmrun
|
||||
ini:
|
||||
|
@ -28,7 +28,7 @@ DOCUMENTATION = '''
|
|||
- name: ANSIBLE_BECOME_EXE
|
||||
- name: ANSIBLE_PMRUN_EXE
|
||||
become_flags:
|
||||
description: Options to pass to pmrun.
|
||||
description: Options to pass to C(pmrun).
|
||||
type: string
|
||||
default: ''
|
||||
ini:
|
||||
|
@ -43,7 +43,7 @@ DOCUMENTATION = '''
|
|||
- name: ANSIBLE_BECOME_FLAGS
|
||||
- name: ANSIBLE_PMRUN_FLAGS
|
||||
become_pass:
|
||||
description: pmrun password.
|
||||
description: C(pmrun) password.
|
||||
type: string
|
||||
required: false
|
||||
vars:
|
||||
|
@ -57,8 +57,8 @@ DOCUMENTATION = '''
|
|||
- section: pmrun_become_plugin
|
||||
key: password
|
||||
notes:
|
||||
- This plugin ignores the become_user supplied and uses pmrun's own configuration to select the user.
|
||||
'''
|
||||
- This plugin ignores the C(become_user) supplied and uses C(pmrun)'s own configuration to select the user.
|
||||
"""
|
||||
|
||||
from ansible.plugins.become import BecomeBase
|
||||
from ansible.module_utils.six.moves import shlex_quote
|
||||
|
|
|
@ -7,11 +7,11 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = """
|
||||
DOCUMENTATION = r"""
|
||||
name: run0
|
||||
short_description: Systemd's run0
|
||||
description:
|
||||
- This become plugins allows your remote/login user to execute commands as another user via the C(run0) utility.
|
||||
- This become plugins allows your remote/login user to execute commands as another user using the C(run0) utility.
|
||||
author:
|
||||
- Thomas Sjögren (@konstruktoid)
|
||||
version_added: '9.0.0'
|
||||
|
@ -32,7 +32,7 @@ DOCUMENTATION = """
|
|||
- name: ANSIBLE_RUN0_USER
|
||||
type: string
|
||||
become_exe:
|
||||
description: The C(run0) executable.
|
||||
description: C(run0) executable.
|
||||
default: run0
|
||||
ini:
|
||||
- section: privilege_escalation
|
||||
|
@ -47,7 +47,7 @@ DOCUMENTATION = """
|
|||
- name: ANSIBLE_RUN0_EXE
|
||||
type: string
|
||||
become_flags:
|
||||
description: Options to pass to run0.
|
||||
description: Options to pass to C(run0).
|
||||
default: ''
|
||||
ini:
|
||||
- section: privilege_escalation
|
||||
|
@ -62,13 +62,13 @@ DOCUMENTATION = """
|
|||
- name: ANSIBLE_RUN0_FLAGS
|
||||
type: string
|
||||
notes:
|
||||
- This plugin will only work when a polkit rule is in place.
|
||||
- This plugin will only work when a C(polkit) rule is in place.
|
||||
"""
|
||||
|
||||
EXAMPLES = r"""
|
||||
# An example polkit rule that allows the user 'ansible' in the 'wheel' group
|
||||
# to execute commands using run0 without authentication.
|
||||
/etc/polkit-1/rules.d/60-run0-fast-user-auth.rules: |
|
||||
/etc/polkit-1/rules.d/60-run0-fast-user-auth.rules: |-
|
||||
polkit.addRule(function(action, subject) {
|
||||
if(action.id == "org.freedesktop.systemd1.manage-units" &&
|
||||
subject.isInGroup("wheel") &&
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = '''
|
||||
DOCUMENTATION = r"""
|
||||
name: sesu
|
||||
short_description: CA Privileged Access Manager
|
||||
description:
|
||||
- This become plugins allows your remote/login user to execute commands as another user via the sesu utility.
|
||||
- This become plugins allows your remote/login user to execute commands as another user using the C(sesu) utility.
|
||||
author: ansible (@nekonyuu)
|
||||
options:
|
||||
become_user:
|
||||
|
@ -28,7 +28,7 @@ DOCUMENTATION = '''
|
|||
- name: ANSIBLE_BECOME_USER
|
||||
- name: ANSIBLE_SESU_USER
|
||||
become_exe:
|
||||
description: sesu executable.
|
||||
description: C(sesu) executable.
|
||||
type: string
|
||||
default: sesu
|
||||
ini:
|
||||
|
@ -43,7 +43,7 @@ DOCUMENTATION = '''
|
|||
- name: ANSIBLE_BECOME_EXE
|
||||
- name: ANSIBLE_SESU_EXE
|
||||
become_flags:
|
||||
description: Options to pass to sesu.
|
||||
description: Options to pass to C(sesu).
|
||||
type: string
|
||||
default: -H -S -n
|
||||
ini:
|
||||
|
@ -58,7 +58,7 @@ DOCUMENTATION = '''
|
|||
- name: ANSIBLE_BECOME_FLAGS
|
||||
- name: ANSIBLE_SESU_FLAGS
|
||||
become_pass:
|
||||
description: Password to pass to sesu.
|
||||
description: Password to pass to C(sesu).
|
||||
type: string
|
||||
required: false
|
||||
vars:
|
||||
|
@ -71,7 +71,7 @@ DOCUMENTATION = '''
|
|||
ini:
|
||||
- section: sesu_become_plugin
|
||||
key: password
|
||||
'''
|
||||
"""
|
||||
|
||||
from ansible.plugins.become import BecomeBase
|
||||
|
||||
|
|
|
@ -5,11 +5,12 @@
|
|||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = """
|
||||
DOCUMENTATION = r"""
|
||||
name: sudosu
|
||||
short_description: Run tasks using sudo su -
|
||||
description:
|
||||
- This become plugin allows your remote/login user to execute commands as another user via the C(sudo) and C(su) utilities combined.
|
||||
- This become plugin allows your remote/login user to execute commands as another user using the C(sudo) and C(su) utilities
|
||||
combined.
|
||||
author:
|
||||
- Dag Wieers (@dagwieers)
|
||||
version_added: 2.4.0
|
||||
|
@ -60,8 +61,8 @@ DOCUMENTATION = """
|
|||
key: password
|
||||
alt_method:
|
||||
description:
|
||||
- Whether to use an alternative method to call C(su). Instead of running C(su -l user /path/to/shell -c command),
|
||||
it runs C(su -l user -c command).
|
||||
- Whether to use an alternative method to call C(su). Instead of running C(su -l user /path/to/shell -c command), it
|
||||
runs C(su -l user -c command).
|
||||
- Use this when the default one is not working on your system.
|
||||
required: false
|
||||
type: boolean
|
||||
|
|
Loading…
Reference in New Issue