salt.states.libcloud_storage

Apache Libcloud Storage State

Manage cloud storage using libcloud

codeauthor

Anthony Shaw <[email protected]>

Apache Libcloud Storage (object/blob) management for a full list of supported clouds, see http://libcloud.readthedocs.io/en/latest/storage/supported_providers.html

Clouds include Amazon S3, Google Storage, Aliyun, Azure Blobs, Ceph, OpenStack swift

New in version 2018.3.0.

configuration

This module uses a configuration profile for one or multiple Storage providers

libcloud_storage:
    profile_test1:
      driver: google_storage
      key: GOOG0123456789ABCXYZ
      secret: mysecret
    profile_test2:
      driver: s3
      key: 12345
      secret: mysecret

Examples

Creating a container and uploading a file

web_things:
  libcloud_storage.container_present:
    name: my_container_name
    profile: profile1
  libcloud_storage.object_present:
    name: my_file.jpg
    container: my_container_name
    path: /path/to/local/file.jpg
    profile: profile1

Downloading a file

This example will download the file from the remote cloud and keep it locally

web_things:
  libcloud_storage.file_present:
    name: my_file.jpg
    container: my_container_name
    path: /path/to/local/file.jpg
    profile: profile1
depends

apache-libcloud

salt.states.libcloud_storage.container_absent(name, profile)

Ensures a container is absent.

Parameters
  • name (str) -- Container name

  • profile (str) -- The profile key

salt.states.libcloud_storage.container_present(name, profile)

Ensures a container is present.

Parameters
  • name (str) -- Container name

  • profile (str) -- The profile key

salt.states.libcloud_storage.file_present(container, name, path, profile, overwrite_existing=False)

Ensures a object is downloaded locally.

Parameters
  • container (str) -- Container name

  • name (str) -- Object name in cloud

  • path (str) -- Local path to file

  • profile (str) -- The profile key

  • overwrite_existing (bool) -- Replace if already exists

salt.states.libcloud_storage.object_absent(container, name, profile)

Ensures a object is absent.

Parameters
  • container (str) -- Container name

  • name (str) -- Object name in cloud

  • profile (str) -- The profile key

salt.states.libcloud_storage.object_present(container, name, path, profile)

Ensures a object is presnt.

Parameters
  • container (str) -- Container name

  • name (str) -- Object name in cloud

  • path (str) -- Local path to file

  • profile (str) -- The profile key

salt.states.libcloud_storage.state_result(result, message, name, changes)

© 2021 SaltStack.
Licensed under the Apache License, Version 2.0.
https://docs.saltproject.io/en/latest/ref/states/all/salt.states.libcloud_storage.html