{"id":39033,"date":"2025-09-18T15:54:32","date_gmt":"2025-09-18T13:54:32","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/?p=39033"},"modified":"2025-09-18T16:09:33","modified_gmt":"2025-09-18T14:09:33","slug":"errorhandling-in-ansible","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/errorhandling-in-ansible\/","title":{"rendered":"Errorhandling in Ansible"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"h-errors-in-tasks-abort-or-ignore\">Errors in tasks &#8211; abort or ignore?<\/h2>\n\n\n\n<p>Per default, if a task in a playbook fails, then the execution of the playbook is stopped for that host. <\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: yaml; title: ; notranslate\" title=\"\">\n- name: PLAY1\n  hosts: localhost\n  gather_facts: no\n  tasks:\n    - name: let this shell-command fail\n      ansible.builtin.shell: exit 1\n\n    - name: let this shell-command complete\n      ansible.builtin.shell: exit 0\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"847\" height=\"142\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/06\/image-1.png\" alt=\"\" class=\"wp-image-39042\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/06\/image-1.png 847w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/06\/image-1-300x50.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/06\/image-1-768x129.png 768w\" sizes=\"auto, (max-width: 847px) 100vw, 847px\" \/><\/figure>\n\n\n\n<p>As you can see, the 2nd task is not executed. If you want to continue in such a case, the <code>ignore_errors<\/code> parameter is your friend<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: yaml; title: ; notranslate\" title=\"\">\n    - name: let this shell-command fail\n      ansible.builtin.shell: exit 1\n      ignore_errors: true\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"847\" height=\"170\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/06\/image-2.png\" alt=\"\" class=\"wp-image-39043\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/06\/image-2.png 847w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/06\/image-2-300x60.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/06\/image-2-768x154.png 768w\" sizes=\"auto, (max-width: 847px) 100vw, 847px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-custom-error-conditions\">Custom error conditions<\/h2>\n\n\n\n<p>Per default, Ansible evaluates the exit-code of the module, in case of the shell-module, the exit-code of the last command.<\/p>\n\n\n\n<p>But for some commands, that is not adequate. Example: The Oracle commandline tool <code>sqlplus<\/code> to submit sql-commands will have an exit-code of 0 if it can connect to the database-instance. It is not related to the result of your SQL-commands. Error-messages in Oracle are prefixed by ORA-.<\/p>\n\n\n\n<p>So, if you want to check for application errors, you have to implement it yourself. For that, you can use the <code>failed_when<\/code> option.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: yaml; title: ; notranslate\" title=\"\">\n    - name: let this shell-command fail\n      ansible.builtin.shell: |\n        . ~\/.profile\n        echo &quot;select count(*) from all_users;&quot; | sqlplus \/ as sysdba\n      register: number_of_users\n      failed_when: &quot;&#039;ORA-&#039; in number_of_users.stdout&quot;\n<\/pre><\/div>\n\n\n<p>Caution: In this case the exit-code of the shell is no longer evaluated. To also get the exit-code of the sqlplus call (e.g., sqlplus can not connect to the database, or sqlplus binary not found), you have to add this (default) condition: <\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: yaml; title: ; notranslate\" title=\"\">\n      failed_when: &quot;number_of_users.rc != 0 or &#039;ORA-&#039; in number_of_users.stdout&quot;\n<\/pre><\/div>\n\n\n<p>But caution! Not all modules will have an <code>rc<\/code> field.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-tuning-perform-several-checks-at-once\">Tuning: Perform several checks at once<\/h2>\n\n\n\n<p>Conceptually, Ansible is not the fastest tool. For each task, it will usually login with ssh to the remote server. If you have to run several checks in the shell, then, instead of running each in a separate task, you can run all these check-commands in one shell-task, and evaluate the result afterwards.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: yaml; title: ; notranslate\" title=\"\">\n    - name: run many check commands\n      ansible.builtin.shell: |\n        mount | grep &#039; on \/u00 &#039;  #check if \/u00 is mounted\n        rpm -q ksh 2&gt;&amp;1  #check if ksh is installed\n        exit 0 # do not fail if rpm exit != 0; we will do our own errorhandling\n      register: checks\n\n    - name: fail if no \/u00 is mounted\n      fail:\n        msg: &quot;\/u00 is not mounted&quot;\n      when: &quot;&#039; on \/u00 &#039; not in checks.stdout&quot;\n\n    - name: No ksh found, try to install it\n      yum:\n        name: ksh\n        state: present\n      when: &quot;&#039;package ksh is not installed&#039; in checks.stdout&quot;\n\n<\/pre><\/div>\n\n\n<p>If you only want to throw an error, then you can do it directly in the shell-task:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: yaml; title: ; notranslate\" title=\"\">\nwhen: &quot;&#039; on \/u00 &#039; not in checks.stdout&quot; or &#039;package ksh is not installed&#039; in checks.stdout\n<\/pre><\/div>\n\n\n<p> But if you parse the output afterwards, you can run tasks to fix the error. <\/p>\n\n\n\n<p>Sometimes it is difficult to parse the output if some commands return the same output, e.g. &#8220;OK&#8221;.<br>If your check-commands always return exactly 1 line, then you can directly parse the output of the command. The output of the 3rd command is in <code>checks.stdout_lines[2]<\/code>.<br>In the above example that will not work because <code>grep<\/code> will return the exit-code 0 (not found) or 1 (found) plus the found line. So, expand it as: <code>mount | grep ' on \/u00 ' || echo error<\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-print-errormessages-more-readable\">Print errormessages more readable<\/h2>\n\n\n\n<p>Do not fail the task itself, it is very usually unreadable because all information is printed on one line.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"657\" height=\"124\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/09\/image-10.png\" alt=\"\" class=\"wp-image-40296\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/09\/image-10.png 657w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/09\/image-10-300x57.png 300w\" sizes=\"auto, (max-width: 657px) 100vw, 657px\" \/><\/figure>\n\n\n\n<p>Instead, use<code> ignore_errors: true <\/code>and <code>failed_when: false<\/code> in the task. Do the errorhandling in a separate task with a customized errormessage. To print the multiline list of stdout_lines, use <code>debug:<\/code> otherwise you can directy use <code>ansible.builtin.fail: <\/code>with a customized <code>message: <\/code><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: yaml; title: ; notranslate\" title=\"\">\n    - name: force sqlplus to throw error because of missing environment\n      ansible.builtin.shell: |\n        \/u00\/app\/oracle\/product\/19.7.0\/bin\/sqlplus -L \/ as sysdba @myscript.sql 2&gt;&amp;1\n      register: checks\n      ignore_errors: true\n      failed_when: false\n\n    - name: Check for errors of task before\n      debug: var=checks.stdout_lines\n      failed_when: checks.rc != 0 or &#039;ORA-&#039; in checks.stdout\n      when: checks.rc != 0 or &#039;ORA-&#039; in checks.stdout\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"658\" height=\"181\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/09\/image-11.png\" alt=\"\" class=\"wp-image-40298\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/09\/image-11.png 658w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/09\/image-11-300x83.png 300w\" sizes=\"auto, (max-width: 658px) 100vw, 658px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-re-run-failed-hosts\">Re-run failed hosts<\/h2>\n\n\n\n<p>As an example for this scenario: A customer of mine will do an offline backup of the development databases. And I have to run an Ansible playbook against all databases. If the playbook for this host is run at the backup time, it will fail because the database is down. But after some minutes the database will be restarted. <\/p>\n\n\n\n<p>What we can do now?<\/p>\n\n\n\n<p>Wait until the database is up again. That is possible, see the example of <code>ansible.builtin.wait_for<\/code> in my blog post <a href=\"https:\/\/www.dbi-services.com\/blog\/parallel-execution-of-ansible-roles\/\">Parallel execution of Ansible roles<\/a>. But for this scenario it is a waste of time. The database can be stopped (not for backup) and will not be restarted within the next few minutes.<\/p>\n\n\n\n<p>Try later after a while. My playbook for all hosts (parallel forks=5) takes about 1 hour. The idea now is to remember the host with the stopped database and to continue with the next host. After the play finished for all hosts, restart the play for the remembered hosts.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The 1st play running against all database hosts:<\/li>\n\n\n\n<li>gets the status of the databases on the host<\/li>\n\n\n\n<li>assigns the database instances to a <code>is_running<\/code> and a <code>not_open<\/code> list<\/li>\n\n\n\n<li>Include the role to run against the running databases<\/li>\n\n\n\n<li>Dynamically add the host to the group <code>re_run_if_not_open<\/code> if there are <code>not_open<\/code> databases<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The next play only runs for the <code>re_run_if_not_open<\/code> group<\/li>\n\n\n\n<li>Include the role to run against the (hopefully now running) databases<\/li>\n\n\n\n<li>If the database then is still down, we assume it is stopped permanently.<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Errors in tasks &#8211; abort or ignore? Per default, if a task in a playbook fails, then the execution of the playbook is stopped for that host. As you can see, the 2nd task is not executed. If you want to continue in such a case, the ignore_errors parameter is your friend Custom error conditions [&hellip;]<\/p>\n","protected":false},"author":123,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1321],"tags":[2600,3668],"type_dbi":[],"class_list":["post-39033","post","type-post","status-publish","format-standard","hentry","category-ansible","tag-ansible-2","tag-errorhandling"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.2) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Errorhandling in Ansible - dbi Blog<\/title>\n<meta name=\"description\" content=\"Handling errors in Ansible playbooks. Error conditions, ignoring errors, recovery of an error, re-run failed tasks\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/errorhandling-in-ansible\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Errorhandling in Ansible\" \/>\n<meta property=\"og:description\" content=\"Handling errors in Ansible playbooks. Error conditions, ignoring errors, recovery of an error, re-run failed tasks\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/errorhandling-in-ansible\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2025-09-18T13:54:32+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-09-18T14:09:33+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/06\/image-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"847\" \/>\n\t<meta property=\"og:image:height\" content=\"142\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Martin Bracher\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Martin Bracher\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/errorhandling-in-ansible\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/errorhandling-in-ansible\/\"},\"author\":{\"name\":\"Martin Bracher\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/86cb065eea74ac30961c4cc45ce56c9e\"},\"headline\":\"Errorhandling in Ansible\",\"datePublished\":\"2025-09-18T13:54:32+00:00\",\"dateModified\":\"2025-09-18T14:09:33+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/errorhandling-in-ansible\/\"},\"wordCount\":655,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/errorhandling-in-ansible\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/06\/image-1.png\",\"keywords\":[\"Ansible\",\"errorhandling\"],\"articleSection\":[\"Ansible\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/errorhandling-in-ansible\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/errorhandling-in-ansible\/\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/errorhandling-in-ansible\/\",\"name\":\"Errorhandling in Ansible - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/errorhandling-in-ansible\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/errorhandling-in-ansible\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/06\/image-1.png\",\"datePublished\":\"2025-09-18T13:54:32+00:00\",\"dateModified\":\"2025-09-18T14:09:33+00:00\",\"author\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/86cb065eea74ac30961c4cc45ce56c9e\"},\"description\":\"Handling errors in Ansible playbooks. Error conditions, ignoring errors, recovery of an error, re-run failed tasks\",\"breadcrumb\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/errorhandling-in-ansible\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/errorhandling-in-ansible\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/errorhandling-in-ansible\/#primaryimage\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/06\/image-1.png\",\"contentUrl\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/06\/image-1.png\",\"width\":847,\"height\":142},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/errorhandling-in-ansible\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/www.dbi-services.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Errorhandling in Ansible\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/\",\"name\":\"dbi Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/86cb065eea74ac30961c4cc45ce56c9e\",\"name\":\"Martin Bracher\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/864a93d77bcd4cd44bab880a88f25fb5173ffbfac8e6e8775f0b4e056a4fbb56?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/864a93d77bcd4cd44bab880a88f25fb5173ffbfac8e6e8775f0b4e056a4fbb56?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/864a93d77bcd4cd44bab880a88f25fb5173ffbfac8e6e8775f0b4e056a4fbb56?s=96&d=mm&r=g\",\"caption\":\"Martin Bracher\"},\"url\":\"https:\/\/www.dbi-services.com\/blog\/author\/martinbracher\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Errorhandling in Ansible - dbi Blog","description":"Handling errors in Ansible playbooks. Error conditions, ignoring errors, recovery of an error, re-run failed tasks","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/errorhandling-in-ansible\/","og_locale":"en_US","og_type":"article","og_title":"Errorhandling in Ansible","og_description":"Handling errors in Ansible playbooks. Error conditions, ignoring errors, recovery of an error, re-run failed tasks","og_url":"https:\/\/www.dbi-services.com\/blog\/errorhandling-in-ansible\/","og_site_name":"dbi Blog","article_published_time":"2025-09-18T13:54:32+00:00","article_modified_time":"2025-09-18T14:09:33+00:00","og_image":[{"width":847,"height":142,"url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/06\/image-1.png","type":"image\/png"}],"author":"Martin Bracher","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Martin Bracher","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/errorhandling-in-ansible\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/errorhandling-in-ansible\/"},"author":{"name":"Martin Bracher","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/86cb065eea74ac30961c4cc45ce56c9e"},"headline":"Errorhandling in Ansible","datePublished":"2025-09-18T13:54:32+00:00","dateModified":"2025-09-18T14:09:33+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/errorhandling-in-ansible\/"},"wordCount":655,"commentCount":0,"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/errorhandling-in-ansible\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/06\/image-1.png","keywords":["Ansible","errorhandling"],"articleSection":["Ansible"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/errorhandling-in-ansible\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/errorhandling-in-ansible\/","url":"https:\/\/www.dbi-services.com\/blog\/errorhandling-in-ansible\/","name":"Errorhandling in Ansible - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/errorhandling-in-ansible\/#primaryimage"},"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/errorhandling-in-ansible\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/06\/image-1.png","datePublished":"2025-09-18T13:54:32+00:00","dateModified":"2025-09-18T14:09:33+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/86cb065eea74ac30961c4cc45ce56c9e"},"description":"Handling errors in Ansible playbooks. Error conditions, ignoring errors, recovery of an error, re-run failed tasks","breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/errorhandling-in-ansible\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/errorhandling-in-ansible\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/errorhandling-in-ansible\/#primaryimage","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/06\/image-1.png","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/06\/image-1.png","width":847,"height":142},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/errorhandling-in-ansible\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Errorhandling in Ansible"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/86cb065eea74ac30961c4cc45ce56c9e","name":"Martin Bracher","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/864a93d77bcd4cd44bab880a88f25fb5173ffbfac8e6e8775f0b4e056a4fbb56?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/864a93d77bcd4cd44bab880a88f25fb5173ffbfac8e6e8775f0b4e056a4fbb56?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/864a93d77bcd4cd44bab880a88f25fb5173ffbfac8e6e8775f0b4e056a4fbb56?s=96&d=mm&r=g","caption":"Martin Bracher"},"url":"https:\/\/www.dbi-services.com\/blog\/author\/martinbracher\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/39033","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/123"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=39033"}],"version-history":[{"count":18,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/39033\/revisions"}],"predecessor-version":[{"id":40307,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/39033\/revisions\/40307"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=39033"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=39033"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=39033"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=39033"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}