Forge Home

rootless

Puppet types, providers, and facts for rootless environments

8,988 downloads

8,524 latest version

3.3 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.

Version information

  • 0.3.0 (latest)
  • 0.2.0
  • 0.1.0
released Oct 7th 2013

Start using this module

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

Add this module to your Puppetfile:

mod 'UTiWorldwide-rootless', '0.3.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add UTiWorldwide-rootless
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install UTiWorldwide-rootless --version 0.3.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
Tags: rootless

Documentation

UTiWorldwide/rootless — version 0.3.0 Oct 7th 2013

#Rootless

A puppet module providing types and providers to enable puppet to be functional without running as root.

One goal is to produce near-normal puppet types so that regular puppet manifests can be written in the regular style.

Another goal is to integrate well with sudo functionality.

##Types

###rootless::file

A file type that overcomes the limitiation of creating the file. This assumes that the file is writeable by the user puppet is running as. It overcomes the problem where the containing directory of the file is not writeable by the user running puppet.

rootless::file {'/etc/httpd/conf.d/app.conf':
  content => template('application.apache.erb'),
  notify  => Service['httpd'],
}

###rootless::tardir

A type that will untar a tarfile that contains a directory. The tarfile must be local or nfs mounted and the tarball must create a single directory (for purging to work). Additionally the folder that is being created must be known ahead of time. This is a base type that can be leveraged to make a more complex behavior.

rootless::tardir { '/opt/app/place/folder':
  ensure  => absent,
  tarfile => '/big/nfs/mount/tar.tar.gz'
}

rootless::tardir { '/opt/app/other_place/folder':
  ensure  => present,
  tarfile => '/big/nfs/mount/tar.tar.gz'
}

###rootless::zipdir

A type that will unzip a zipfile that contains a directory. The zipfile must be local or nfs mounted and the zip must create a single directory (for purging to work). Additionally the folder that is being created must be known ahead of time. This is a base type that can be leveraged to make a more complex behavior.

rootless::zipdir { '/opt/app/place/folder':
  ensure  => absent,
  zipfile => '/big/nfs/mount/zipfile.zip'
}

rootless::zipdir { '/opt/app/other_place/folder':
  ensure  => present,
  zipfile => '/big/nfs/mount/zipfile.zip'
}

###rootless::jdk

A type that will install a jdk based on major and minor version number from a tarball found somewhere else on the filesystem(often an nfs mount).

rootless::jdk { '/opt/app/place/':
  ensure              => present,
  jdk_major_version  => '7',
  jdk_update_version => '25',
  tarball_directory   => '/big/nfs/mount',
}

rootless::jdk { '/opt/app/other_place/':
  ensure            => present,
  tarball_directory => '/big/nfs/mount',
  jdk_file         => 'my-special-jdk-tarball.tar.gz',
  jdk_install_dir  => 'jdk1.7.0_09',    # the directory created by the untar operation
}

rootless::jdk { '/opt/app/yet_another_place/':
  ensure           => absent,
  jdk_install_dir => 'jdk-1.7.0_12',
}

rootless::jdk { 'my-jdk-install':
  ensure              => present,
  jdk_major_version  => '7',
  jdk_update_version => '25',
  tarball_directory   => '/big/nfs/mount',
  install_root        => '/opt/app/best_place',
}

###rootless::jruby

A type that will install a jruby based on version number from a tarball found somewhere else on the filesystem(often an nfs mount).

rootless::jruby { '/opt/app/place/':
  ensure              => present,
  jruby_version       => '1.7.1',
  tarball_directory   => '/big/nfs/mount',
}

rootless::jruby { '/opt/app/other_place/':
  ensure             => present,
  tarball_directory  => '/big/nfs/mount',
  jruby_file         => 'my-special-jruby-tarball.tar.gz',
  jruby_install_dir  => 'jruby-1.7.1',    # the directory created by the untar operation
}

rootless::jruby { '/opt/app/yet_another_place/':
  ensure            => absent,
  jruby_install_dir => 'jruby-1.6.6',
}

rootless::jruby { 'my-jruby-install':
  ensure               => present,
  jruby_version        => '1.6.6',
  tarball_directory    => '/big/nfs/mount',
  install_root         => '/opt/app/best_place',
}

##Facts

###var_tmp_rw

A fact checking if /var/tmp is writable by the puppet user. Var/tmp is a good place to store permanent temporary files, for the rootless::file type for instance. This will help us pick a tempdir to create things. Var/tmp is preferable to /tmp since /var/tmp usually persists after reboot.

###puppet_user

A fact returning the name of the current user

###puppet_group

A fact returning the name of the current group

###puppet_user_home

A fact returning the home_directory of the current user

#Requirements

  • puppetlabs-stdlib