My current version of mediawiki installation is 1.32.0. I am trying to use Ansible to interface update Mediawiki.


There seems to be some contradictions in the API documentation.


·         The Help:Creating a bot - Wikipedia says that lgname, lgpassword and lgtoken should be used in a POST,

·         while the MediaWiki API help says that user id and password should be a part of the URI: api.php?action=login&lgname=user&lgpassword=password.

·         Also API:Main page - MediaWiki says that ”tokens is Deprecated. Get tokens for data-modifying actions”.


From the ansible.builtin.uri – Interacts with webservices — Ansible Documentation, the way to POST, is to insert


    body_format: form-urlencoded
      name: your_username
      password: your_password
      enter: Sign in


which I think must be


- name: Logging in to wiki.server
url: https://wiki.server/wiki/api.php?action=query&meta=tokens&type=login&format=json
method: POST
force_basic_auth: yes
    body_format: form-urlencoded
      lgname: your_username
      lgpassword: your_password
      lgtoken: Sign in


but this gives me


"warnings": {
                "main": {
                    "*": "Unrecognized parameters: lgname, lgtoken, lgpassword."

What is the correct documentation?


Your sincerily


Henrik Rasmussen

System administrator