-
Notifications
You must be signed in to change notification settings - Fork 4
/
ise.password_reset.yaml
45 lines (41 loc) · 1.3 KB
/
ise.password_reset.yaml
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
---
#------------------------------------------------------------------------------
# Test ISE admin Password Change
#------------------------------------------------------------------------------
- name: Test ISE admin Password Change
hosts: ise
gather_facts: no
vars_files:
- vars/main.yaml
vars:
admin_username: admin
vars_prompt:
- name: admin_username
default: admin
private: no
prompt: What is the ISE admin username to reset ({{ admin_username }})?
- name: admin_password
private: yes
prompt: What is the new password?
pre_tasks:
- name: Get All Admin Users
cisco.ise.admin_user_info:
ise_hostname: "{{ ansible_host }}"
ise_username: "{{ ise_username }}"
ise_password: "{{ ise_password }}"
ise_verify: "{{ ise_verify }}"
ise_debug: "{{ ise_debug }}"
register: admins_info
ignore_errors: yes
- name: Existing ISE Admin Users
when:
- admins_info is defined
- admins_info.ise_response is defined
- admins_info.ise_response | count > 0
ansible.builtin.debug:
msg: "{{ admins_info.ise_response | json_query('[].name') }}"
roles:
- role: ise_cli_password_reset
vars:
username: "{{ admin_username }}"
password: "{{ admin_password }}"