profile_d

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

Marc Gascon

marcgascon

7,850 downloads

7,822 latest version

3.1 quality score

Version information

  • 0.2.0 (latest)
  • 0.1.0
released Oct 16th 2015

Start using this module

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