summaryrefslogtreecommitdiff
path: root/test/integration/targets/tower_user/tasks/main.yml
blob: 41264b63b453096a6e42c9e5e83fec542f39a35f (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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
- name: Create a User
  tower_user:
    first_name: Joe
    last_name: User
    username: joe
    password: "{{ 65535 | random | to_uuid }}"
    email: joe@example.org
    state: present
  register: result

- assert:
    that:
      - "result is changed"

- name: Delete a User
  tower_user:
    username: joe
    email: joe@example.org
    state: absent
  register: result

- assert:
    that:
      - "result is changed"

- name: Create an Auditor
  tower_user:
    first_name: Joe
    last_name: Auditor
    username: joe
    password: "{{ 65535 | random | to_uuid }}"
    email: joe@example.org
    state: present
    auditor: true
  register: result

- assert:
    that:
      - "result is changed"

- name: Delete an Auditor
  tower_user:
    username: joe
    email: joe@example.org
    state: absent
  register: result

- assert:
    that:
      - "result is changed"

- name: Create a Superuser
  tower_user:
    first_name: Joe
    last_name: Super
    username: joe
    password: "{{ 65535 | random | to_uuid }}"
    email: joe@example.org
    state: present
    superuser: true
  register: result

- assert:
    that:
      - "result is changed"

- name: Delete a Superuser
  tower_user:
    username: joe
    email: joe@example.org
    state: absent
  register: result

- assert:
    that:
      - "result is changed"

- name: Test tower SSL parameter
  tower_user:
    first_name: Joe
    last_name: User
    username: joe
    password: "{{ 65535 | random | to_uuid }}"
    email: joe@example.org
    state: present
    validate_certs: true
    tower_host: http://foo.invalid
  ignore_errors: true
  register: result

- assert:
    that:
      - "'not verify ssl with non-https protocol' in (result.module_stdout + result.module_stderr)"