Can't create provisioning template using theforeman.foreman.provisioning_templates

Problem:

    - name: Create a PXElinux Template
        ansible.builtin.include_role:
           name: theforeman.foreman.provisioning_templates
        vars:
           foreman_server_url: https://10.34.58.90/
           foreman_username: admin
           foreman_password: admin
           foreman_validate_certs: false
           foreman_provisioning_template:
           foreman_provisioning_templates:
             - name: WL-RH8-PXE
               kind: PXELinux
               template: "WL-RH8-PXE"
               filename: "WL-RH8-PXE"
               state: present
        register:  pxestate

=> template not created !

ok: [10.34.58.90] => (item={'name': 'WL-RH8-PXE', 'kind': 'PXELinux', 'template': 'WL-RH8-PXE', 'filename': 'WL-RH8-PXE', 'state': 'present'}) => {
    "ansible_loop_var": "item",
    "changed": false,
    "diff": {
        "after": {
            "provisioning_templates": [
                {
                    "id": 148,
                    "location_ids": [
                        2
                    ],
                    "locked": false,
                    "name": "WL-RH8-PXE",
                    "operatingsystem_ids": [],
                    "organization_ids": [],
                    "snippet": false,
                    "template": "WL-RH8-PXE",
                    "template_kind_id": 2
                }
            ]
        },
        "before": {
            "provisioning_templates": [
                {
                    "id": 148,
                    "location_ids": [
                        2
                    ],
                    "locked": false,
                    "name": "WL-RH8-PXE",
                    "operatingsystem_ids": [],
                    "organization_ids": [],
                    "snippet": false,
                    "template": "WL-RH8-PXE",
                    "template_kind_id": 2
                }
            ]
        }
    },
    "entity": {
        "provisioning_templates": [
            {
                "created_at": "2023-03-20 15:44:32 UTC",
                "description": null,
                "id": 148,
                "locations": [
                    {
                        "description": null,
                        "id": 2,
                        "name": "Default Location",
                        "title": "Default Location"
                    }
                ],
                "locked": false,
                "name": "WL-RH8-PXE",
                "operatingsystems": [],
                "organizations": [],
                "os_default_templates": [],
                "snippet": false,
                "template": "WL-RH8-PXE",
                "template_combinations": [],
                "template_kind_id": 2,
                "template_kind_name": "PXELinux",
                "updated_at": "2023-03-20 15:44:32 UTC"
            }
        ]
    },
    "invocation": {
        "module_args": {
            "audit_comment": null,
            "file_name": null,
            "kind": "PXELinux",
            "locations": null,
            "locked": null,
            "name": "WL-RH8-PXE",
            "operatingsystems": null,
            "organizations": null,
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "server_url": "https://10.34.58.90/",
            "state": "present",
            "template": "WL-RH8-PXE",
            "updated_name": null,
            "username": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "validate_certs": false
        }
    },
    "item": {
        "filename": "WL-RH8-PXE",
        "kind": "PXELinux",
        "name": "WL-RH8-PXE",
        "state": "present",
        "template": "WL-RH8-PXE"
    }
}
META: role_complete for 10.34.58.90

Expected outcome:
a new template in foreman

Foreman and Proxy versions:
foreman : 3.5.2
ansible collection : 3.9.0

Distribution and version:
RHEL 8.7

Other relevant data:

(I took the liberty to change the subject and reformat your post for better readability)

The output suggests that the template is already there.

However, it doesn’t have any organizations set, so if you’re browsing the templates for a specific org in the UI, you won’t see that.

Ok, then looking up with “any” I finally found them !
seems different from using hammer where it goes to default ?