Forge Home

chroot

Puppet module for creating chroot environments

23,368 downloads

22,900 latest version

4.6 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.2.0 (latest)
  • 0.1.1
  • 0.1.0 (deleted)
released Aug 14th 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 'maxhope-chroot', '0.2.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add maxhope-chroot
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install maxhope-chroot --version 0.2.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

maxhope/chroot — version 0.2.0 Aug 14th 2015

chroot

Table of Contents

  1. Overview
  2. Module Description
  3. Setupt
  4. Usage
  5. Reference
  6. Limitations
  7. Development

Overview

Create and run executables in chroot environments.

Module Description

This module setups and run executables in chroot environments.

Setup

What chroot affects

  • chroot will create the file /tmp/chroot_setup.sh that setups the chroot environment

Beginning with chroot

I strongly recommend you to read about the chroot command. Type 'man chroot' in you terminal.

Usage

You can create a chroot environment by calling the chroot class:

class {'::chroot': 
  $ensure     = present,
  $path       = '/opt/mychroot',
  $contents   = ['/bin', '/usr/bin','/usr/lib', '/usr/lib64', '/etc', '/dev', '/lib', '/lib64'],
  $copy       = ['/etc/group', '/etc/passwd', '/etc/resolv.conf', '/etc/hosts'],
  $exec       = '/usr/bin/cat',
  $userspec   = 'root:root',
  $groups     = '',
}

This will create a complete chroot environment and create all folders and files specified by you and also copy you executables´dependencies into the chroot environment.

If you already have a complete chroot environment, then you can use the chroot type:

chroot {'mychroot':
   ensure     => present,
   path       => /path/to/chroot,
   userspec   => 'root:root',
   groups     => '',
   exec       => '/usr/bin/cat',
 }

Class parameters

  • ensure
    Setup or uninstall the chroot environment. Accepted values: [present | absent]
  • path
    The path to your chroot environment. Ex: /opt/mychroot
  • contents
    The folders to be created in your chroot environment. Accepted value: string array. Ex: ['/bin', '/usr/bin','/usr/lib', '/etc', '/dev', '/lib']
  • copy
    The files to be copied to your chroot environment. Accepted value: string array. Ex: ['/etc/group', '/etc/passwd', '/etc/resolv.conf', '/etc/hosts'],
  • exec
    The path to the executable to be run in the chroot environment. Ex:'/usr/bin/bash'
  • userspec
    The userspec to be used when running the chroot environment. Ex: 'root:root',
  • groups
    The additional groups to be used when running the executable in the chroot environment. Accepted value: string array. Ex: ['wheel']

Limitations

Puppet 3.7 or above is recommended.

Development

Check the github repos for the code and there you can request for merges if you have maked any improvements.