Why does the Ansible URI module convert a string to a boolean?

Solution Verified - Updated -

Issue

  • Why does the Ansible URI module convert a string to a boolean?
TASK [Calling testing build] ***************************************************
{
    "content_length": "102",
    "status": 400,
    "changed": false,
    "connection": "close",
    "vary": "Accept, Accept-Language, Origin, Cookie",
    "elapsed": 0,
    "x_api_time": "0.193s",
    "content_language": "en",
    "content_type": "application/json",
    "date": "Tue, 30 Jun 2020 15:31:23 GMT",
    "x_api_product_version": "3.7.1",
    "msg": "Status code was 400 and not [200, 201]: HTTP Error 400: Bad Request",
    "_ansible_no_log": false,
    "x_api_node": "localhost",
    "url": "https://rh-tower.example.org/api/v2/workflow_job_templates/12/launch/",
    "x_api_product_name": "Red Hat Ansible Tower",
    "json": {
        "variables_needed_to_start": [
            "Value True for 'backup_tag' expected to be one of ['True', 'False']."
        ]
    },
    "server": "nginx",
    "content": "{\"variables_needed_to_start\":[\"Value True for 'backup_tag' expected to be one of ['True', 'False'].\"]}",
    "x_api_total_time": "0.240s",
    "allow": "GET, POST, HEAD, OPTIONS",
    "invocation": {
        "module_args": {
            "directory_mode": null,
            "force": false,
            "remote_src": null,
            "status_code": [
                "200",
                " 201"
            ],
            "follow": false,
            "owner": null,
            "body_format": "json",
            "client_key": null,
            "group": null,
            "use_proxy": true,
            "unix_socket": null,
            "unsafe_writes": null,
            "serole": null,
            "content": null,
            "setype": null,
            "follow_redirects": "safe",
            "return_content": true,
            "method": "POST",
            "body": {
                "extra_vars": {
                    "backup_tag": true,
                    "it_mod_tag": "testing"
                }
            },
            "timeout": 30,
            "src": null,
            "dest": null,
            "selevel": null,
            "force_basic_auth": true,
            "removes": null,
            "http_agent": "ansible-httpget",
            "user": "admin",
            "regexp": null,
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "url_password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "url": "https://rh-tower.example.org/api/v2/workflow_job_templates/12/launch/",
            "backup": null,
            "seuser": null,
            "client_cert": null,
            "creates": null,
            "headers": {
                "Content-Type": "application/json"
            },
            "delimiter": null,
            "mode": null,
            "url_username": "admin",
            "attributes": null,
            "validate_certs": false
        }
    },
    "redirected": false
}

Environment

  • Red Hat Ansible Tower 3.7

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content