diff options
Diffstat (limited to 'lib/ansible/cli/console.py')
-rwxr-xr-x | lib/ansible/cli/console.py | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/lib/ansible/cli/console.py b/lib/ansible/cli/console.py index 3125cc47..2325bf05 100755 --- a/lib/ansible/cli/console.py +++ b/lib/ansible/cli/console.py @@ -22,7 +22,7 @@ from ansible import constants as C from ansible import context from ansible.cli.arguments import option_helpers as opt_help from ansible.executor.task_queue_manager import TaskQueueManager -from ansible.module_utils._text import to_native, to_text +from ansible.module_utils.common.text.converters import to_native, to_text from ansible.module_utils.parsing.convert_bool import boolean from ansible.parsing.splitter import parse_kv from ansible.playbook.play import Play @@ -39,26 +39,30 @@ class ConsoleCLI(CLI, cmd.Cmd): ''' A REPL that allows for running ad-hoc tasks against a chosen inventory from a nice shell with built-in tab completion (based on dominis' - ansible-shell). + ``ansible-shell``). It supports several commands, and you can modify its configuration at runtime: - - `cd [pattern]`: change host/group (you can use host patterns eg.: app*.dc*:!app01*) - - `list`: list available hosts in the current path - - `list groups`: list groups included in the current path - - `become`: toggle the become flag - - `!`: forces shell module instead of the ansible module (!yum update -y) - - `verbosity [num]`: set the verbosity level - - `forks [num]`: set the number of forks - - `become_user [user]`: set the become_user - - `remote_user [user]`: set the remote_user - - `become_method [method]`: set the privilege escalation method - - `check [bool]`: toggle check mode - - `diff [bool]`: toggle diff mode - - `timeout [integer]`: set the timeout of tasks in seconds (0 to disable) - - `help [command/module]`: display documentation for the command or module - - `exit`: exit ansible-console + - ``cd [pattern]``: change host/group + (you can use host patterns eg.: ``app*.dc*:!app01*``) + - ``list``: list available hosts in the current path + - ``list groups``: list groups included in the current path + - ``become``: toggle the become flag + - ``!``: forces shell module instead of the ansible module + (``!yum update -y``) + - ``verbosity [num]``: set the verbosity level + - ``forks [num]``: set the number of forks + - ``become_user [user]``: set the become_user + - ``remote_user [user]``: set the remote_user + - ``become_method [method]``: set the privilege escalation method + - ``check [bool]``: toggle check mode + - ``diff [bool]``: toggle diff mode + - ``timeout [integer]``: set the timeout of tasks in seconds + (0 to disable) + - ``help [command/module]``: display documentation for + the command or module + - ``exit``: exit ``ansible-console`` ''' name = 'ansible-console' |