Last active
October 5, 2021 06:31
-
-
Save F5Training/be52cc4a05d1369b4e0471ac689b088f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Reset and update passwords | |
hosts: bigips | |
gather_facts: false | |
connection: local | |
vars: | |
provider: | |
server: "{{ inventory_hostname }}" | |
user: "{{ admin_user }}" | |
password: "{{ admin_password }}" | |
validate_certs: false | |
tasks: | |
- name: Reset BIG-IP | |
bigip_config: | |
reset: yes | |
save: true | |
provider: "{{ provider }}" | |
- pause: | |
seconds: 15 | |
- name: Configure admin password | |
uri: | |
url: "https://{{ inventory_hostname }}/mgmt/shared/authz/users/admin" | |
method: PATCH | |
body: '{"oldPassword":"{{ admin_default_password }}","password":"{{ admin_password }}"}' | |
body_format: json | |
validate_certs: no | |
force_basic_auth: yes | |
user: "{{ admin_user }}" | |
password: "{{ admin_default_password }}" | |
headers: | |
Content-Type: "application/json" | |
tags: | |
adminpw |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment