Fix typos in url lookup plugin options (#81587)

pull/81602/head
John HU 9 months ago committed by GitHub
parent 509be19357
commit 65a96daaf4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- lookup/url.py - Fix incorrect var/env/ini entry for `force_basic_auth`

@ -81,12 +81,12 @@ options:
version_added: "2.10"
default: False
vars:
- name: ansible_lookup_url_agent
- name: ansible_lookup_url_force_basic_auth
env:
- name: ANSIBLE_LOOKUP_URL_AGENT
- name: ANSIBLE_LOOKUP_URL_FORCE_BASIC_AUTH
ini:
- section: url_lookup
key: agent
key: force_basic_auth
follow_redirects:
description: String of urllib2, all/yes, safe, none to determine how redirects are followed, see RedirectHandlerFactory for more information
type: string

@ -52,3 +52,27 @@
- name: Test use_netrc=False
import_tasks: use_netrc.yml
- vars:
ansible_lookup_url_agent: ansible-test-lookup-url-agent
block:
- name: Test user agent
set_fact:
web_data: "{{ lookup('url', 'https://' ~ httpbin_host ~ '/user-agent') }}"
- name: Assert that user agent is set
assert:
that:
- ansible_lookup_url_agent in web_data['user-agent']
- vars:
ansible_lookup_url_force_basic_auth: yes
block:
- name: Test force basic auth
set_fact:
web_data: "{{ lookup('url', 'https://' ~ httpbin_host ~ '/headers', username='abc') }}"
- name: Assert that Authorization header is set
assert:
that:
- "'Authorization' in web_data.headers"

Loading…
Cancel
Save