mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Hate to do this, but URI module docs were constructing messed up RST files, so removing examples for now. Will ask someone to work on them.
This commit is contained in:
parent
ae2d7eb7af
commit
c000bd846b
2 changed files with 3 additions and 30 deletions
|
@ -401,8 +401,8 @@ Transport
|
||||||
|
|
||||||
Ansible uses "Connection Plugins" to define types of available transports. These are simply how ansible will reach out to managed systems. Transports included are paramiko (the default SSH transport), SSH (using openssh), fireball (an SSH bootstrapped accelerated connection plugin), and local.
|
Ansible uses "Connection Plugins" to define types of available transports. These are simply how ansible will reach out to managed systems. Transports included are paramiko (the default SSH transport), SSH (using openssh), fireball (an SSH bootstrapped accelerated connection plugin), and local.
|
||||||
|
|
||||||
When_*
|
When
|
||||||
++++++
|
++++
|
||||||
|
|
||||||
When statements (when_string, when_changed, when_boolean, when_integer, etc) are easier to write forms of the only_if conditional. They can be affixed to any task to make that task decide to run only when an expression involving variables or facts is actually true.
|
When statements (when_string, when_changed, when_boolean, when_integer, etc) are easier to write forms of the only_if conditional. They can be affixed to any task to make that task decide to run only when an expression involving variables or facts is actually true.
|
||||||
|
|
||||||
|
|
29
library/uri
29
library/uri
|
@ -105,40 +105,13 @@ options:
|
||||||
required: false
|
required: false
|
||||||
default: 200
|
default: 200
|
||||||
HEADER_:
|
HEADER_:
|
||||||
description: >
|
description: Any parameter starting with "HEADER_" is a sent with your request as a header. For example, HEADER_Content-Type="application/json" would send the header "Content-Type" along with your request with a value of "application/json".
|
||||||
Any parameter starting with "HEADER_" is a sent with your request as a header. For example,
|
|
||||||
HEADER_Content-Type="application/json" would send the header "Content-Type" along with your
|
|
||||||
request with a value of "application/json".
|
|
||||||
required: false
|
required: false
|
||||||
default: null
|
default: null
|
||||||
others:
|
others:
|
||||||
description:
|
description:
|
||||||
- all arguments accepted by the M(file) module also work here
|
- all arguments accepted by the M(file) module also work here
|
||||||
required: false
|
required: false
|
||||||
examples:
|
|
||||||
- code: "uri: url=http://www.awesome.com method=GET"
|
|
||||||
description: "Check that you can connect to a page and it returns a status 200"
|
|
||||||
|
|
||||||
- code: |
|
|
||||||
action: uri url=http://www.awesome.com method=GET return_content=yes
|
|
||||||
register: webpage
|
|
||||||
|
|
||||||
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: |
|
|
||||||
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: |
|
|
||||||
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
|
|
||||||
|
|
||||||
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."
|
|
||||||
|
|
||||||
# informational: requirements for nodes
|
# informational: requirements for nodes
|
||||||
requirements: [ urlparse, httplib2 ]
|
requirements: [ urlparse, httplib2 ]
|
||||||
author: Romeo Theriault
|
author: Romeo Theriault
|
||||||
|
|
Loading…
Reference in a new issue