Giter VIP home page Giter VIP logo

ansible-role-download's Introduction

Ansible Download Role

Role to download files/archives to machine.

Supported OS Families

  • Ubuntu (tested)
  • Arch Linux (tested)
  • Redhat (untested)
  • All the other linux distro should work just fine

Role Variables

Available variables are listed below, the default values are in defaults/main.yml:

## List of files to download
download_geturl_options:
- url: url where to download file (string)
  dest_file: file path where the downloaded file will be at (string)
  mode: file permissions, default to OS default (string)
  owner: owner of the file, default to OS default (string)
  group: group of the file, default to OS default (string)
  force: whether to replace if file already exists, default to no (bool)
  checksum: checksum to ensure file validity, format is <algorithm>:<checksum|url>, default to nothing (string)
  backup: whether to backup original file, default is no (bool)
  url_username: username for http basic authentication, default is nothing (string)
  url_password: password for http basic authentication, default is nothing (string)

## List of archive files to download
download_geturl_archive_options:
- url: url where to download file (string)
  dest_folder: folder path where the downloaded archive files will be at (string)
  mode: files permissions, default to OS default (string)
  owner: owner of the files, default to OS default (string)
  group: group of the files, default to OS default (string)
  force: whether to replace if folder already exists, default to no (bool)
  checksum: checksum to ensure file validity, format is <algorithm>:<checksum|url>, default to nothing (string)
  backup: whether to backup original file, default is no (bool)
  url_username: username for http basic authentication, default is nothing (string)
  url_password: password for http basic authentication, default is nothing (string)

Dependencies

None

Example Playbook

Here is an example playbook:

- hosts: all

  vars:
    download_geturl_options:
    - url: https://raw.githubusercontent.com/username/repo/master/file.txt
      dest_file: ~/Downloads/file.txt
      checksum: sha256:123584564yda2fas5df31fad23afa532
    - url: https://raw.githubusercontent.com/username/repo/master/file2.txt
      dest_file: ~/Documents/file2.txt
      checksum: sha256:http://example.com/path/sha256sum.txt
      owner: somebody
      group: somebody
      backup: yes
    download_geturl_archive_options:
    - url: https://raw.githubusercontent.com/username/repo/master/file.zip
      dest_folder: ~/Downloads
      checksum: sha256:123584564yda2fas5df31fad23afa532

  roles:
  - budimanjojo.download

License

MIT License

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.