Skip to content

Add ability to modify the ~/.bash_profile for users #6

@bschonec

Description

@bschonec

I have a great need to modify the .bash_profile for individual users. I am working on a pull request but would like feedback on how to implement such a feature.

I was thinking about adding a key in the bashrc::users variable called 'bashprofile' and then have the puppet template iterate over all of the key/pair values. Of course, there wouldn't be any kind of sanity checking doing it this way.

bashrc::users:       
  - username: "SomeUserName"
    managelocalbashrc: true
    homedirectory: "/home/SomeUserName"
    bashprofile:  
      export:        
        - JAVA_HOME: /foo/bar
        - JBOSS_HOME: /fee/bar

templates/skel/profile.erb additions:

<% @key['bashprofile']['export'].each do |k| -%>
export <%= k %>=<%= k.keys %>  value:    
<% end -%>

This PR gives an example of what I'm thinking.

This module comes up as the first or second hit when searching for 'puppet module bash_profile'.

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions