Class: Ansible::Ruby::Modules::Get_url
- Inherits:
-
Base
- Object
- Ansible::Ruby::Models::Base
- Base
- Ansible::Ruby::Modules::Get_url
- Includes:
- Helpers::FileAttributes
- Defined in:
- lib/ansible/ruby/modules/generated/net_tools/basics/get_url.rb,
lib/ansible/ruby/modules/custom/net_tools/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. From Ansible 2.4 when run with C(–check), it will do a HEAD request to validate the URL but will not download the entire file or verify it against hashes. For Windows targets, use the M(win_get_url) module instead.
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.
-
#client_cert ⇒ Object?
PEM formatted certificate chain file to be used for SSL client authentication.
-
#client_key ⇒ Object?
PEM formatted file that contains your private key to be used for SSL client authentication.
-
#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 ⇒ Hash?
Add custom HTTP headers to a request in hash/dict format.
-
#others ⇒ Object?
All arguments accepted by the M(file) module also work here.
-
#sha256sum ⇒ String?
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 ⇒ Object?
Absolute path of where temporary file is downloaded to.,When run on Ansible 2.5 or greater, path defaults to ansible’s remote_tmp setting,When run on Ansible prior to 2.5, it defaults to C(TMPDIR), C(TEMP) or C(TMP) env variables or a platform specific value.,U(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.,If the C(url_username) parameter is not specified, the C(url_password) parameter will not be used.
-
#url_username ⇒ Object?
The username for use in HTTP basic authentication.,This parameter can be used without C(url_password) for sites that allow empty passwords.
-
#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 included from Helpers::FileAttributes
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, ...
31 |
# File 'lib/ansible/ruby/modules/generated/net_tools/basics/get_url.rb', line 31 attribute :backup |
#checksum ⇒ String?
39 |
# File 'lib/ansible/ruby/modules/generated/net_tools/basics/get_url.rb', line 39 attribute :checksum |
#client_cert ⇒ Object?
69 |
# File 'lib/ansible/ruby/modules/generated/net_tools/basics/get_url.rb', line 69 attribute :client_cert |
#client_key ⇒ Object?
72 |
# File 'lib/ansible/ruby/modules/generated/net_tools/basics/get_url.rb', line 72 attribute :client_key |
#dest ⇒ String
20 |
# File 'lib/ansible/ruby/modules/generated/net_tools/basics/get_url.rb', line 20 attribute :dest |
#force ⇒ :yes, ...
27 |
# File 'lib/ansible/ruby/modules/generated/net_tools/basics/get_url.rb', line 27 attribute :force |
#force_basic_auth ⇒ :yes, ...
65 |
# File 'lib/ansible/ruby/modules/generated/net_tools/basics/get_url.rb', line 65 attribute :force_basic_auth |
#headers ⇒ Hash?
55 |
# File 'lib/ansible/ruby/modules/generated/net_tools/basics/get_url.rb', line 55 attribute :headers |
#others ⇒ Object?
75 |
# File 'lib/ansible/ruby/modules/generated/net_tools/basics/get_url.rb', line 75 attribute :others |
#sha256sum ⇒ String?
35 |
# File 'lib/ansible/ruby/modules/generated/net_tools/basics/get_url.rb', line 35 attribute :sha256sum |
#timeout ⇒ Integer?
51 |
# File 'lib/ansible/ruby/modules/generated/net_tools/basics/get_url.rb', line 51 attribute :timeout |
#tmp_dest ⇒ Object?
24 |
# File 'lib/ansible/ruby/modules/generated/net_tools/basics/get_url.rb', line 24 attribute :tmp_dest |
#to_h ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/ansible/ruby/modules/custom/net_tools/basics/get_url.rb', line 14 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
16 |
# File 'lib/ansible/ruby/modules/generated/net_tools/basics/get_url.rb', line 16 attribute :url |
#url_password ⇒ Object?
62 |
# File 'lib/ansible/ruby/modules/generated/net_tools/basics/get_url.rb', line 62 attribute :url_password |
#url_username ⇒ Object?
59 |
# File 'lib/ansible/ruby/modules/generated/net_tools/basics/get_url.rb', line 59 attribute :url_username |
#use_proxy ⇒ :yes, ...
43 |
# File 'lib/ansible/ruby/modules/generated/net_tools/basics/get_url.rb', line 43 attribute :use_proxy |
#validate_certs ⇒ :yes, ...
47 |
# File 'lib/ansible/ruby/modules/generated/net_tools/basics/get_url.rb', line 47 attribute :validate_certs |