Skip to content

Instantly share code, notes, and snippets.

@F5Training
Last active October 2, 2021 05:08
Show Gist options
  • Save F5Training/ec5d10b5966f159c53986728c67c0c3f to your computer and use it in GitHub Desktop.
Save F5Training/ec5d10b5966f159c53986728c67c0c3f to your computer and use it in GitHub Desktop.
---
- name: Change First Login Admin Password
hosts: bigipXa
gather_facts: false
connection: local
vars:
provider:
server: "{{ inventory_hostname }}"
user: "{{ admin_user }}"
password: "{{ admin_password }}"
validate_certs: false
tasks:
- name: Task 1 - Change Admin Password
# no_log: true
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"
vars:
ansible_python_interpreter: python3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment