Hi,

I am new to puppet and I am trying to write a module to manage user .bashrc 
files. I managed to place the file to the desired location with following 
code for 1 user because the username is hardcoded. However, I tried 
different ways to manage the file for 10 different users using variables 
which fails. Can someone please help me with the same.

init.pp:
class profile (
  $bashrc                          = $profile::params::bashrc,
  $bashrc_host                  = $profile::params::bashrc_host,
) inherits profile::params {

  anchor { 'profile::begin': } ->
  class { '::profile::config': } ->
  anchor { 'profile::end': }
}

config.pp:
class profile::config inherits profile {
file { $bashrc:
       ensure => file,
       source  => "puppet:///$bashrc_host",
    }

params:pp:
class profile::params {
  $bashrc_host        = "modules/profile/$fqdn_user1_bashrc"
}
  case $::osfamily {
    'RedHat': {
      $bashrc                  = '/home/user1/.bashrc'
    }
    default: {
      fail("The ${module_name} module is not supported on an ${::osfamily} 
based system.")
    }
  }

Thank You

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/eda4893c-a09d-44cd-80c3-c9c0f0d67599%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to