Hello everyone!
While reading the ch01s07, I noticed that there is a typo in the code snippet below the topic "Using the Block and Rescue Directives to Recover or Roll Back":
- block:
- name: Check web site from web server
ansible.builtin.uri:
url: http://{{ ansible_fqdn }}
return_content: true
register: example_webpage
failed_when: example_webpage.status != 200
rescue:
- name: Restart web server
ansible.builtin.service:
name: httpd
status: restarted
To be more specific, in the rescue clause, the ansible.builtin.service is used with the option "status", but this is not supported by the module. The correct option should be "state".
Cheers!
Rolando.
@Roldo The fix is in place and will be released in the future release of this course ( until the course is updated after the release of AAP 2.5 ).
@Roldo You are right, thanks for pointing that out! I will report it for rectification.
https://docs.ansible.com/ansible/latest/collections/ansible/builtin/service_module.html
@Roldo The fix is in place and will be released in the future release of this course ( until the course is updated after the release of AAP 2.5 ).
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.