Commit Graph

91 Commits (ffa4f0c427e9a3ab2af442f71a7616e5fa5ccd60)

Author SHA1 Message Date
techraf 7d09792758 Added 'backup' parameter to get_url module 2016-12-08 11:24:00 -05:00
Brian Coca 42d0ce8744 corrected version_added for new temp_dest feature 2016-12-08 11:23:50 -05:00
cspollar 7ac010977b Fixed typo in uri module example 2016-12-08 11:23:50 -05:00
sysadmin75 12c2c2b436 Adds tmp_dest option to get_url module. Addresses the issue in ansible/ansible#9512 2016-12-08 11:23:45 -05:00
Toshio Kuratomi f6353a548c Document and return an error if httplib2 >= 0.7 is not present. We
can't use httplib2 0.6.x and below because they do not verify TLS
certificates and thus are insecure.

Fixes #1875
2016-12-08 11:23:44 -05:00
Toshio Kuratomi d5f3ac2a1d Remove debugging 2016-12-08 11:23:41 -05:00
Toshio Kuratomi 931fa9b6b2 xmlcharrefreplace is only for encoding, not for decoding :-( 2016-12-08 11:23:41 -05:00
Brian Coca 0540769677 specified that uri must be uppercase 2016-12-08 11:23:41 -05:00
Brian Coca 5b1a508d6a restored quotes to checksum description to avoid breaking docs 2016-12-08 11:23:39 -05:00
muszynski@so1.net 2e3ad2b80a description for the get_url module describing checksum verification before file download 2016-12-08 11:23:39 -05:00
Sam Mingo 75473c0fd0 Update get_url.py
Fixed typo with header parameter to get_url in the documentation.
2016-12-08 11:23:35 -05:00
Colin Hutchinson 9d77cef5be Remove the sample SHA256
putting a full sha256 made the width of the table in the generated docs not fit on some screens
2016-12-08 11:23:34 -05:00
Toshio Kuratomi 1f9580f257 Quote checksum description to fix docs 2016-12-08 11:23:30 -05:00
muffl0n 6482d1344a Allow additional hashing algorithms. Directly use hashlib and check if used algorithm is supported. 2016-12-08 11:23:28 -05:00
Brian Coca 3b94910d4e minor doc fixes to get_url 2016-12-08 11:23:26 -05:00
Brian Coca e5fe763474 fixed version added 2016-12-08 11:23:26 -05:00
Dan 5b4e7c797f Added header support
Added the ability to pass custom http headers to the fetch_url method.
2016-12-08 11:23:25 -05:00
Brian Coca f15ce1433a added version_added to body_format in uri 2016-12-08 11:23:25 -05:00
Brian Coca 87c8d016dc added version_Added to get_url's force_basic_auth 2016-12-08 11:23:22 -05:00
Iiro Uusitalo d6fc0ac5be uri.py is not using module_utils/urls.py from ansible core 2016-12-08 11:23:21 -05:00
Hennadiy (Gena) Verkh 098126807d Update uri.py
Added methods 'TRACE', 'CONNECT' from https://www.rfc-editor.org/rfc/rfc2616.txt, section 5.1.1
Added method 'REFRESH'
2016-12-08 11:23:19 -05:00
Hennadiy (Gena) Verkh 852c232b2d Removed method restriction in uri module 2016-12-08 11:23:19 -05:00
Iiro Uusitalo b92dabb9fb Refactor force basic auth, now all modules which use fetch_url() can use force_basic_auth 2016-12-08 11:23:19 -05:00
James Meickle 8197d7e640 Change uri debug example 2016-12-08 11:23:15 -05:00
Annika Backstrom 6b2c89a422 Force redownload if sha256sum does not match 2016-12-08 11:23:13 -05:00
Toshio Kuratomi 5118d0e3b1 Add note about redirects proxies
Fixes #1574
2016-12-08 11:23:12 -05:00
Toshio Kuratomi 2e7dcf3317 Small cleanups. * Import url(lib|parse|lib2) if needed by the module rather than relying on module_utils.urls to do so. * Remove stdlib modules from requirements * Use the if __name__ conditional for invoking main() 2016-12-08 11:23:11 -05:00
murdochr aae140e6cd Change docs to reflect correct when syntax for matching variable strings as per MD's forum post as this fails with unhelpful error otherwise.
https://groups.google.com/forum/#!topic/ansible-project/D2hQzZ_jNuM
2016-12-08 11:23:11 -05:00
Greg DeKoenigsberg eb881d7d5d Proper author info for all remaining modules 2016-12-08 11:23:07 -05:00
Toshio Kuratomi b6257f73b4 Properly flip default for verifying server cert. Add nice error messages when the cert is invalid 2016-12-08 11:23:02 -05:00
Toshio Kuratomi a4497a7ddf Change uri module to validate ssl certs by default 2016-12-08 11:23:02 -05:00
whiter 8ee2102993 Doc update to highlight use of body_type parameter 2016-12-08 11:23:02 -05:00
Toshio Kuratomi 9eac68b417 Fix problem writing binary content to a temporary file in the uri module.
Fixes https://github.com/ansible/ansible/issues/10938
Fixes https://github.com/ansible/ansible/issues/7606
2016-12-08 11:23:00 -05:00
Schmitt Christian cc71372182 Removed the wrong Note
Currently as already in the description, this module works with proxy settings.
2016-12-08 11:22:54 -05:00
Sébastien Bocahu f88f895795 Removes YAML body_format option
It would require adding a dependency to the YAML module while it might
not provide much benefit (has anybody seen a HTTP API taking YAML as
input ?)
2016-12-08 11:22:51 -05:00
Sébastien Bocahu 4af3b60167 Add body_format for handling of JSON and YAML body
body_format is a new optional argument that enables handling of JSON or
YAML serialization format for the body argument.
When set to either 'json' or 'yaml', the body argument can be a dict or list.
The body will be encoded, and the Content-Type HTTP header will be set,
accordingly to the body_format argument.

Example:

- name: Facette - Create memory graph
  uri:
    method: POST
    url: http://facette/api/v1/library/graphs
    status_code: 201
    body_format: json
    body:
      name: "{{ ansible_fqdn }} - Memory usage"
      attributes:
        Source": "{{ ansible_fqdn }}"
        link: "1947a490-8ac6-4bf2-47c1-ff74272f8b32"
2016-12-08 11:22:51 -05:00
zitterbacke 264a16d822 fix uri modul for JSON-escape quotation marks
consider the following response body (content) of a REST/JSON webservice containing escaped quotation marks:

```json
{ "key": "\"works\"" }
```

decoding this string not as raw will lose the backslash as JSON escape. later json.loads will fail to parse.

Inspired by [this thread](https://groups.google.com/forum/#!topic/ansible-project/kymtiloDme4) on the mailing list and the following python shell code:

```python
import json
string=r'{ "key": "\"works\"" }'
json.loads(string)
json.loads(string.decode('raw_unicode_escape'))
json.loads(string.decode('unicode_escape'))
```
2016-12-08 11:22:47 -05:00
Dan Rue d3c686d632 Do not mark "skipped" when changed is false
When using the "creates" option with the uri module, set changed
to False if the file already exists. This behavior is consistent with
other modules which use "creates", such as command and shell.
2016-12-08 11:22:43 -05:00
Toshio Kuratomi 104b2d684c Add text/json as a mimetype to try deserializing
Fixes #503
2016-12-08 11:22:33 -05:00
Toshio Kuratomi 34d65647bf Move from md5 to sha1 to work on FIPS-140 enabled systems 2016-12-08 11:22:25 -05:00
Michael DeHaan 677ed39cb4 Renames. 2016-12-08 11:22:25 -05:00