Forge Home

util

My Standard Library for Puppet Modules

12,386 downloads

12,164 latest version

2.0 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

  • 1.1.0 (latest)
  • 1.0.0
released Mar 20th 2014

Start using this module

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

Add this module to your Puppetfile:

mod 'leonardothibes-util', '1.1.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add leonardothibes-util
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install leonardothibes-util --version 1.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

leonardothibes/util — version 1.1.0 Mar 20th 2014

puppet-util

My Standard Library for Puppet Modules.

This module provides a "standard library" of resources for developing Puppet Modules. This modules will include the following additions to Puppet:

  • chmod
  • chown
  • compress
  • extract

Functions

chmod

Change the permission of file or directory.

Examples:

util::chmod {'Changing permission for some file':
    file => '/some/file.txt',
    mode => 0644,
}
util::chmod {'Changing permission for some directory':
    file => '/root',
    mode => 0700,
}
util::chmod {'Changing permission for some directory recursively':
    file      => '/root',
    mode      => 0700,
    recursive => true, # default is "false"
}

chown

Change the owner of file or directory.

Examples:

util::chown {'Changing owner for some file':
    file => '/root/file.txt',
    user => 'root',
}
util::chown {'Changing owner for some directory':
    file  => '/srv',
    user  => 'root',
    group => 'admin',
}
util::chown {'Changing owner for some directory recursively':
    file      => '/root',
    user      => 'root',
    group     => 'admin',
    recursive => true,
}

compress

Compres an file or directory.

The type of compression is determined for the file extension.

Examples of compressing files:

util::compress {'Compressing some file with zip utility':
    from => '/tmp/vagrant-shell',
    to   => '/tmp/vagrant-shell.zip',
}
util::compress {'Compressing some file with gzip utility':
    from => '/tmp/vagrant-shell',
    to   => '/tmp/vagrant-shell.gz',
}
util::compress {'Compressing some file with bzip2 utility':
    from => '/tmp/vagrant-shell',
    to   => '/tmp/vagrant-shell.bz2',
}

Examples of compressing directories:

util::compress {'Compressing some directory with zip utility':
    from => '/etc/vim',
    to   => '/root/vim.zip',
}
util::compress {'Compressing some directory with gzip utility':
    from => '/etc/vim',
    to   => '/root/vim.tar.gz',
}
util::compress {'Compressing some directory with bzip2 utility':
    from => '/etc/vim',
    to   => '/root/vim.tar.bz2',
}

extract

Extract an compressed file.

The type of extraction is determined for the file extension.

Examples of extracting files:

util::extract {'extracting some file with zip utility':
    from => '/tmp/vagrant-shell.zip',
    to   => '/root',
}
util::extract {'extracting some file with gzip utility':
    from => '/tmp/vagrant-shell.gz',
    to   => '/root',
}
util::extract {'extracting some file with bzip2 utility':
    from => '/tmp/vagrant-shell.bz2',
    to   => '/root',
}

Examples of extracting directories:

util::extract {'Extracting some directory with zip utility':
    from => '/root/vim.zip',
    to   => '/tmp',
}
util::extract {'Extracting some directory with gzip utility':
    from => '/root/vim.tar.gz',
    to   => '/tmp',
}
util::extract {'Extracting some directory with bzip2 utility':
    from => '/root/vim.tar.bz2',
    to   => '/tmp',
}

Contact

Principal developer: Leonardo Thibes => eu@leonardothibes.com

Support

Please log tickets and issues at our Projects site