Known as a source‐level debugger, controls the execution so that the internal operations of the script can be observed VectorScript provides a powerful tool to assist in solving problems that may occur while developing scripts. 3.3 Stepping Through a Single Line of a Script.For more information about strategies, see Controlling playbook execution: strategies and more. If you use redo to reschedule a task from the debugger, other queued tasks may execute before your rescheduled task. However, all queued tasks remain in the queue and run as soon as you exit the debugger. With the free strategy, Ansible does not queue or execute any tasks while the debugger is active. With the free strategy enabled, however, Ansible does not wait for all hosts, and may queue later tasks on one host before a task fails on another host. With the default linear strategy enabled, Ansible halts execution while the debugger is active, and runs the debugged task immediately after you enter the redo command. How the debugger interacts with the free strategy Continue command Ĭ or continue continues executing, starting with the next task. See the entry Update vars command for an example of use. U or update_task recreates the task from the original task data structure and templates with updated task variables. Print *task/task.args/task_vars/host/result* prints information about the task. Recreate a task with updated task variablesĬontinue executing, starting with the next taskįor more details, see the individual descriptions and examples below. Update task variables (you must update_task next) You can use these seven commands at the debug prompt: Examples of using the debugger keyword Įxample of setting the debugger keyword on a task: The definition at the task level always applies to the task it overrides the definitions at the block, play, or role level. The definition at the block level overrides the definition at the play or role level, and applies to all tasks within that block, unless they specify a different value. The definition at the play or role level applies to all blocks and tasks within that play or role, unless they specify a different value. If you define debugger at multiple levels, such as in a role and in a task, Ansible honors the most granular definition. When you use the debugger keyword, the value you specify overrides any global configuration to enable or disable the debugger. Only invoke the debugger if the task is skipped Only invoke the debugger if a host is unreachable Never invoke the debugger, regardless of the outcome The debugger keyword accepts five values:Īlways invoke the debugger, regardless of the outcome If they fail, you can fix the errors efficiently. You can enable the debugger on new or updated tasks. This option is especially useful when developing or extending playbooks, plays, and roles. You can use the debugger keyword to enable (or disable) the debugger for a specific play, role, block, or task. Use one of these three methods to enable the debugger: If you want to invoke the debugger during playbook execution, you must enable it first. How the debugger interacts with the free strategy The debugger lets you resolve the cause of the failure and continue with playbook execution.Įnabling the debugger with the debugger keywordĮnabling the debugger in configuration or an environment variable You can check or set the value of variables, update module arguments, and re-run the task with the new variables and arguments. You have access to all of the features of the debugger in the context of the task. Controlling how Ansible behaves: precedence rulesĪnsible offers a task debugger so you can fix errors during execution instead of editing your playbook and running it again to see if your change worked.Virtualization and Containerization Guides.Protecting sensitive data with Ansible vault.Controlling playbook execution: strategies and more.How the debugger interacts with the free strategy.Executing playbooks for troubleshooting.Understanding privilege escalation: become.Validating tasks: check mode and diff mode.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |