summaryrefslogtreecommitdiffstats
path: root/ansible_collections/dellemc/openmanage/roles/idrac_gather_facts/molecule/enclosure/converge.yml
blob: f83d84ac711d2936c8fb0ac388aa18c9c0259157 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
---
- name: Converge idrac_gather_facts for Enclosure
  hosts: all
  connection: local
  gather_facts: true
  vars:
    hostname: "{{ lookup('env', 'hostname') }}"
    username: "{{ lookup('env', 'username') }}"
    password: "{{ lookup('env', 'password') }}"
    validate_certs: false
    target:
      - Enclosure
    idrac_gather_facts_uri_method: "GET"
    idrac_gather_facts_uri_headers:
      Accept: "application/json"
      Content-Type: "application/json"
      OData-Version: "4.0"
    idrac_gather_facts_uri_body_format: "json"
    idrac_gather_facts_uri_status_code:
      - 200
      - 400
      - 401
      - 404
      - -1
    idrac_gather_facts_uri_return_content: true
    diff_data: {}
    exclude_keys: []

  tasks:
    - name: Gather Facts for the Enclosure component
      ansible.builtin.include_role:
        name: "idrac_gather_facts"

    - name: Assert enclosure dict for length
      ansible.builtin.assert:
        that:
          - "{{ enclosure | length > 0 }}"

    - name: Call assertion
      ansible.builtin.include_tasks: ../../tests/asserts/enclosure_assert.yml
      with_items: "{{ enclosure }}"
      loop_control:
        loop_var: enclosure_data
      when: enclosure | length > 0