sks
sks

Reputation: 146

Ansible is masking strings which matches password with URI module

Using uri module to get some data from an API

 - name: Fetch Data
    uri:
       url: "https://192.168.1.1:8080/api/data"
       headers:
       timeout: 60
       method: GET
       user: oes
       password: "123"
       force_basic_auth: yes
       status_code: 200
       return_content: yes
       validate_certs: no
    register: response
    ignore_errors: yes  

The response contains password (123) which is being masked to ***

{
  "Name":"sample",
  "Age":"10",
  "Roll No":"123"
}

could someone please help in find a way to avoid masking of password pattern from the response payload

Upvotes: 2

Views: 1117

Answers (1)

mdaniel
mdaniel

Reputation: 33223

Having already warned you about the please don't do that advice in the manual, you can circumvent the problem by tricking ansible into not knowing that 123 is your password:

- uri:
    url: https://oes:[email protected]:8080/api/data
    force_basic_auth: yes
    # etc etc but **omitting** user: and password:

Upvotes: 2

Related Questions