Class: Ansible::Ruby::Modules::Get_url
- Inherits:
-
Base
- Object
- Ansible::Ruby::Models::Base
- Base
- Ansible::Ruby::Modules::Get_url
- Defined in:
- lib/ansible/ruby/modules/generated/core/network/basics/get_url.rb,
lib/ansible/ruby/modules/custom/network/basics/get_url.rb
Overview
Downloads files from HTTP, HTTPS, or FTP to the remote server. The remote server I(must) have direct access to the remote resource. By default, if an environment variable C(<protocol>_proxy) is set on the target host, requests will be sent through that proxy. This behaviour can be overridden by setting a variable for this task (see ‘setting the environment <docs.ansible.com/playbooks_environment.html>`_), or by using the use_proxy option. HTTP redirects can redirect from HTTP to HTTPS so you should be sure that your proxy environment for both protocols is correct.
Instance Method Summary collapse
-
#backup ⇒ :yes, ...
Create a backup file including the timestamp information so you can get the original file back if you somehow clobbered it incorrectly.
-
#checksum ⇒ String?
If a checksum is passed to this parameter, the digest of the destination file will be calculated after it is downloaded to ensure its integrity and verify that the transfer completed successfully.
-
#dest ⇒ String
Absolute path of where to download the file to.,If C(dest) is a directory, either the server provided filename or, if none provided, the base name of the URL on the remote server will be used.
-
#force ⇒ :yes, ...
If C(yes) and C(dest) is not a directory, will download the file every time and replace the file if the contents change.
-
#force_basic_auth ⇒ :yes, ...
Httplib2, the library used by the uri module only sends authentication information when a webservice responds to an initial request with a 401 status.
-
#headers ⇒ Array<String>, ...
Add custom HTTP headers to a request in the format “key:value,key:value”.
-
#others ⇒ Object?
All arguments accepted by the M(file) module also work here.
-
#sha256sum ⇒ Object?
If a SHA-256 checksum is passed to this parameter, the digest of the destination file will be calculated after it is downloaded to ensure its integrity and verify that the transfer completed successfully.
-
#timeout ⇒ Integer?
Timeout in seconds for URL request.
-
#tmp_dest ⇒ String?
Absolute path of where temporary file is downloaded to.,Defaults to TMPDIR, TEMP or TMP env variables or a platform specific value,docs.python.org/2/library/tempfile.html#tempfile.tempdir.
- #to_h ⇒ Object
-
#url ⇒ String
HTTP, HTTPS, or FTP URL in the form (http|https|ftp)://[user]@host.domain/path.
-
#url_password ⇒ Object?
The password for use in HTTP basic authentication.
-
#url_username ⇒ Object?
The username for use in HTTP basic authentication.
-
#use_proxy ⇒ :yes, ...
If C(no), it will not use a proxy, even if one is defined in an environment variable on the target hosts.
-
#validate_certs ⇒ :yes, ...
If C(no), SSL certificates will not be validated.
Methods inherited from Base
Methods inherited from Ansible::Ruby::Models::Base
attr_option, attr_options, attribute, #initialize, remove_existing_validations, validates
Constructor Details
This class inherits a constructor from Ansible::Ruby::Models::Base
Instance Method Details
#backup ⇒ :yes, ...
29 |
# File 'lib/ansible/ruby/modules/generated/core/network/basics/get_url.rb', line 29 attribute :backup |
#checksum ⇒ String?
36 |
# File 'lib/ansible/ruby/modules/generated/core/network/basics/get_url.rb', line 36 attribute :checksum |
#dest ⇒ String
17 |
# File 'lib/ansible/ruby/modules/generated/core/network/basics/get_url.rb', line 17 attribute :dest |
#force ⇒ :yes, ...
25 |
# File 'lib/ansible/ruby/modules/generated/core/network/basics/get_url.rb', line 25 attribute :force |
#force_basic_auth ⇒ :yes, ...
62 |
# File 'lib/ansible/ruby/modules/generated/core/network/basics/get_url.rb', line 62 attribute :force_basic_auth |
#headers ⇒ Array<String>, ...
10 |
# File 'lib/ansible/ruby/modules/custom/network/basics/get_url.rb', line 10 validates :headers, type: Hash |
#others ⇒ Object?
66 |
# File 'lib/ansible/ruby/modules/generated/core/network/basics/get_url.rb', line 66 attribute :others |
#sha256sum ⇒ Object?
33 |
# File 'lib/ansible/ruby/modules/generated/core/network/basics/get_url.rb', line 33 attribute :sha256sum |
#timeout ⇒ Integer?
48 |
# File 'lib/ansible/ruby/modules/generated/core/network/basics/get_url.rb', line 48 attribute :timeout |
#tmp_dest ⇒ String?
21 |
# File 'lib/ansible/ruby/modules/generated/core/network/basics/get_url.rb', line 21 attribute :tmp_dest |
#to_h ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/ansible/ruby/modules/custom/network/basics/get_url.rb', line 12 def to_h result = super data = result[:get_url] # Ansible expects a string for some reason if data.include? :headers data[:headers] = data[:headers].map do |key, value| "#{key}:#{value}" end.join ',' end result end |
#url ⇒ String
13 |
# File 'lib/ansible/ruby/modules/generated/core/network/basics/get_url.rb', line 13 attribute :url |
#url_password ⇒ Object?
59 |
# File 'lib/ansible/ruby/modules/generated/core/network/basics/get_url.rb', line 59 attribute :url_password |
#url_username ⇒ Object?
56 |
# File 'lib/ansible/ruby/modules/generated/core/network/basics/get_url.rb', line 56 attribute :url_username |
#use_proxy ⇒ :yes, ...
40 |
# File 'lib/ansible/ruby/modules/generated/core/network/basics/get_url.rb', line 40 attribute :use_proxy |
#validate_certs ⇒ :yes, ...
44 |
# File 'lib/ansible/ruby/modules/generated/core/network/basics/get_url.rb', line 44 attribute :validate_certs |