On Tuesday, August 12, 2014 at 1:57:14 AM UTC-5, Vikas Kumar wrote: > > Hello, > > I am looking for an option to add multiple lines to a */etc/bashrc* and > */etc/profile*. I can do this with *file_line*, but is there any other > alternative. *file_line* does the job but for each line I will have to > create a *file_line* resource, which does not sound good for multiple > lines. > > If all the lines you want to add are available from one source, then you could join them with semicolons and add them as one line.
Alternatively, some Linux distributions (RedHat-family distros for sure) ship with a built-in mechanism for this. On CentOS, for example, both /etc/profile and /etc/bashrc process shell code from each and every file in /etc/profile.d/*.sh. On such systems, you can inject your own code into the shell configuration by dropping a world-readable file of whatever length you want into /etc/profile.d. This is incredibly useful. If your systems are not built that way by default then you can use a File_line to insert a (complex) one-liner into /etc/profile and /etc/bashrc to enable such a feature, and then proceed as above. John -- 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/33a0b177-00b0-4df7-acc2-44eeea62602f%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.