Forge Home

profile_d

profile-d Module ables you to manage files under /etc/profile.d/

9,134 downloads

9,086 latest version

3.1 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.2.0 (deleted)
  • 0.1.0 (latest)
released Oct 16th 2015

Start using this module

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

Add this module to your Puppetfile:

mod 'marcgascon-profile_d', '0.1.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add marcgascon-profile_d
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install marcgascon-profile_d --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

marcgascon/profile_d — version 0.1.0 Oct 16th 2015

puppet-profile_d

Puppet module to create scripts in /etc/profile.d or $HOME/.profile.d.

Depencendies:

'puppetlabs/stdlib', '>=3.2.0'

Basic usage

Create a simple script that sets one variable

profile_d::script { 'name-of-script.sh':
  ensure  => present,
  content => 'export VARIABLE=value',
}

Create a multi-line script using a template

profile_d::script { 'name-of-script.sh':
  ensure       => present,
  content_file => "${module_name}/script-template.sh.erb",
}

Create a script using a file source

profile_d::script { 'name-of-script.sh':
  ensure => present,
  source => "puppet:///modules/${module_name}/script.sh",
}

Create a script to change the default shell (/bin/sh) :

profile_d::script { 'name-of-script.sh':
  ensure  => present,
  content => 'export VARIABLE=value',
  shell   => '/bin/bash',
}

Create a script that sets one variable for the root user :

profile_d::script { 'name-of-script.sh':
  ensure  => present,
  content => 'export VARIABLE=value',
  user    => 'root',
}

Hiera example of usage

profile_d::hash_script:
  'name-of-script.sh':
    ensure: 'present'
    content: "export VARIABLE=value"
  'name-of-other-script.sh':
    ensure: 'present'
    source: "puppet:///modules/${module_name}/script.sh"
    shell: '/bin/bash'
    user: 'marc.gascon'
  'name-of-the-last-script.sh':
    content_file: "${module_name}/script-template.sh.erb"
    user: root