Forum Discussion
lowone
Nimbostratus
Nov 21, 2019REST API example change password
I need to change the password for admin and root accounts on our big-ip servers. I found this api end point but need more info on the parameters or a working example. https://clouddocs.f5...
Chad_Wise
Employee
Jul 16, 2025---
- name: View and Update user
hosts: f5
connection: local
gather_facts: false
tasks:
- name: Login via uri Get token
tags: basic
ansible.builtin.uri:
url: 'https://{{ ansible_host }}/mgmt/shared/authn/login'
return_content: true
force_basic_auth: true
method: POST
body_format: json
body: "{ \"username\": \"admin\", \"password\": \"S3cretP@55word!\", \"loginProviderName\": \"tmos\"}"
headers:
Content-Type: application/json
validate_certs: false
register: token
- name: Show token
tags: basic
debug:
var: token.json.token.token
- name: View users
tags: basic
ansible.builtin.uri:
url: 'https://{{ ansible_host }}/mgmt/tm/auth/user/cwise'
headers:
Content-Type: application/json
X-F5-Auth-Token: "{{ token.json.token.token }}"
method: GET
return_content: true
validate_certs: false
register: users
- name: Show user cwise
tags: basic
debug:
var: users
- name: Update user passwd
ansible.builtin.uri:
url: 'https://{{ ansible_host }}/mgmt/tm/auth/user/cwise'
headers:
Content-Type: application/json
X-F5-Auth-Token: "{{ token.json.token.token }}"
method: PATCH
body: "{\"password\": \"n3w5ecret!\"}"
body_format: json
validate_certs: false
An Ansible example
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects