summaryrefslogtreecommitdiff
path: root/test/integration/targets/tower_inventory/tasks/main.yml
blob: e1af6d645407f1c0289245f86de43d2a75d25fb6 (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
- name: Create an Inventory
  tower_inventory:
    name: my-inventory
    organization: Default
    state: present
  register: result

- assert:
    that:
      - "result is changed"

- name: Delete an Inventory
  tower_inventory:
    name: my-inventory
    organization: Default
    state: absent
  register: result

- assert:
    that:
      - "result is changed"

- name: Check module fails with correct msg
  tower_inventory:
    name: test-inventory
    description: Inventory Description
    organization: test-non-existing-org
    state: present
  register: result
  ignore_errors: true

- assert:
    that:
      - "result.msg =='Failed to update inventory, organization not found: The requested object could not be found.'"