|
|
|
@ -33,8 +33,8 @@ DOCUMENTATION = '''
|
|
|
|
|
module: uri
|
|
|
|
|
short_description: Interacts with webservices
|
|
|
|
|
description:
|
|
|
|
|
- Interacts with HTTP and HTTPS webservices and supports Digest, Basic and WSSE
|
|
|
|
|
HTTP authentication mechanisms.
|
|
|
|
|
- Interacts with HTTP and HTTPS web services and supports Digest, Basic and WSSE
|
|
|
|
|
HTTP authentication mechanisms.
|
|
|
|
|
version_added: "1.1"
|
|
|
|
|
options:
|
|
|
|
|
url:
|
|
|
|
@ -45,7 +45,7 @@ options:
|
|
|
|
|
aliases: []
|
|
|
|
|
dest:
|
|
|
|
|
description:
|
|
|
|
|
- path of where to download the file to.
|
|
|
|
|
- path of where to download the file to (if desired).
|
|
|
|
|
- If I(dest) is a directory, the basename of the file on the remote server will be used.
|
|
|
|
|
required: false
|
|
|
|
|
default: null
|
|
|
|
@ -72,7 +72,7 @@ options:
|
|
|
|
|
default: "GET"
|
|
|
|
|
return_content:
|
|
|
|
|
description:
|
|
|
|
|
- Whether or not to return the body of the request in the "content" register variable.
|
|
|
|
|
- Whether or not to return the body of the request as a "content" key in the dictionary result.
|
|
|
|
|
required: false
|
|
|
|
|
choices: [ "yes", "no" ]
|
|
|
|
|
default: no
|
|
|
|
@ -120,27 +120,25 @@ examples:
|
|
|
|
|
description: "Check that you can connect to a page and it returns a status 200"
|
|
|
|
|
|
|
|
|
|
- code: |
|
|
|
|
|
uri: url=http://www.awesome.com method=GET return_content=yes
|
|
|
|
|
action: uri url=http://www.awesome.com method=GET return_content=yes
|
|
|
|
|
register: webpage
|
|
|
|
|
|
|
|
|
|
command: /usr/bin/uptime
|
|
|
|
|
when_string: '"AWESOME" in "${webpage.content}"'
|
|
|
|
|
action: fail
|
|
|
|
|
when_string: '"AWESOME" not in "${webpage.content}"'
|
|
|
|
|
|
|
|
|
|
description: Check that a page returns a status 200 and the word AWESOME is in the page contents.
|
|
|
|
|
|
|
|
|
|
- code: |
|
|
|
|
|
uri: url=https://your.jira.server.com/rest/api/2/issue/ method=POST user=your_username password=your_pass body='$FILE(issue.json)' force_basic_auth=yes status_code=201 HEADER_Content-Type="application/json"
|
|
|
|
|
action: uri url=https://your.jira.server.com/rest/api/2/issue/ method=POST user=your_username password=your_pass body='$FILE(issue.json)' force_basic_auth=yes status_code=201 HEADER_Content-Type="application/json"
|
|
|
|
|
description: "Create a JIRA issue."
|
|
|
|
|
|
|
|
|
|
- code: |
|
|
|
|
|
uri: url=https://your.form.based.auth.app.com/index.php method=POST body="name=your_username&password=your_password&enter=Sign%20in" status_code=302 HEADER_Content-Type="application/x-www-form-urlencoded"
|
|
|
|
|
action: uri url=https://your.form.based.auth.app.com/index.php method=POST body="name=your_username&password=your_password&enter=Sign%20in" status_code=302 HEADER_Content-Type="application/x-www-form-urlencoded"
|
|
|
|
|
register: login
|
|
|
|
|
|
|
|
|
|
uri: url=https://your.form.based.auth.app.com/dashboard.php method=GET return_content=yes HEADER_Cookie="${login.set_cookie}"
|
|
|
|
|
action: uri url=https://your.form.based.auth.app.com/dashboard.php method=GET return_content=yes HEADER_Cookie="${login.set_cookie}"
|
|
|
|
|
description: "Login to a form based webpage, then use the cookie that got returned to access the app in later tasks."
|
|
|
|
|
|
|
|
|
|
notes:
|
|
|
|
|
- This module doesn't yet support configuration for proxies.
|
|
|
|
|
# informational: requirements for nodes
|
|
|
|
|
requirements: [ urlparse, httplib2 ]
|
|
|
|
|
author: Romeo Theriault
|
|
|
|
|