|
|
@ -35,7 +35,8 @@ version_added: "0.6"
|
|
|
|
options:
|
|
|
|
options:
|
|
|
|
url:
|
|
|
|
url:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- HTTP, HTTPS, or FTP URL
|
|
|
|
- HTTP, HTTPS, or FTP URL.
|
|
|
|
|
|
|
|
(http|https|ftp)://[user[:pass]]@host.domain[:port]/path
|
|
|
|
required: true
|
|
|
|
required: true
|
|
|
|
default: null
|
|
|
|
default: null
|
|
|
|
aliases: []
|
|
|
|
aliases: []
|
|
|
@ -63,18 +64,18 @@ examples:
|
|
|
|
- code: "get_url: url=http://example.com/path/file.conf dest=/etc/foo.conf mode=0440"
|
|
|
|
- code: "get_url: url=http://example.com/path/file.conf dest=/etc/foo.conf mode=0440"
|
|
|
|
description: "Example from Ansible Playbooks"
|
|
|
|
description: "Example from Ansible Playbooks"
|
|
|
|
notes:
|
|
|
|
notes:
|
|
|
|
- This module doesn't yet support configuration for proxies or passwords.
|
|
|
|
- This module doesn't yet support configuration for proxies.
|
|
|
|
# informational: requirements for nodes
|
|
|
|
# informational: requirements for nodes
|
|
|
|
requirements: [ urllib2, urlparse ]
|
|
|
|
requirements: [ urllib2, urlparse ]
|
|
|
|
author: Jan-Piet Mens
|
|
|
|
author: Jan-Piet Mens
|
|
|
|
'''
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
|
|
HAS_URLLIB2=True
|
|
|
|
HAS_URLLIB2 = True
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
import urllib2
|
|
|
|
import urllib2
|
|
|
|
except ImportError:
|
|
|
|
except ImportError:
|
|
|
|
HAS_URLLIB2=False
|
|
|
|
HAS_URLLIB2 = False
|
|
|
|
HAS_URLPARSE=True
|
|
|
|
HAS_URLPARSE = True
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
import urlparse
|
|
|
|
import urlparse
|
|
|
@ -255,8 +256,8 @@ def main():
|
|
|
|
|
|
|
|
|
|
|
|
# Mission complete
|
|
|
|
# Mission complete
|
|
|
|
module.exit_json(url=url, dest=dest, src=tmpsrc, md5sum=md5sum_src,
|
|
|
|
module.exit_json(url=url, dest=dest, src=tmpsrc, md5sum=md5sum_src,
|
|
|
|
changed=changed, msg=info.get('msg',''),
|
|
|
|
changed=changed, msg=info.get('msg', ''),
|
|
|
|
daisychain="file", daisychain_args=info.get('daisychain_args',''))
|
|
|
|
daisychain="file", daisychain_args=info.get('daisychain_args', ''))
|
|
|
|
|
|
|
|
|
|
|
|
# this is magic, see lib/ansible/module_common.py
|
|
|
|
# this is magic, see lib/ansible/module_common.py
|
|
|
|
#<<INCLUDE_ANSIBLE_MODULE_COMMON>>
|
|
|
|
#<<INCLUDE_ANSIBLE_MODULE_COMMON>>
|
|
|
|