cancel
Showing results for 
Search instead for 
Did you mean: 
Roldo
Mission Specialist
Mission Specialist
  • 311 Views

Typo in ch01s07

Jump to solution

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.

 

1 Solution

Accepted Solutions
Chetan_Tiwary_
Community Manager
Community Manager
  • 275 Views

@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 ).

View solution in original post

2 Replies
Chetan_Tiwary_
Community Manager
Community Manager
  • 283 Views

@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

Chetan_Tiwary_
Community Manager
Community Manager
  • 276 Views

@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 ).

Join the discussion
You must log in to join this conversation.