###
# Copyright (2016) Hewlett Packard Enterprise Development LP
#
# Licensed under the Apache License, Version 2.0 (the "License");
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
###
---
- hosts: all
  vars:
    - config: "{{ playbook_dir }}/oneview_config.json"
  tasks:
    - name: Gather facts about the last 2 tasks
      oneview_task_facts:
        config: "{{ config }}"
        params:
          count: 2
      delegate_to: localhost

    - debug: var=tasks

    - name: Gather facts about the last 2 tasks associated to Server Profile templates
      oneview_task_facts:
        config: "{{ config }}"
        params:
          count: 2
          filter: "associatedResource.resourceCategory='server-profile-templates'"
      delegate_to: localhost

    - debug: var=tasks

###
# Copyright (2016) Hewlett Packard Enterprise Development LP
#
# Licensed under the Apache License, Version 2.0 (the "License");
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
###
---
- hosts: all
  vars:
    - config: "{{ playbook_dir }}/oneview_config.json"
  tasks:
    - name: Gather facts about the last 2 tasks
      oneview_task_facts:
        config: "{{ config }}"
        params:
          count: 2
      delegate_to: localhost

    - debug: var=tasks

    - name: Gather facts about the last 2 tasks associated to Server Profile templates
      oneview_task_facts:
        config: "{{ config }}"
        params:
          count: 2
          filter: "associatedResource.resourceCategory='server-profile-templates'"
      delegate_to: localhost

    - name: Gather facts about the last 5 tasks completed with warnings
      oneview_task_facts:
        config: "{{ config }}"
        params:
          count: 5
          filter: "taskState='Warning'"
      delegate_to: localhost

    - debug: var=tasks

Add another example of how to use task_facts module
Add another example of how to use task_facts module
