1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

#4408 s3: add force alias for overwrite and set True by default

This commit is contained in:
James Tanner 2013-10-09 12:56:56 -04:00
parent c55107fa83
commit c679491ece

View file

@ -52,7 +52,7 @@ options:
description: description:
- Force overwrite either locally on the filesystem or remotely with the object/key. Used with PUT and GET operations. - Force overwrite either locally on the filesystem or remotely with the object/key. Used with PUT and GET operations.
required: false required: false
default: false default: true
version_added: "1.2" version_added: "1.2"
mode: mode:
description: description:
@ -93,9 +93,13 @@ EXAMPLES = '''
# Simple GET operation # Simple GET operation
- s3: bucket=mybucket object=/my/desired/key.txt dest=/usr/local/myfile.txt mode=get - s3: bucket=mybucket object=/my/desired/key.txt dest=/usr/local/myfile.txt mode=get
# GET/download and overwrite local file (trust remote) # GET/download and overwrite local file (trust remote)
- s3: bucket=mybucket object=/my/desired/key.txt dest=/usr/local/myfile.txt mode=get overwrite=true - s3: bucket=mybucket object=/my/desired/key.txt dest=/usr/local/myfile.txt mode=get
# GET/download and do not overwrite local file (trust remote)
- s3: bucket=mybucket object=/my/desired/key.txt dest=/usr/local/myfile.txt mode=get force=false
# PUT/upload and overwrite remote file (trust local) # PUT/upload and overwrite remote file (trust local)
- s3: bucket=mybucket object=/my/desired/key.txt src=/usr/local/myfile.txt mode=put overwrite=true - s3: bucket=mybucket object=/my/desired/key.txt src=/usr/local/myfile.txt mode=put
# PUT/upload and do not overwrite remote file (trust local)
- s3: bucket=mybucket object=/my/desired/key.txt src=/usr/local/myfile.txt mode=put force=false
# Download an object as a string to use else where in your playbook # Download an object as a string to use else where in your playbook
- s3: bucket=mybucket object=/my/desired/key.txt src=/usr/local/myfile.txt mode=getstr - s3: bucket=mybucket object=/my/desired/key.txt src=/usr/local/myfile.txt mode=getstr
# Create an empty bucket # Create an empty bucket
@ -253,7 +257,7 @@ def main():
s3_url = dict(aliases=['S3_URL']), s3_url = dict(aliases=['S3_URL']),
aws_secret_key = dict(aliases=['ec2_secret_key', 'secret_key'], no_log=True, required=False), aws_secret_key = dict(aliases=['ec2_secret_key', 'secret_key'], no_log=True, required=False),
aws_access_key = dict(aliases=['ec2_access_key', 'access_key'], required=False), aws_access_key = dict(aliases=['ec2_access_key', 'access_key'], required=False),
overwrite = dict(default=False, type='bool'), overwrite = dict(aliases=['force'], default=True, type='bool'),
), ),
) )