--- - name: Retrieve random bofh excuse hosts: localhost gather_facts: false become: false tasks: - name: Retrieve excuse data ansible.builtin.uri: url: "https://bofh-api.bombeck.io/v1/excuses/random" return_content: true register: excuse - name: Display the excuse when: excuse is succeeded ansible.builtin.debug: msg: "{{ excuse.json | map(attribute='quote') }}"