Commit Graph

94 Commits (1ec0c1893acfbf45a203f57db5617d925c9779bd)

Author SHA1 Message Date
Brian Coca 144291120e restored quotes to checksum description to avoid breaking docs 9 years ago
JM 7943b3e6b0 description for the get_url module describing checksum verification before file download 9 years ago
Sam Mingo 7982d582d9 Update get_url.py
Fixed typo with header parameter to get_url in the documentation.
9 years ago
Colin Hutchinson ab50943887 Update get_url.py
use an abbreviated sha
9 years ago
Colin Hutchinson 880dc307b0 Remove the sample SHA256
putting a full sha256 made the width of the table in the generated docs not fit on some screens
9 years ago
Toshio Kuratomi 8412adc4f9 Quote checksum description to fix docs 9 years ago
muffl0n 4f0cf6d2ca Allow additional hashing algorithms. Directly use hashlib and check if
used algorithm is supported.
9 years ago
Brian Coca 587370e2e7 minor doc fixes to get_url 9 years ago
Brian Coca 76344db61e fixed version added 9 years ago
Dan 777d736baa Added header support
Added the ability to pass custom http headers to the fetch_url method.
9 years ago
Brian Coca 03a809a21c added version_added to body_format in uri 9 years ago
Brian Coca ca80b92233 added version_Added to get_url's force_basic_auth 9 years ago
Brian Coca 7ac642f406 Merge pull request #153 from woltage/devel
Refactor force basic auth, now all modules which use fetch_url() can use force_basic_auth
9 years ago
Brian Coca 11c6e6a3f5 Merge pull request #1179 from hver/devel
Allow custom methods in uri module
9 years ago
Iiro Uusitalo afd0222184 uri.py is not using module_utils/urls.py from ansible core 9 years ago
Iiro Uusitalo 4b1b10fa20 Refactor force basic auth, now all modules which use fetch_url() can use force_basic_auth 9 years ago
Hennadiy (Gena) Verkh f190f98b06 Update uri.py
Added methods 'TRACE', 'CONNECT' from https://www.rfc-editor.org/rfc/rfc2616.txt, section 5.1.1
Added method 'REFRESH'
9 years ago
Toshio Kuratomi 27e1aa7d10 Merge pull request #1634 from Eronarn/devel
Change uri debug example
9 years ago
Brian Coca b3d5479612 Merge pull request #687 from abackstrom/sha256-mismatch-redownload
get_url: Force redownload if sha256sum does not match
9 years ago
James Meickle 73390f8ecc Change uri debug example 9 years ago
Toshio Kuratomi 280ccfbb78 Add note about redirects proxies
Fixes #1574
9 years ago
Toshio Kuratomi 4519dd5f4d 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()
9 years ago
murdochr 9040c2f75c 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
9 years ago
Greg DeKoenigsberg 2a5f0bde87 Proper author info for all remaining modules 9 years ago
Toshio Kuratomi 5983d64d77 Properly flip default for verifying server cert. Add nice error messages when the cert is invalid 9 years ago
Toshio Kuratomi 7fea93835c Change uri module to validate ssl certs by default 9 years ago
whiter ba35cb8173 Doc update to highlight use of body_type parameter 9 years ago
Toshio Kuratomi b307f7bcba 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
10 years ago
Tom Paine 97b64abf75 Update uri.py
Move choices from description to choices field.
10 years ago
Hennadiy (Gena) Verkh 1f37f2a152 Removed method restriction in uri module 10 years ago
Schmitt Christian 9ebef6275d Removed the wrong Note
Currently as already in the description, this module works with proxy settings.
10 years ago
Sébastien Bocahu b2d570e991 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 ?)
10 years ago
Sébastien Bocahu 6b20c3890f 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"
10 years ago
Brian Coca 42d91951cf Merge pull request #537 from zitterbacke/patch-2
fix uri modul for JSON-escape quotation marks
should fix #121
10 years ago
Dan Rue c2f731e5bd 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.
10 years ago
Annika Backstrom a935baf7dd Force redownload if sha256sum does not match 10 years ago
zitterbacke 22e1b26bea 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'))
```
10 years ago
Toshio Kuratomi 9c6826e928 Add text/json as a mimetype to try deserializing
Fixes #503
10 years ago
Toshio Kuratomi 6317d3a988 Move from md5 to sha1 to work on FIPS-140 enabled systems 10 years ago
Michael DeHaan 0be8798858 Renames. 10 years ago
Michael DeHaan 385a037cd6 package files 10 years ago
Michael DeHaan c8e1a2077e file extensions! 10 years ago
Michael DeHaan 417309a626 Restructuring. 10 years ago
Michael DeHaan 73123b69fa Move modules into subdirectory. 10 years ago
James Cammarata 1ef592ff00 Push the expanduser call on the source down to slurp rather than fetch
Also moves the calculation of the destination file name until after
the slurp of the file contents, since the source as returned by slurp
may now be different, so we want to use that expanded path locally.

Fixes #8942
10 years ago
Will Thames 25c5250025 get_url module: Add timeout parameter 10 years ago
George Yoshida cd0dae890c For content-disposition response header field, try to parse filename parameter even if it's not quoted. 10 years ago
Brian Coca ac14a8d6ad unified calls to fs function vs duplicate functions for file and
directory
10 years ago
James Cammarata a9c2eefd06 Remove erroneous set of status_code causing a traceback in module uri
Fixes #7416
11 years ago
Christian Berendt bbcfda8c18 [get_url] check against lowered stripped sha256sum
The content of the sha256sum attribute should be lowered before comparing it with the calculated sha256sum.

In the following example the used sha256sum uses ABC.. and not abc.. and the check failed. This should not happen.

```
TASK: [get_url url=http://ftp.fau.de/apache/hadoop/common/hadoop-2.4.0/hadoop-2.4.0.tar.gz dest=/home/vagrant/hadoop-2.4.0.tar.gz mode=0644 sha256sum=024326AC68A1A68B5566B10F95609EAAFD9F70CFEB37FCA0E97CBB1674E57C3A] ***
failed: [instance000] => {"failed": true}
msg: The SHA-256 checksum for /home/vagrant/hadoop-2.4.0.tar.gz did not match 024326AC68A1A68B5566B10F95609EAAFD9F70CFEB37FCA0E97CBB1674E57C3A; it was 024326ac68a1a68b5566b10f95609eaafd9f70cfeb37fca0e97cbb1674e57c3a.

FATAL: all hosts have already failed -- aborting
```
11 years ago