EX294 Transform data with filters and plugins • Set 2
EX294 Transform data with filters and plugins Practice Test 2 — 15 questions with explanations. Free, no signup.
Refer to the exhibit. After running the playbook, the 'content' field contains an HTML page. The team wants to extract the text inside the <h1> tags using Ansible filters. Which of the following tasks correctly extracts the content of the <h1> element?
Refer to the exhibit.
```
- name: Check Apache status
hosts: webservers
tasks:
- name: Get URL content
uri:
url: http://localhost/server-status
return_content: yes
register: result
- name: Debug output
debug:
var: result
```
Output:
```
ok: [web01] => {
"result": {
"changed": false,
"content": "<html><body><h1>Apache Status</h1>...</body></html>",
"status": 200,
"url": "http://localhost/server-status"
}
}
```