Skip to content

Instantly share code, notes, and snippets.

@F5Training
Last active October 5, 2021 06:31
Show Gist options
  • Save F5Training/be52cc4a05d1369b4e0471ac689b088f to your computer and use it in GitHub Desktop.
Save F5Training/be52cc4a05d1369b4e0471ac689b088f to your computer and use it in GitHub Desktop.
---
- 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