Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bschonec opened this issue Aug 22, 2022 · 1 comment
Open

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

bschonec opened this issue Aug 22, 2022 · 1 comment

Comments

@bschonec
Copy link

bschonec commented Aug 22, 2022

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?

@lvicainne
Copy link
Owner

Hi !
As you notice, this project is not currently under a heavy dvelopment.
Feel free to propose your PR and I will merge it as long as it is runnable :)
I think your proposal is quite interesting !
Kr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants