Forge Home

scp

support for downloading to agents via scp

12,533 downloads

12,533 latest version

4.4 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Support the Puppet Community by contributing to this module

You are welcome to contribute to this module by suggesting new features, currency updates, or fixes. Every contribution is valuable to help ensure that the module remains compatible with the latest Puppet versions and continues to meet community needs. Complete the following steps:

  1. Review the module’s contribution guidelines and any licenses. Ensure that your planned contribution aligns with the author’s standards and any legal requirements.
  2. Fork the repository on GitHub, make changes on a branch of your fork, and submit a pull request. The pull request must clearly document your proposed change.

For questions about updating the module, contact the module’s author.

Version information

  • 0.1.0 (latest)
released Apr 9th 2015
This version is compatible with:

    Start using this module

    • r10k or Code Manager
    • Bolt
    • Manual installation
    • Direct download

    Add this module to your Puppetfile:

    mod 'geoffwilliams-scp', '0.1.0'
    Learn more about managing modules with a Puppetfile

    Add this module to your Bolt project:

    bolt module add geoffwilliams-scp
    Learn more about using this module with an existing project

    Manually install this module globally with Puppet module tool:

    puppet module install geoffwilliams-scp --version 0.1.0

    Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

    Download

    Documentation

    geoffwilliams/scp — version 0.1.0 Apr 9th 2015

    scp

    Table of Contents

    1. Overview
    2. Module Description - What the module does and why it is useful
    3. Setup - The basics of getting started with scp
    4. Usage - Configuration options and additional functionality
    5. Reference - An under-the-hood peek at what the module is doing and how
    6. Limitations - OS compatibility, etc.
    7. Development - Guide for contributing to the module

    Overview

    A Puppet Type and Provide to download files onto an agent via scp

    Module Description

    This module gives you a nice way of invoking the scp (secure copy) command to download files from other servers via scp. By default, this provider will login to the server hosting the files via ssh and perform md5 validation to determine whether the local copy needs to be updated or not.

    Of course, you don't normally want to be using scp to download random files onto computers in a non-random way (e.g., via Puppet), there are much better ways of doing this, such as network shared storage and dedicated servers such as artifactory.

    That said, sometimes you need a stop-gap solution so this module could be something that will buy you enough time to get rid of scp and do things properly.

    Setup

    What scp affects

    • provides a new type: scp

    Setup Requirements

    • scp command in path
    • ssh command in path
    • ssh public/private keypair generated for local user who will be running the scp command (root)
    • ssh configured to accept the key of the local user on the remote server
    • At least one successful ssh login from the local user to the remote server (to verify the ssh keys in known_hosts)

    Beginning with scp

    Ensure the above requirements are met

    Downloading a file to a node

    scp { "/tmp/myfile.war":
      ensure => present
      source => "fred@build.mycompany.com/var/jenkins/data/myapp_current.war",
    }
    

    This would use the fred account on build.mycompany.com to download the file at /var/jenkins/data/myapp\_current.war to the node where it will be saved at /tmp/myfile.war.

    Usage

    By default the scp type will perform remote verfication of md5 sums to check whether the local copy of the file needs to be updated. This can be disabled in case this is generating excessive load or ssh access is locked down:

    scp { "/tmp/myfile.war":
      ensure => present,
      source => "fred@build.mycompany.com/var/jenkins/data/myapp_current.war",
      verify => false,
    }
    

    Reference

    This module includes a single Type and Provider: scp

    Limitations

    • Linux only
    • Passwordless SSH only
    • Runs as root
    • You must manually SSH into the target machine as the local root user to accept it's key before attempting to use this module