Ansible is not accepting customer fail module

- name:                             "Waiting for URL to come up."
  uri:
    url:                            "{{ url }}/libs/granite/core/content/login.html"
    status_code:                    200
  register:                         result
  until:                            result.status == 200
  retries:                          10
  delay:                            10
  fail:
    msg: "Service was not available after 10 minutes. Files were installed except for the ones that required AEM to be available"

I'm adding the fail message so when the task fails we will have a meaningful output. However I receive an error:

 line 3, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name:                             \"Waiting for URL to come up.\"\n  ^ here\n"}[0

I checked at the documentation and it seems that is the right way to do. What am I missing?



Read more here: https://stackoverflow.com/questions/66335114/ansible-is-not-accepting-customer-fail-module

Content Attribution

This content was originally published by WhoAmI at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: